Class: TripletexApi::Order

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Order

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/tripletex_api/models/order.rb', line 219

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?(:'customer')
    self.customer = attributes[:'customer']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#attnObject

Returns the value of attribute attn.



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

def attn
  @attn
end

#changesObject

Returns the value of attribute changes.



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

def changes
  @changes
end

#contactObject

Returns the value of attribute contact.



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

def contact
  @contact
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#customerObject

Returns the value of attribute customer.



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

def customer
  @customer
end

#delivery_addressObject

Delivery address of this order. This can be a new or existing address



71
72
73
# File 'lib/tripletex_api/models/order.rb', line 71

def delivery_address
  @delivery_address
end

#delivery_commentObject

Returns the value of attribute delivery_comment.



73
74
75
# File 'lib/tripletex_api/models/order.rb', line 73

def delivery_comment
  @delivery_comment
end

#delivery_dateObject

Returns the value of attribute delivery_date.



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

def delivery_date
  @delivery_date
end

#departmentObject

Returns the value of attribute department.



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

def department
  @department
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#invoice_commentObject

Returns the value of attribute invoice_comment.



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

def invoice_comment
  @invoice_comment
end

#invoices_due_inObject

Number of days/months in which invoices created from this order is due



57
58
59
# File 'lib/tripletex_api/models/order.rb', line 57

def invoices_due_in
  @invoices_due_in
end

#invoices_due_in_typeObject

Set the time unit of invoicesDueIn. The special case RECURRING_DAY_OF_MONTH enables the due date to be fixed to a specific day of the month, in this case the fixed due date will automatically be set as standard on all invoices created from this order. Note that when RECURRING_DAY_OF_MONTH is set, the due date will be set to the last day of month if "31" is set in invoicesDueIn.



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

def invoices_due_in_type
  @invoices_due_in_type
end

#is_closedObject

Denotes if this order is closed. A closed order can no longer be invoiced unless it is opened again.



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

def is_closed
  @is_closed
end

#is_prioritize_amounts_including_vatObject

Returns the value of attribute is_prioritize_amounts_including_vat.



75
76
77
# File 'lib/tripletex_api/models/order.rb', line 75

def is_prioritize_amounts_including_vat
  @is_prioritize_amounts_including_vat
end

#is_show_open_posts_on_invoicesObject

Show account statement - open posts on invoices created from this order



63
64
65
# File 'lib/tripletex_api/models/order.rb', line 63

def is_show_open_posts_on_invoices
  @is_show_open_posts_on_invoices
end

#is_subscriptionObject

If true, the order is a subscription, which enables periodical invoicing of order lines



83
84
85
# File 'lib/tripletex_api/models/order.rb', line 83

def is_subscription
  @is_subscription
end

#is_subscription_auto_invoicingObject

Automatic invoicing. Starts when the subscription is approved



107
108
109
# File 'lib/tripletex_api/models/order.rb', line 107

def is_subscription_auto_invoicing
  @is_subscription_auto_invoicing
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#order_dateObject

Returns the value of attribute order_date.



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

def order_date
  @order_date
end

#order_line_sortingObject

Returns the value of attribute order_line_sorting.



77
78
79
# File 'lib/tripletex_api/models/order.rb', line 77

def order_line_sorting
  @order_line_sorting
end

#order_linesObject

Order lines tied to the order



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

def order_lines
  @order_lines
end

#our_contactObject

If the contact is not an employee



41
42
43
# File 'lib/tripletex_api/models/order.rb', line 41

def our_contact
  @our_contact
end

#our_contact_employeeObject

If the contact is an employee



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

def our_contact_employee
  @our_contact_employee
end

#overdue_notice_emailObject

Returns the value of attribute overdue_notice_email.



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

def overdue_notice_email
  @overdue_notice_email
end

#projectObject

Returns the value of attribute project.



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

def project
  @project
end

#receiver_emailObject

Returns the value of attribute receiver_email.



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

def receiver_email
  @receiver_email
end

#referenceObject

Returns the value of attribute reference.



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

def reference
  @reference
end

#subscription_durationObject

Number of months/years the subscription shall run



86
87
88
# File 'lib/tripletex_api/models/order.rb', line 86

def subscription_duration
  @subscription_duration
end

#subscription_duration_typeObject

The time unit of subscriptionDuration



89
90
91
# File 'lib/tripletex_api/models/order.rb', line 89

def subscription_duration_type
  @subscription_duration_type
end

#subscription_invoicing_timeObject

Number of days/months invoicing in advance/in arrears



101
102
103
# File 'lib/tripletex_api/models/order.rb', line 101

def subscription_invoicing_time
  @subscription_invoicing_time
end

#subscription_invoicing_time_in_advance_or_arrearsObject

Invoicing in advance/in arrears



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

def subscription_invoicing_time_in_advance_or_arrears
  @subscription_invoicing_time_in_advance_or_arrears
end

#subscription_invoicing_time_typeObject

The time unit of subscriptionInvoicingTime



104
105
106
# File 'lib/tripletex_api/models/order.rb', line 104

def subscription_invoicing_time_type
  @subscription_invoicing_time_type
end

#subscription_periods_on_invoiceObject

Number of periods on each invoice



92
93
94
# File 'lib/tripletex_api/models/order.rb', line 92

def subscription_periods_on_invoice
  @subscription_periods_on_invoice
end

#subscription_periods_on_invoice_typeObject

The time unit of subscriptionPeriodsOnInvoice



95
96
97
# File 'lib/tripletex_api/models/order.rb', line 95

def subscription_periods_on_invoice_type
  @subscription_periods_on_invoice_type
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.attribute_mapObject

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



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
169
170
171
172
# File 'lib/tripletex_api/models/order.rb', line 132

def self.attribute_map
  {
    :'id' => :'id',
    :'version' => :'version',
    :'changes' => :'changes',
    :'url' => :'url',
    :'customer' => :'customer',
    :'contact' => :'contact',
    :'attn' => :'attn',
    :'receiver_email' => :'receiverEmail',
    :'overdue_notice_email' => :'overdueNoticeEmail',
    :'number' => :'number',
    :'reference' => :'reference',
    :'our_contact' => :'ourContact',
    :'our_contact_employee' => :'ourContactEmployee',
    :'department' => :'department',
    :'order_date' => :'orderDate',
    :'project' => :'project',
    :'invoice_comment' => :'invoiceComment',
    :'currency' => :'currency',
    :'invoices_due_in' => :'invoicesDueIn',
    :'invoices_due_in_type' => :'invoicesDueInType',
    :'is_show_open_posts_on_invoices' => :'isShowOpenPostsOnInvoices',
    :'is_closed' => :'isClosed',
    :'delivery_date' => :'deliveryDate',
    :'delivery_address' => :'deliveryAddress',
    :'delivery_comment' => :'deliveryComment',
    :'is_prioritize_amounts_including_vat' => :'isPrioritizeAmountsIncludingVat',
    :'order_line_sorting' => :'orderLineSorting',
    :'order_lines' => :'orderLines',
    :'is_subscription' => :'isSubscription',
    :'subscription_duration' => :'subscriptionDuration',
    :'subscription_duration_type' => :'subscriptionDurationType',
    :'subscription_periods_on_invoice' => :'subscriptionPeriodsOnInvoice',
    :'subscription_periods_on_invoice_type' => :'subscriptionPeriodsOnInvoiceType',
    :'subscription_invoicing_time_in_advance_or_arrears' => :'subscriptionInvoicingTimeInAdvanceOrArrears',
    :'subscription_invoicing_time' => :'subscriptionInvoicingTime',
    :'subscription_invoicing_time_type' => :'subscriptionInvoicingTimeType',
    :'is_subscription_auto_invoicing' => :'isSubscriptionAutoInvoicing'
  }
end

.swagger_typesObject

Attribute type mapping.



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
215
# File 'lib/tripletex_api/models/order.rb', line 175

def self.swagger_types
  {
    :'id' => :'Integer',
    :'version' => :'Integer',
    :'changes' => :'Array<Change>',
    :'url' => :'String',
    :'customer' => :'Customer',
    :'contact' => :'Contact',
    :'attn' => :'Contact',
    :'receiver_email' => :'String',
    :'overdue_notice_email' => :'String',
    :'number' => :'String',
    :'reference' => :'String',
    :'our_contact' => :'Contact',
    :'our_contact_employee' => :'Employee',
    :'department' => :'Department',
    :'order_date' => :'String',
    :'project' => :'Project',
    :'invoice_comment' => :'String',
    :'currency' => :'Currency',
    :'invoices_due_in' => :'Integer',
    :'invoices_due_in_type' => :'String',
    :'is_show_open_posts_on_invoices' => :'BOOLEAN',
    :'is_closed' => :'BOOLEAN',
    :'delivery_date' => :'String',
    :'delivery_address' => :'Address',
    :'delivery_comment' => :'String',
    :'is_prioritize_amounts_including_vat' => :'BOOLEAN',
    :'order_line_sorting' => :'String',
    :'order_lines' => :'Array<OrderLine>',
    :'is_subscription' => :'BOOLEAN',
    :'subscription_duration' => :'Integer',
    :'subscription_duration_type' => :'String',
    :'subscription_periods_on_invoice' => :'Integer',
    :'subscription_periods_on_invoice_type' => :'String',
    :'subscription_invoicing_time_in_advance_or_arrears' => :'String',
    :'subscription_invoicing_time' => :'Integer',
    :'subscription_invoicing_time_type' => :'String',
    :'is_subscription_auto_invoicing' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



628
629
630
631
632
633
634
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
667
668
# File 'lib/tripletex_api/models/order.rb', line 628

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      version == o.version &&
      changes == o.changes &&
      url == o.url &&
      customer == o.customer &&
      contact == o.contact &&
      attn == o.attn &&
      receiver_email == o.receiver_email &&
      overdue_notice_email == o.overdue_notice_email &&
      number == o.number &&
      reference == o.reference &&
      our_contact == o.our_contact &&
      our_contact_employee == o.our_contact_employee &&
      department == o.department &&
      order_date == o.order_date &&
      project == o.project &&
      invoice_comment == o.invoice_comment &&
      currency == o.currency &&
      invoices_due_in == o.invoices_due_in &&
      invoices_due_in_type == o.invoices_due_in_type &&
      is_show_open_posts_on_invoices == o.is_show_open_posts_on_invoices &&
      is_closed == o.is_closed &&
      delivery_date == o.delivery_date &&
      delivery_address == o.delivery_address &&
      delivery_comment == o.delivery_comment &&
      is_prioritize_amounts_including_vat == o.is_prioritize_amounts_including_vat &&
      order_line_sorting == o.order_line_sorting &&
      order_lines == o.order_lines &&
      is_subscription == o.is_subscription &&
      subscription_duration == o.subscription_duration &&
      subscription_duration_type == o.subscription_duration_type &&
      subscription_periods_on_invoice == o.subscription_periods_on_invoice &&
      subscription_periods_on_invoice_type == o.subscription_periods_on_invoice_type &&
      subscription_invoicing_time_in_advance_or_arrears == o.subscription_invoicing_time_in_advance_or_arrears &&
      subscription_invoicing_time == o.subscription_invoicing_time &&
      subscription_invoicing_time_type == o.subscription_invoicing_time_type &&
      is_subscription_auto_invoicing == o.is_subscription_auto_invoicing
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



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
# File 'lib/tripletex_api/models/order.rb', line 706

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



772
773
774
775
776
777
778
779
780
781
782
783
784
# File 'lib/tripletex_api/models/order.rb', line 772

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



685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/tripletex_api/models/order.rb', line 685

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


672
673
674
# File 'lib/tripletex_api/models/order.rb', line 672

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



678
679
680
# File 'lib/tripletex_api/models/order.rb', line 678

def hash
  [id, version, changes, url, customer, contact, attn, receiver_email, overdue_notice_email, number, reference, our_contact, our_contact_employee, department, order_date, project, invoice_comment, currency, invoices_due_in, invoices_due_in_type, is_show_open_posts_on_invoices, is_closed, delivery_date, delivery_address, delivery_comment, is_prioritize_amounts_including_vat, order_line_sorting, order_lines, is_subscription, subscription_duration, subscription_duration_type, subscription_periods_on_invoice, subscription_periods_on_invoice_type, subscription_invoicing_time_in_advance_or_arrears, subscription_invoicing_time, subscription_invoicing_time_type, is_subscription_auto_invoicing].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



391
392
393
394
395
396
397
398
399
400
401
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
435
436
437
438
439
440
441
442
# File 'lib/tripletex_api/models/order.rb', line 391

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

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

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

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

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

  if @order_date.nil?
    invalid_properties.push("invalid value for 'order_date', order_date cannot be nil.")
  end

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

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

  if @delivery_date.nil?
    invalid_properties.push("invalid value for 'delivery_date', delivery_date cannot be nil.")
  end

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

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

  if !@subscription_invoicing_time.nil? && @subscription_invoicing_time < 0
    invalid_properties.push("invalid value for 'subscription_invoicing_time', 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



752
753
754
# File 'lib/tripletex_api/models/order.rb', line 752

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



758
759
760
761
762
763
764
765
766
# File 'lib/tripletex_api/models/order.rb', line 758

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



746
747
748
# File 'lib/tripletex_api/models/order.rb', line 746

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



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/tripletex_api/models/order.rb', line 446

def valid?
  return false if @customer.nil?
  return false if !@receiver_email.nil? && @receiver_email.to_s.length > 254
  return false if !@overdue_notice_email.nil? && @overdue_notice_email.to_s.length > 254
  return false if !@number.nil? && @number.to_s.length > 100
  return false if !@reference.nil? && @reference.to_s.length > 255
  return false if @order_date.nil?
  return false if !@invoices_due_in.nil? && @invoices_due_in > 10000
  return false if !@invoices_due_in.nil? && @invoices_due_in < 0
  invoices_due_in_type_validator = EnumAttributeValidator.new('String', ["DAYS", "MONTHS", "RECURRING_DAY_OF_MONTH"])
  return false unless invoices_due_in_type_validator.valid?(@invoices_due_in_type)
  return false if @delivery_date.nil?
  order_line_sorting_validator = EnumAttributeValidator.new('String', ["ID", "PRODUCT", "CUSTOM"])
  return false unless order_line_sorting_validator.valid?(@order_line_sorting)
  return false if !@subscription_duration.nil? && @subscription_duration < 0
  subscription_duration_type_validator = EnumAttributeValidator.new('String', ["MONTHS", "YEAR"])
  return false unless subscription_duration_type_validator.valid?(@subscription_duration_type)
  return false if !@subscription_periods_on_invoice.nil? && @subscription_periods_on_invoice < 0
  subscription_periods_on_invoice_type_validator = EnumAttributeValidator.new('String', ["MONTHS"])
  return false unless subscription_periods_on_invoice_type_validator.valid?(@subscription_periods_on_invoice_type)
  subscription_invoicing_time_in_advance_or_arrears_validator = EnumAttributeValidator.new('String', ["ADVANCE", "ARREARS"])
  return false unless subscription_invoicing_time_in_advance_or_arrears_validator.valid?(@subscription_invoicing_time_in_advance_or_arrears)
  return false if !@subscription_invoicing_time.nil? && @subscription_invoicing_time < 0
  subscription_invoicing_time_type_validator = EnumAttributeValidator.new('String', ["DAYS", "MONTHS"])
  return false unless subscription_invoicing_time_type_validator.valid?(@subscription_invoicing_time_type)
  return true
end