Class: TripletexRubyClient::TravelExpenseApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_ruby_client/api/travel_expense_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TravelExpenseApi

Returns a new instance of TravelExpenseApi.



19
20
21
# File 'lib/tripletex_ruby_client/api/travel_expense_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/tripletex_ruby_client/api/travel_expense_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#approve(opts = {}) ⇒ ListResponseTravelExpense

BETA

Approve travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:



27
28
29
30
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 27

def approve(opts = {})
  data, _status_code, _headers = approve_with_http_info(opts)
  data
end

#approve_with_http_info(opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Approve travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



37
38
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
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 37

def approve_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.approve ...'
  end
  # resource path
  local_var_path = '/travelExpense/:approve'

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#approve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#copy(id, opts = {}) ⇒ ResponseWrapperTravelExpense

BETA

Copy travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Returns:



74
75
76
77
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 74

def copy(id, opts = {})
  data, _status_code, _headers = copy_with_http_info(id, opts)
  data
end

#copy_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperTravelExpense, Fixnum, Hash)>

BETA

Copy travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Returns:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 84

def copy_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.copy ...'
  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 TravelExpenseApi.copy"
  end
  # resource path
  local_var_path = '/travelExpense/:copy'

  # query parameters
  query_params = {}
  query_params[:'id'] = id

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#copy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_vouchers(date, opts = {}) ⇒ ListResponseTravelExpense

BETA

Create vouchers

Parameters:

  • date

    yyyy-MM-dd. Defaults to today.

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:



128
129
130
131
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 128

def create_vouchers(date, opts = {})
  data, _status_code, _headers = create_vouchers_with_http_info(date, opts)
  data
end

#create_vouchers_with_http_info(date, opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Create vouchers

Parameters:

  • date

    yyyy-MM-dd. Defaults to today.

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 139

def create_vouchers_with_http_info(date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.create_vouchers ...'
  end
  # verify the required parameter 'date' is set
  if @api_client.config.client_side_validation && date.nil?
    fail ArgumentError, "Missing the required parameter 'date' when calling TravelExpenseApi.create_vouchers"
  end
  # resource path
  local_var_path = '/travelExpense/:createVouchers'

  # query parameters
  query_params = {}
  query_params[:'date'] = date
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#create_vouchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(id, opts = {}) ⇒ nil

BETA

Delete travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Returns:

  • (nil)


183
184
185
186
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 183

def delete(id, opts = {})
  delete_with_http_info(id, opts)
  nil
end

#delete_attachment(travel_expense_id, opts = {}) ⇒ nil

BETA

Delete attachment.

Parameters:

  • travel_expense_id

    ID of attachment containing the attachment to delete.

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

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher containing the attachment to delete.

  • :send_to_inbox (BOOLEAN)

    Should the attachment be sent to inbox rather than deleted? (default to false)

  • :split (BOOLEAN)

    If sendToInbox is true, should the attachment be split into one voucher per page? (default to false)

Returns:

  • (nil)


235
236
237
238
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 235

def delete_attachment(travel_expense_id, opts = {})
  delete_attachment_with_http_info(travel_expense_id, opts)
  nil
end

#delete_attachment_with_http_info(travel_expense_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

BETA

Delete attachment.

Parameters:

  • travel_expense_id

    ID of attachment containing the attachment to delete.

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

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher containing the attachment to delete.

  • :send_to_inbox (BOOLEAN)

    Should the attachment be sent to inbox rather than deleted?

  • :split (BOOLEAN)

    If sendToInbox is true, should the attachment be split into one voucher per page?

Returns:

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

    nil, response status code and response headers



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
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
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 248

def delete_attachment_with_http_info(travel_expense_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.delete_attachment ...'
  end
  # verify the required parameter 'travel_expense_id' is set
  if @api_client.config.client_side_validation && travel_expense_id.nil?
    fail ArgumentError, "Missing the required parameter 'travel_expense_id' when calling TravelExpenseApi.delete_attachment"
  end
  if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] < 0
    fail ArgumentError, 'invalid value for "opts[:"version"]" when calling TravelExpenseApi.delete_attachment, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/travelExpense/{travelExpenseId}/attachment'.sub('{' + 'travelExpenseId' + '}', travel_expense_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
  query_params[:'sendToInbox'] = opts[:'send_to_inbox'] if !opts[:'send_to_inbox'].nil?
  query_params[:'split'] = opts[:'split'] if !opts[:'split'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#delete_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

BETA

Delete travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 193

def delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.delete ...'
  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 TravelExpenseApi.delete"
  end
  # resource path
  local_var_path = '/travelExpense/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deliver(opts = {}) ⇒ ListResponseTravelExpense

BETA

Deliver travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:



294
295
296
297
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 294

def deliver(opts = {})
  data, _status_code, _headers = deliver_with_http_info(opts)
  data
end

#deliver_with_http_info(opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Deliver travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 304

def deliver_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.deliver ...'
  end
  # resource path
  local_var_path = '/travelExpense/:deliver'

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#deliver\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_attachment(travel_expense_id, opts = {}) ⇒ String

Get attachment by travel expense ID.

Parameters:

  • travel_expense_id

    Travel Expense ID from which PDF is downloaded.

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

    the optional parameters

Returns:

  • (String)


341
342
343
344
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 341

def download_attachment(travel_expense_id, opts = {})
  data, _status_code, _headers = download_attachment_with_http_info(travel_expense_id, opts)
  data
end

#download_attachment_with_http_info(travel_expense_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get attachment by travel expense ID.

Parameters:

  • travel_expense_id

    Travel Expense ID from which PDF is downloaded.

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 351

def download_attachment_with_http_info(travel_expense_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.download_attachment ...'
  end
  # verify the required parameter 'travel_expense_id' is set
  if @api_client.config.client_side_validation && travel_expense_id.nil?
    fail ArgumentError, "Missing the required parameter 'travel_expense_id' when calling TravelExpenseApi.download_attachment"
  end
  # resource path
  local_var_path = '/travelExpense/{travelExpenseId}/attachment'.sub('{' + 'travelExpenseId' + '}', travel_expense_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/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#download_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(id, opts = {}) ⇒ ResponseWrapperTravelExpense

BETA

Get travel expense by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



394
395
396
397
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 394

def get(id, opts = {})
  data, _status_code, _headers = get_with_http_info(id, opts)
  data
end

#get_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperTravelExpense, Fixnum, Hash)>

BETA

Get travel expense by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 405

def get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.get ...'
  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 TravelExpenseApi.get"
  end
  # resource path
  local_var_path = '/travelExpense/{id}'.sub('{' + 'id' + '}', id.to_s)

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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 => 'ResponseWrapperTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post(opts = {}) ⇒ ResponseWrapperTravelExpense

BETA

Create travel expense.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (TravelExpense)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:



446
447
448
449
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 446

def post(opts = {})
  data, _status_code, _headers = post_with_http_info(opts)
  data
end

#post_with_http_info(opts = {}) ⇒ Array<(ResponseWrapperTravelExpense, Fixnum, Hash)>

BETA

Create travel expense.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (TravelExpense)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 456

def post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.post ...'
  end
  # resource path
  local_var_path = '/travelExpense'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  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 => 'ResponseWrapperTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put(id, opts = {}) ⇒ ResponseWrapperTravelExpense

BETA

Update travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :body (TravelExpense)

    Partial object describing what should be updated

Returns:



495
496
497
498
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 495

def put(id, opts = {})
  data, _status_code, _headers = put_with_http_info(id, opts)
  data
end

#put_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperTravelExpense, Fixnum, Hash)>

BETA

Update travel expense.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :body (TravelExpense)

    Partial object describing what should be updated

Returns:



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 506

def put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.put ...'
  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 TravelExpenseApi.put"
  end
  # resource path
  local_var_path = '/travelExpense/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search(opts = {}) ⇒ ListResponseTravelExpense

BETA

Find travel expenses corresponding with sent data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :employee_id (String)

    Equals

  • :department_id (String)

    Equals

  • :project_id (String)

    Equals

  • :project_manager_id (String)

    Equals

  • :departure_date_from (String)

    From and including

  • :return_date_to (String)

    To and excluding

  • :state (String)

    category (default to ALL)

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



558
559
560
561
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 558

def search(opts = {})
  data, _status_code, _headers = search_with_http_info(opts)
  data
end

#search_with_http_info(opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Find travel expenses corresponding with sent data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :employee_id (String)

    Equals

  • :department_id (String)

    Equals

  • :project_id (String)

    Equals

  • :project_manager_id (String)

    Equals

  • :departure_date_from (String)

    From and including

  • :return_date_to (String)

    To and excluding

  • :state (String)

    category

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 578

def search_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.search ...'
  end
  if @api_client.config.client_side_validation && opts[:'state'] && !['ALL', 'OPEN', 'APPROVED', 'SALARY_PAID', 'DELIVERED'].include?(opts[:'state'])
    fail ArgumentError, 'invalid value for "state", must be one of ALL, OPEN, APPROVED, SALARY_PAID, DELIVERED'
  end
  # resource path
  local_var_path = '/travelExpense'

  # query parameters
  query_params = {}
  query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'departmentId'] = opts[:'department_id'] if !opts[:'department_id'].nil?
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].nil?
  query_params[:'projectManagerId'] = opts[:'project_manager_id'] if !opts[:'project_manager_id'].nil?
  query_params[:'departureDateFrom'] = opts[:'departure_date_from'] if !opts[:'departure_date_from'].nil?
  query_params[:'returnDateTo'] = opts[:'return_date_to'] if !opts[:'return_date_to'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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 => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unapprove(opts = {}) ⇒ ListResponseTravelExpense

BETA

Unapprove travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:



628
629
630
631
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 628

def unapprove(opts = {})
  data, _status_code, _headers = unapprove_with_http_info(opts)
  data
end

#unapprove_with_http_info(opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Unapprove travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 638

def unapprove_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.unapprove ...'
  end
  # resource path
  local_var_path = '/travelExpense/:unapprove'

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#unapprove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#undeliver(opts = {}) ⇒ ListResponseTravelExpense

BETA

Undeliver travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:



675
676
677
678
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 675

def undeliver(opts = {})
  data, _status_code, _headers = undeliver_with_http_info(opts)
  data
end

#undeliver_with_http_info(opts = {}) ⇒ Array<(ListResponseTravelExpense, Fixnum, Hash)>

BETA

Undeliver travel expenses.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    ID of the elements

Returns:

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

    ListResponseTravelExpense data, response status code and response headers



685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 685

def undeliver_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.undeliver ...'
  end
  # resource path
  local_var_path = '/travelExpense/:undeliver'

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseTravelExpense')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#undeliver\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_attachment(travel_expense_id, file, opts = {}) ⇒ nil

Upload attachment to travel expense.

Parameters:

  • travel_expense_id

    Travel Expense ID to upload attachment to.

  • file

    The file

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

    the optional parameters

Options Hash (opts):

  • :create_new_cost (BOOLEAN)

    Create new cost row when you add the attachment (default to false)

Returns:

  • (nil)


724
725
726
727
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 724

def upload_attachment(travel_expense_id, file, opts = {})
  upload_attachment_with_http_info(travel_expense_id, file, opts)
  nil
end

#upload_attachment_with_http_info(travel_expense_id, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Upload attachment to travel expense.

Parameters:

  • travel_expense_id

    Travel Expense ID to upload attachment to.

  • file

    The file

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

    the optional parameters

Options Hash (opts):

  • :create_new_cost (BOOLEAN)

    Create new cost row when you add the attachment

Returns:

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

    nil, response status code and response headers



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 736

def upload_attachment_with_http_info(travel_expense_id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.upload_attachment ...'
  end
  # verify the required parameter 'travel_expense_id' is set
  if @api_client.config.client_side_validation && travel_expense_id.nil?
    fail ArgumentError, "Missing the required parameter 'travel_expense_id' when calling TravelExpenseApi.upload_attachment"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling TravelExpenseApi.upload_attachment"
  end
  # resource path
  local_var_path = '/travelExpense/{travelExpenseId}/attachment'.sub('{' + 'travelExpenseId' + '}', travel_expense_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'createNewCost'] = opts[:'create_new_cost'] if !opts[:'create_new_cost'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_attachments(travel_expense_id, body, opts = {}) ⇒ nil

Upload multiple attachments to travel expense.

Parameters:

  • travel_expense_id

    Travel Expense ID to upload attachment to.

  • body

    Multipart files

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

    the optional parameters

Options Hash (opts):

  • :create_new_cost (BOOLEAN)

    Create new cost row when you add the attachment (default to false)

Returns:

  • (nil)


785
786
787
788
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 785

def upload_attachments(travel_expense_id, body, opts = {})
  upload_attachments_with_http_info(travel_expense_id, body, opts)
  nil
end

#upload_attachments_with_http_info(travel_expense_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Upload multiple attachments to travel expense.

Parameters:

  • travel_expense_id

    Travel Expense ID to upload attachment to.

  • body

    Multipart files

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

    the optional parameters

Options Hash (opts):

  • :create_new_cost (BOOLEAN)

    Create new cost row when you add the attachment

Returns:

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

    nil, response status code and response headers



797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
# File 'lib/tripletex_ruby_client/api/travel_expense_api.rb', line 797

def upload_attachments_with_http_info(travel_expense_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TravelExpenseApi.upload_attachments ...'
  end
  # verify the required parameter 'travel_expense_id' is set
  if @api_client.config.client_side_validation && travel_expense_id.nil?
    fail ArgumentError, "Missing the required parameter 'travel_expense_id' when calling TravelExpenseApi.upload_attachments"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TravelExpenseApi.upload_attachments"
  end
  # resource path
  local_var_path = '/travelExpense/{travelExpenseId}/attachment/list'.sub('{' + 'travelExpenseId' + '}', travel_expense_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'createNewCost'] = opts[:'create_new_cost'] if !opts[:'create_new_cost'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['tokenAuthScheme']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TravelExpenseApi#upload_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end