Class: TripletexApi::TravelExpense

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_api/models/travel_expense.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TravelExpense

Initializes the object

Parameters:

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

    Model attributes in the form of hash



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
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
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
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
403
404
405
406
# File 'lib/tripletex_api/models/travel_expense.rb', line 218

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.has_key?(:'changes')
    if (value = attributes[:'changes']).is_a?(Array)
      self.changes = value
    end
  end

  if attributes.has_key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.has_key?(:'project')
    self.project = attributes[:'project']
  end

  if attributes.has_key?(:'employee')
    self.employee = attributes[:'employee']
  end

  if attributes.has_key?(:'approvedBy')
    self.approved_by = attributes[:'approvedBy']
  end

  if attributes.has_key?(:'completedBy')
    self.completed_by = attributes[:'completedBy']
  end

  if attributes.has_key?(:'department')
    self.department = attributes[:'department']
  end

  if attributes.has_key?(:'payslip')
    self.payslip = attributes[:'payslip']
  end

  if attributes.has_key?(:'vatType')
    self.vat_type = attributes[:'vatType']
  end

  if attributes.has_key?(:'paymentCurrency')
    self.payment_currency = attributes[:'paymentCurrency']
  end

  if attributes.has_key?(:'travelDetails')
    self.travel_details = attributes[:'travelDetails']
  end

  if attributes.has_key?(:'voucher')
    self.voucher = attributes[:'voucher']
  end

  if attributes.has_key?(:'isCompleted')
    self.is_completed = attributes[:'isCompleted']
  else
    self.is_completed = false
  end

  if attributes.has_key?(:'isApproved')
    self.is_approved = attributes[:'isApproved']
  else
    self.is_approved = false
  end

  if attributes.has_key?(:'isChargeable')
    self.is_chargeable = attributes[:'isChargeable']
  else
    self.is_chargeable = false
  end

  if attributes.has_key?(:'isFixedInvoicedAmount')
    self.is_fixed_invoiced_amount = attributes[:'isFixedInvoicedAmount']
  else
    self.is_fixed_invoiced_amount = false
  end

  if attributes.has_key?(:'isIncludeAttachedReceiptsWhenReinvoicing')
    self.is_include_attached_receipts_when_reinvoicing = attributes[:'isIncludeAttachedReceiptsWhenReinvoicing']
  else
    self.is_include_attached_receipts_when_reinvoicing = false
  end

  if attributes.has_key?(:'completedDate')
    self.completed_date = attributes[:'completedDate']
  end

  if attributes.has_key?(:'approvedDate')
    self.approved_date = attributes[:'approvedDate']
  end

  if attributes.has_key?(:'date')
    self.date = attributes[:'date']
  end

  if attributes.has_key?(:'travelAdvance')
    self.travel_advance = attributes[:'travelAdvance']
  end

  if attributes.has_key?(:'fixedInvoicedAmount')
    self.fixed_invoiced_amount = attributes[:'fixedInvoicedAmount']
  end

  if attributes.has_key?(:'amount')
    self.amount = attributes[:'amount']
  end

  if attributes.has_key?(:'lowRateVAT')
    self.low_rate_vat = attributes[:'lowRateVAT']
  end

  if attributes.has_key?(:'mediumRateVAT')
    self.medium_rate_vat = attributes[:'mediumRateVAT']
  end

  if attributes.has_key?(:'highRateVAT')
    self.high_rate_vat = attributes[:'highRateVAT']
  end

  if attributes.has_key?(:'paymentAmount')
    self.payment_amount = attributes[:'paymentAmount']
  end

  if attributes.has_key?(:'paymentAmountCurrency')
    self.payment_amount_currency = attributes[:'paymentAmountCurrency']
  end

  if attributes.has_key?(:'number')
    self.number = attributes[:'number']
  end

  if attributes.has_key?(:'invoice')
    self.invoice = attributes[:'invoice']
  end

  if attributes.has_key?(:'title')
    self.title = attributes[:'title']
  end

  if attributes.has_key?(:'perDiemCompensations')
    if (value = attributes[:'perDiemCompensations']).is_a?(Array)
      self.per_diem_compensations = value
    end
  end

  if attributes.has_key?(:'mileageAllowances')
    if (value = attributes[:'mileageAllowances']).is_a?(Array)
      self.mileage_allowances = value
    end
  end

  if attributes.has_key?(:'accommodationAllowances')
    if (value = attributes[:'accommodationAllowances']).is_a?(Array)
      self.accommodation_allowances = value
    end
  end

  if attributes.has_key?(:'costs')
    if (value = attributes[:'costs']).is_a?(Array)
      self.costs = value
    end
  end

  if attributes.has_key?(:'attachmentCount')
    self.attachment_count = attributes[:'attachmentCount']
  end

  if attributes.has_key?(:'state')
    self.state = attributes[:'state']
  end

  if attributes.has_key?(:'actions')
    if (value = attributes[:'actions']).is_a?(Array)
      self.actions = value
    end
  end

end

Instance Attribute Details

#accommodation_allowancesObject

Link to individual accommodation allowances.



91
92
93
# File 'lib/tripletex_api/models/travel_expense.rb', line 91

def accommodation_allowances
  @accommodation_allowances
end

#actionsObject

Returns the value of attribute actions.



100
101
102
# File 'lib/tripletex_api/models/travel_expense.rb', line 100

def actions
  @actions
end

#amountObject

Returns the value of attribute amount.



66
67
68
# File 'lib/tripletex_api/models/travel_expense.rb', line 66

def amount
  @amount
end

#approved_byObject

Returns the value of attribute approved_by.



30
31
32
# File 'lib/tripletex_api/models/travel_expense.rb', line 30

def approved_by
  @approved_by
end

#approved_dateObject

Returns the value of attribute approved_date.



58
59
60
# File 'lib/tripletex_api/models/travel_expense.rb', line 58

def approved_date
  @approved_date
end

#attachment_countObject

Returns the value of attribute attachment_count.



96
97
98
# File 'lib/tripletex_api/models/travel_expense.rb', line 96

def attachment_count
  @attachment_count
end

#changesObject

Returns the value of attribute changes.



22
23
24
# File 'lib/tripletex_api/models/travel_expense.rb', line 22

def changes
  @changes
end

#completed_byObject

Returns the value of attribute completed_by.



32
33
34
# File 'lib/tripletex_api/models/travel_expense.rb', line 32

def completed_by
  @completed_by
end

#completed_dateObject

Returns the value of attribute completed_date.



56
57
58
# File 'lib/tripletex_api/models/travel_expense.rb', line 56

def completed_date
  @completed_date
end

#costsObject

Link to individual costs.



94
95
96
# File 'lib/tripletex_api/models/travel_expense.rb', line 94

def costs
  @costs
end

#dateObject

Returns the value of attribute date.



60
61
62
# File 'lib/tripletex_api/models/travel_expense.rb', line 60

def date
  @date
end

#departmentObject

Returns the value of attribute department.



34
35
36
# File 'lib/tripletex_api/models/travel_expense.rb', line 34

def department
  @department
end

#employeeObject

Returns the value of attribute employee.



28
29
30
# File 'lib/tripletex_api/models/travel_expense.rb', line 28

def employee
  @employee
end

#fixed_invoiced_amountObject

Returns the value of attribute fixed_invoiced_amount.



64
65
66
# File 'lib/tripletex_api/models/travel_expense.rb', line 64

def fixed_invoiced_amount
  @fixed_invoiced_amount
end

#high_rate_vatObject

Returns the value of attribute high_rate_vat.



72
73
74
# File 'lib/tripletex_api/models/travel_expense.rb', line 72

def high_rate_vat
  @high_rate_vat
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/tripletex_api/models/travel_expense.rb', line 18

def id
  @id
end

#invoiceObject

Returns the value of attribute invoice.



80
81
82
# File 'lib/tripletex_api/models/travel_expense.rb', line 80

def invoice
  @invoice
end

#is_approvedObject

Returns the value of attribute is_approved.



48
49
50
# File 'lib/tripletex_api/models/travel_expense.rb', line 48

def is_approved
  @is_approved
end

#is_chargeableObject

Returns the value of attribute is_chargeable.



50
51
52
# File 'lib/tripletex_api/models/travel_expense.rb', line 50

def is_chargeable
  @is_chargeable
end

#is_completedObject

Returns the value of attribute is_completed.



46
47
48
# File 'lib/tripletex_api/models/travel_expense.rb', line 46

def is_completed
  @is_completed
end

#is_fixed_invoiced_amountObject

Returns the value of attribute is_fixed_invoiced_amount.



52
53
54
# File 'lib/tripletex_api/models/travel_expense.rb', line 52

def is_fixed_invoiced_amount
  @is_fixed_invoiced_amount
end

#is_include_attached_receipts_when_reinvoicingObject

Returns the value of attribute is_include_attached_receipts_when_reinvoicing.



54
55
56
# File 'lib/tripletex_api/models/travel_expense.rb', line 54

def is_include_attached_receipts_when_reinvoicing
  @is_include_attached_receipts_when_reinvoicing
end

#low_rate_vatObject

Returns the value of attribute low_rate_vat.



68
69
70
# File 'lib/tripletex_api/models/travel_expense.rb', line 68

def low_rate_vat
  @low_rate_vat
end

#medium_rate_vatObject

Returns the value of attribute medium_rate_vat.



70
71
72
# File 'lib/tripletex_api/models/travel_expense.rb', line 70

def medium_rate_vat
  @medium_rate_vat
end

#mileage_allowancesObject

Link to individual mileage allowances.



88
89
90
# File 'lib/tripletex_api/models/travel_expense.rb', line 88

def mileage_allowances
  @mileage_allowances
end

#numberObject

Returns the value of attribute number.



78
79
80
# File 'lib/tripletex_api/models/travel_expense.rb', line 78

def number
  @number
end

#payment_amountObject

Returns the value of attribute payment_amount.



74
75
76
# File 'lib/tripletex_api/models/travel_expense.rb', line 74

def payment_amount
  @payment_amount
end

#payment_amount_currencyObject

Returns the value of attribute payment_amount_currency.



76
77
78
# File 'lib/tripletex_api/models/travel_expense.rb', line 76

def payment_amount_currency
  @payment_amount_currency
end

#payment_currencyObject

Returns the value of attribute payment_currency.



40
41
42
# File 'lib/tripletex_api/models/travel_expense.rb', line 40

def payment_currency
  @payment_currency
end

#payslipObject

Returns the value of attribute payslip.



36
37
38
# File 'lib/tripletex_api/models/travel_expense.rb', line 36

def payslip
  @payslip
end

#per_diem_compensationsObject

Link to individual per diem compensations.



85
86
87
# File 'lib/tripletex_api/models/travel_expense.rb', line 85

def per_diem_compensations
  @per_diem_compensations
end

#projectObject

Returns the value of attribute project.



26
27
28
# File 'lib/tripletex_api/models/travel_expense.rb', line 26

def project
  @project
end

#stateObject

Returns the value of attribute state.



98
99
100
# File 'lib/tripletex_api/models/travel_expense.rb', line 98

def state
  @state
end

#titleObject

Returns the value of attribute title.



82
83
84
# File 'lib/tripletex_api/models/travel_expense.rb', line 82

def title
  @title
end

#travel_advanceObject

Returns the value of attribute travel_advance.



62
63
64
# File 'lib/tripletex_api/models/travel_expense.rb', line 62

def travel_advance
  @travel_advance
end

#travel_detailsObject

Returns the value of attribute travel_details.



42
43
44
# File 'lib/tripletex_api/models/travel_expense.rb', line 42

def travel_details
  @travel_details
end

#urlObject

Returns the value of attribute url.



24
25
26
# File 'lib/tripletex_api/models/travel_expense.rb', line 24

def url
  @url
end

#vat_typeObject

Returns the value of attribute vat_type.



38
39
40
# File 'lib/tripletex_api/models/travel_expense.rb', line 38

def vat_type
  @vat_type
end

#versionObject

Returns the value of attribute version.



20
21
22
# File 'lib/tripletex_api/models/travel_expense.rb', line 20

def version
  @version
end

#voucherObject

Returns the value of attribute voucher.



44
45
46
# File 'lib/tripletex_api/models/travel_expense.rb', line 44

def voucher
  @voucher
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/tripletex_api/models/travel_expense.rb', line 125

def self.attribute_map
  {
    :'id' => :'id',
    :'version' => :'version',
    :'changes' => :'changes',
    :'url' => :'url',
    :'project' => :'project',
    :'employee' => :'employee',
    :'approved_by' => :'approvedBy',
    :'completed_by' => :'completedBy',
    :'department' => :'department',
    :'payslip' => :'payslip',
    :'vat_type' => :'vatType',
    :'payment_currency' => :'paymentCurrency',
    :'travel_details' => :'travelDetails',
    :'voucher' => :'voucher',
    :'is_completed' => :'isCompleted',
    :'is_approved' => :'isApproved',
    :'is_chargeable' => :'isChargeable',
    :'is_fixed_invoiced_amount' => :'isFixedInvoicedAmount',
    :'is_include_attached_receipts_when_reinvoicing' => :'isIncludeAttachedReceiptsWhenReinvoicing',
    :'completed_date' => :'completedDate',
    :'approved_date' => :'approvedDate',
    :'date' => :'date',
    :'travel_advance' => :'travelAdvance',
    :'fixed_invoiced_amount' => :'fixedInvoicedAmount',
    :'amount' => :'amount',
    :'low_rate_vat' => :'lowRateVAT',
    :'medium_rate_vat' => :'mediumRateVAT',
    :'high_rate_vat' => :'highRateVAT',
    :'payment_amount' => :'paymentAmount',
    :'payment_amount_currency' => :'paymentAmountCurrency',
    :'number' => :'number',
    :'invoice' => :'invoice',
    :'title' => :'title',
    :'per_diem_compensations' => :'perDiemCompensations',
    :'mileage_allowances' => :'mileageAllowances',
    :'accommodation_allowances' => :'accommodationAllowances',
    :'costs' => :'costs',
    :'attachment_count' => :'attachmentCount',
    :'state' => :'state',
    :'actions' => :'actions'
  }
end

.swagger_typesObject

Attribute type mapping.



171
172
173
174
175
176
177
178
179
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
# File 'lib/tripletex_api/models/travel_expense.rb', line 171

def self.swagger_types
  {
    :'id' => :'Integer',
    :'version' => :'Integer',
    :'changes' => :'Array<Change>',
    :'url' => :'String',
    :'project' => :'Project',
    :'employee' => :'Employee',
    :'approved_by' => :'Employee',
    :'completed_by' => :'Employee',
    :'department' => :'Department',
    :'payslip' => :'Payslip',
    :'vat_type' => :'VatType',
    :'payment_currency' => :'Currency',
    :'travel_details' => :'TravelDetails',
    :'voucher' => :'Voucher',
    :'is_completed' => :'BOOLEAN',
    :'is_approved' => :'BOOLEAN',
    :'is_chargeable' => :'BOOLEAN',
    :'is_fixed_invoiced_amount' => :'BOOLEAN',
    :'is_include_attached_receipts_when_reinvoicing' => :'BOOLEAN',
    :'completed_date' => :'String',
    :'approved_date' => :'String',
    :'date' => :'String',
    :'travel_advance' => :'Float',
    :'fixed_invoiced_amount' => :'Float',
    :'amount' => :'Float',
    :'low_rate_vat' => :'Float',
    :'medium_rate_vat' => :'Float',
    :'high_rate_vat' => :'Float',
    :'payment_amount' => :'Float',
    :'payment_amount_currency' => :'Float',
    :'number' => :'Integer',
    :'invoice' => :'Invoice',
    :'title' => :'String',
    :'per_diem_compensations' => :'Array<PerDiemCompensation>',
    :'mileage_allowances' => :'Array<MileageAllowance>',
    :'accommodation_allowances' => :'Array<AccommodationAllowance>',
    :'costs' => :'Array<Cost>',
    :'attachment_count' => :'Integer',
    :'state' => :'String',
    :'actions' => :'Array<Link>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/tripletex_api/models/travel_expense.rb', line 481

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      version == o.version &&
      changes == o.changes &&
      url == o.url &&
      project == o.project &&
      employee == o.employee &&
      approved_by == o.approved_by &&
      completed_by == o.completed_by &&
      department == o.department &&
      payslip == o.payslip &&
      vat_type == o.vat_type &&
      payment_currency == o.payment_currency &&
      travel_details == o.travel_details &&
      voucher == o.voucher &&
      is_completed == o.is_completed &&
      is_approved == o.is_approved &&
      is_chargeable == o.is_chargeable &&
      is_fixed_invoiced_amount == o.is_fixed_invoiced_amount &&
      is_include_attached_receipts_when_reinvoicing == o.is_include_attached_receipts_when_reinvoicing &&
      completed_date == o.completed_date &&
      approved_date == o.approved_date &&
      date == o.date &&
      travel_advance == o.travel_advance &&
      fixed_invoiced_amount == o.fixed_invoiced_amount &&
      amount == o.amount &&
      low_rate_vat == o.low_rate_vat &&
      medium_rate_vat == o.medium_rate_vat &&
      high_rate_vat == o.high_rate_vat &&
      payment_amount == o.payment_amount &&
      payment_amount_currency == o.payment_amount_currency &&
      number == o.number &&
      invoice == o.invoice &&
      title == o.title &&
      per_diem_compensations == o.per_diem_compensations &&
      mileage_allowances == o.mileage_allowances &&
      accommodation_allowances == o.accommodation_allowances &&
      costs == o.costs &&
      attachment_count == o.attachment_count &&
      state == o.state &&
      actions == o.actions
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/tripletex_api/models/travel_expense.rb', line 562

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = TripletexApi.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/tripletex_api/models/travel_expense.rb', line 628

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/tripletex_api/models/travel_expense.rb', line 541

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


528
529
530
# File 'lib/tripletex_api/models/travel_expense.rb', line 528

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



534
535
536
# File 'lib/tripletex_api/models/travel_expense.rb', line 534

def hash
  [id, version, changes, url, project, employee, approved_by, completed_by, department, payslip, vat_type, payment_currency, travel_details, voucher, is_completed, is_approved, is_chargeable, is_fixed_invoiced_amount, is_include_attached_receipts_when_reinvoicing, completed_date, approved_date, date, travel_advance, fixed_invoiced_amount, amount, low_rate_vat, medium_rate_vat, high_rate_vat, payment_amount, payment_amount_currency, number, invoice, title, per_diem_compensations, mileage_allowances, accommodation_allowances, costs, attachment_count, state, actions].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/tripletex_api/models/travel_expense.rb', line 410

def list_invalid_properties
  invalid_properties = Array.new
  if @employee.nil?
    invalid_properties.push("invalid value for 'employee', employee cannot be nil.")
  end

  if !@title.nil? && @title.to_s.length > 255
    invalid_properties.push("invalid value for 'title', the character length must be smaller than or equal to 255.")
  end

  if !@attachment_count.nil? && @attachment_count > 2147483647
    invalid_properties.push("invalid value for 'attachment_count', must be smaller than or equal to 2147483647.")
  end

  if !@attachment_count.nil? && @attachment_count < 0
    invalid_properties.push("invalid value for 'attachment_count', must be greater than or equal to 0.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



608
609
610
# File 'lib/tripletex_api/models/travel_expense.rb', line 608

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



614
615
616
617
618
619
620
621
622
# File 'lib/tripletex_api/models/travel_expense.rb', line 614

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



602
603
604
# File 'lib/tripletex_api/models/travel_expense.rb', line 602

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



433
434
435
436
437
438
439
440
441
# File 'lib/tripletex_api/models/travel_expense.rb', line 433

def valid?
  return false if @employee.nil?
  return false if !@title.nil? && @title.to_s.length > 255
  return false if !@attachment_count.nil? && @attachment_count > 2147483647
  return false if !@attachment_count.nil? && @attachment_count < 0
  state_validator = EnumAttributeValidator.new('String', ["ALL", "OPEN", "APPROVED", "SALARY_PAID", "DELIVERED"])
  return false unless state_validator.valid?(@state)
  return true
end