Class: TripletexApi::TravelExpenseApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_api/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_api/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_api/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:



28
29
30
31
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 28

def approve(opts = {})
  data, _status_code, _headers = approve_with_http_info(opts)
  return 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



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

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:



76
77
78
79
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 76

def copy(id, opts = {})
  data, _status_code, _headers = copy_with_http_info(id, opts)
  return 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:



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
122
123
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 86

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:



131
132
133
134
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 131

def create_vouchers(date, opts = {})
  data, _status_code, _headers = create_vouchers_with_http_info(date, opts)
  return 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



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
178
179
180
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 142

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)


187
188
189
190
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 187

def delete(id, opts = {})
  delete_with_http_info(id, opts)
  return nil
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



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

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:



237
238
239
240
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 237

def deliver(opts = {})
  data, _status_code, _headers = deliver_with_http_info(opts)
  return 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



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

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)


285
286
287
288
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 285

def download_attachment(travel_expense_id, opts = {})
  data, _status_code, _headers = download_attachment_with_http_info(travel_expense_id, opts)
  return 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



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
327
328
329
330
331
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 295

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:



339
340
341
342
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 339

def get(id, opts = {})
  data, _status_code, _headers = get_with_http_info(id, opts)
  return 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:



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

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:



392
393
394
395
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 392

def post(opts = {})
  data, _status_code, _headers = post_with_http_info(opts)
  return 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:



402
403
404
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
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 402

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:



442
443
444
445
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 442

def put(id, opts = {})
  data, _status_code, _headers = put_with_http_info(id, opts)
  return 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:



453
454
455
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
489
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 453

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:



506
507
508
509
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 506

def search(opts = {})
  data, _status_code, _headers = search_with_http_info(opts)
  return 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



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 526

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:



577
578
579
580
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 577

def unapprove(opts = {})
  data, _status_code, _headers = unapprove_with_http_info(opts)
  return 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



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

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:



625
626
627
628
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 625

def undeliver(opts = {})
  data, _status_code, _headers = undeliver_with_http_info(opts)
  return 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



635
636
637
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
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 635

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

Returns:

  • (nil)


674
675
676
677
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 674

def upload_attachment(travel_expense_id, file, opts = {})
  upload_attachment_with_http_info(travel_expense_id, file, opts)
  return 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

Returns:

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

    nil, 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
717
718
719
720
721
722
723
724
725
# File 'lib/tripletex_api/api/travel_expense_api.rb', line 685

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 = {}

  # 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