Class: TripletexRubyClient::Order

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



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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/tripletex_ruby_client/models/order.rb', line 246

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']
  end

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

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

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

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

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

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

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

Instance Attribute Details

#attachmentObject

BETA

Attachments belonging to this order



111
112
113
# File 'lib/tripletex_ruby_client/models/order.rb', line 111

def attachment
  @attachment
end

#attnObject

Returns the value of attribute attn.



27
28
29
# File 'lib/tripletex_ruby_client/models/order.rb', line 27

def attn
  @attn
end

#can_create_backorderObject

Returns the value of attribute can_create_backorder.



116
117
118
# File 'lib/tripletex_ruby_client/models/order.rb', line 116

def can_create_backorder
  @can_create_backorder
end

#changesObject

Returns the value of attribute changes.



19
20
21
# File 'lib/tripletex_ruby_client/models/order.rb', line 19

def changes
  @changes
end

#contactObject

Returns the value of attribute contact.



25
26
27
# File 'lib/tripletex_ruby_client/models/order.rb', line 25

def contact
  @contact
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#customerObject

Returns the value of attribute customer.



23
24
25
# File 'lib/tripletex_ruby_client/models/order.rb', line 23

def customer
  @customer
end

#delivery_addressObject

Delivery address of this order. This can be a new or existing address (useful to know, especially if the delivery is to a private person: if ‘deliveryAddress.name’ is set, we ignore the state of ‘customer.id’)



69
70
71
# File 'lib/tripletex_ruby_client/models/order.rb', line 69

def delivery_address
  @delivery_address
end

#delivery_commentObject

Returns the value of attribute delivery_comment.



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

def delivery_comment
  @delivery_comment
end

#delivery_dateObject

Returns the value of attribute delivery_date.



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

def delivery_date
  @delivery_date
end

#departmentObject

Returns the value of attribute department.



43
44
45
# File 'lib/tripletex_ruby_client/models/order.rb', line 43

def department
  @department
end

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/tripletex_ruby_client/models/order.rb', line 15

def id
  @id
end

#invoice_commentObject

Comment to be displayed in the invoice based on this order. Can be also found in Invoice.invoiceComment on Invoice objects.



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

def invoice_comment
  @invoice_comment
end

#invoice_on_account_vat_highObject

Is the on account(a konto) amounts including vat



119
120
121
# File 'lib/tripletex_ruby_client/models/order.rb', line 119

def 
  @invoice_on_account_vat_high
end

#invoices_due_inObject

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



55
56
57
# File 'lib/tripletex_ruby_client/models/order.rb', line 55

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.



58
59
60
# File 'lib/tripletex_ruby_client/models/order.rb', line 58

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.



64
65
66
# File 'lib/tripletex_ruby_client/models/order.rb', line 64

def is_closed
  @is_closed
end

#is_prioritize_amounts_including_vatObject

Returns the value of attribute is_prioritize_amounts_including_vat.



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

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



61
62
63
# File 'lib/tripletex_ruby_client/models/order.rb', line 61

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. First, create an order with isSubscription=true, then approve it for subscription invoicing with the :approveSubscriptionInvoice method.



81
82
83
# File 'lib/tripletex_ruby_client/models/order.rb', line 81

def is_subscription
  @is_subscription
end

#is_subscription_auto_invoicingObject

Automatic invoicing. Starts when the subscription is approved



105
106
107
# File 'lib/tripletex_ruby_client/models/order.rb', line 105

def is_subscription_auto_invoicing
  @is_subscription_auto_invoicing
end

#numberObject

Returns the value of attribute number.



33
34
35
# File 'lib/tripletex_ruby_client/models/order.rb', line 33

def number
  @number
end

#order_dateObject

Returns the value of attribute order_date.



45
46
47
# File 'lib/tripletex_ruby_client/models/order.rb', line 45

def order_date
  @order_date
end

#order_line_sortingObject

Returns the value of attribute order_line_sorting.



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

def order_line_sorting
  @order_line_sorting
end

#order_linesObject

Order lines tied to the order. New OrderLines may be embedded here, in some endpoints.



78
79
80
# File 'lib/tripletex_ruby_client/models/order.rb', line 78

def order_lines
  @order_lines
end

#our_contactObject

If the contact is not an employee



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

def our_contact
  @our_contact
end

#our_contact_employeeObject

If the contact is an employee



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

def our_contact_employee
  @our_contact_employee
end

#overdue_notice_emailObject

Returns the value of attribute overdue_notice_email.



31
32
33
# File 'lib/tripletex_ruby_client/models/order.rb', line 31

def overdue_notice_email
  @overdue_notice_email
end

#preliminary_invoiceObject

BETA

Preliminary invoice if order is not charged



108
109
110
# File 'lib/tripletex_ruby_client/models/order.rb', line 108

def preliminary_invoice
  @preliminary_invoice
end

#projectObject

Returns the value of attribute project.



47
48
49
# File 'lib/tripletex_ruby_client/models/order.rb', line 47

def project
  @project
end

#receiver_emailObject

Returns the value of attribute receiver_email.



29
30
31
# File 'lib/tripletex_ruby_client/models/order.rb', line 29

def receiver_email
  @receiver_email
end

#referenceObject

Returns the value of attribute reference.



35
36
37
# File 'lib/tripletex_ruby_client/models/order.rb', line 35

def reference
  @reference
end

#send_method_descriptionObject

Description of how this invoice will be sent



114
115
116
# File 'lib/tripletex_ruby_client/models/order.rb', line 114

def send_method_description
  @send_method_description
end

#subscription_durationObject

Number of months/years the subscription shall run



84
85
86
# File 'lib/tripletex_ruby_client/models/order.rb', line 84

def subscription_duration
  @subscription_duration
end

#subscription_duration_typeObject

The time unit of subscriptionDuration



87
88
89
# File 'lib/tripletex_ruby_client/models/order.rb', line 87

def subscription_duration_type
  @subscription_duration_type
end

#subscription_invoicing_timeObject

Number of days/months invoicing in advance/in arrears



99
100
101
# File 'lib/tripletex_ruby_client/models/order.rb', line 99

def subscription_invoicing_time
  @subscription_invoicing_time
end

#subscription_invoicing_time_in_advance_or_arrearsObject

Invoicing in advance/in arrears



96
97
98
# File 'lib/tripletex_ruby_client/models/order.rb', line 96

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



102
103
104
# File 'lib/tripletex_ruby_client/models/order.rb', line 102

def subscription_invoicing_time_type
  @subscription_invoicing_time_type
end

#subscription_periods_on_invoiceObject

Number of periods on each invoice



90
91
92
# File 'lib/tripletex_ruby_client/models/order.rb', line 90

def subscription_periods_on_invoice
  @subscription_periods_on_invoice
end

#subscription_periods_on_invoice_typeObject

The time unit of subscriptionPeriodsOnInvoice



93
94
95
# File 'lib/tripletex_ruby_client/models/order.rb', line 93

def subscription_periods_on_invoice_type
  @subscription_periods_on_invoice_type
end

#total_invoiced_on_account_amount_absolute_currencyObject

Amount paid on account(a konto)



122
123
124
# File 'lib/tripletex_ruby_client/models/order.rb', line 122

def 
  @total_invoiced_on_account_amount_absolute_currency
end

#urlObject

Returns the value of attribute url.



21
22
23
# File 'lib/tripletex_ruby_client/models/order.rb', line 21

def url
  @url
end

#versionObject

Returns the value of attribute version.



17
18
19
# File 'lib/tripletex_ruby_client/models/order.rb', line 17

def version
  @version
end

Class Method Details

.attribute_mapObject

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



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
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/tripletex_ruby_client/models/order.rb', line 147

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',
    :'preliminary_invoice' => :'preliminaryInvoice',
    :'attachment' => :'attachment',
    :'send_method_description' => :'sendMethodDescription',
    :'can_create_backorder' => :'canCreateBackorder',
    :'invoice_on_account_vat_high' => :'invoiceOnAccountVatHigh',
    :'total_invoiced_on_account_amount_absolute_currency' => :'totalInvoicedOnAccountAmountAbsoluteCurrency'
  }
end

.swagger_typesObject

Attribute type mapping.



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/tripletex_ruby_client/models/order.rb', line 196

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' => :'DeliveryAddress',
    :'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',
    :'preliminary_invoice' => :'Invoice',
    :'attachment' => :'Array<Document>',
    :'send_method_description' => :'String',
    :'can_create_backorder' => :'BOOLEAN',
    :'invoice_on_account_vat_high' => :'BOOLEAN',
    :'total_invoiced_on_account_amount_absolute_currency' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/tripletex_ruby_client/models/order.rb', line 662

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 &&
      preliminary_invoice == o.preliminary_invoice &&
      attachment == o.attachment &&
      send_method_description == o.send_method_description &&
      can_create_backorder == o.can_create_backorder &&
       == o. &&
       == o.
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



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
778
779
780
781
782
# File 'lib/tripletex_ruby_client/models/order.rb', line 746

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 = TripletexRubyClient.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



812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/tripletex_ruby_client/models/order.rb', line 812

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



725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
# File 'lib/tripletex_ruby_client/models/order.rb', line 725

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 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


712
713
714
# File 'lib/tripletex_ruby_client/models/order.rb', line 712

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



718
719
720
# File 'lib/tripletex_ruby_client/models/order.rb', line 718

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, preliminary_invoice, attachment, send_method_description, can_create_backorder, , ].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



433
434
435
436
437
438
439
440
441
442
443
444
445
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
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/tripletex_ruby_client/models/order.rb', line 433

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

  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



792
793
794
# File 'lib/tripletex_ruby_client/models/order.rb', line 792

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



798
799
800
801
802
803
804
805
806
# File 'lib/tripletex_ruby_client/models/order.rb', line 798

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



786
787
788
# File 'lib/tripletex_ruby_client/models/order.rb', line 786

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



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

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)
  true
end