Class: ConnectWise::TaxCode

Inherits:
Object
  • Object
show all
Defined in:
lib/connect_wise/models/tax_code.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TaxCode

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Raises:

  • (ArgumentError)


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
430
431
432
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
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
525
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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/connect_wise/models/tax_code.rb', line 383

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::TaxCode` initialize method' unless attributes.is_a?(Hash)

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) do |(k, v), h|
    raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::TaxCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)

    h[k.to_sym] = v
  end

  self.identifier = attributes[:identifier] if attributes.key?(:identifier)

  self.description = attributes[:description] if attributes.key?(:description)

  self.invoice_caption = attributes[:invoice_caption] if attributes.key?(:invoice_caption)

  self.effective_date = attributes[:effective_date] if attributes.key?(:effective_date)

  self.id = attributes[:id] if attributes.key?(:id)

  self.country = attributes[:country] if attributes.key?(:country)

  self.default_flag = attributes[:default_flag] if attributes.key?(:default_flag)

  self.display_on_invoice_flag = attributes[:display_on_invoice_flag] if attributes.key?(:display_on_invoice_flag)

  self.canada_calculate_gst_flag = attributes[:canada_calculate_gst_flag] if attributes.key?(:canada_calculate_gst_flag)

  self.cancel_date = attributes[:cancel_date] if attributes.key?(:cancel_date)

  self.level_one_rate = attributes[:level_one_rate] if attributes.key?(:level_one_rate)

  self.level_one_rate_type = attributes[:level_one_rate_type] if attributes.key?(:level_one_rate_type)

  self.level_one_taxable_max = attributes[:level_one_taxable_max] if attributes.key?(:level_one_taxable_max)

  self.level_one_caption = attributes[:level_one_caption] if attributes.key?(:level_one_caption)

  self.level_one_tax_code_xref = attributes[:level_one_tax_code_xref] if attributes.key?(:level_one_tax_code_xref)

  self.level_one_agency_xref = attributes[:level_one_agency_xref] if attributes.key?(:level_one_agency_xref)

  self.level_one_services_flag = attributes[:level_one_services_flag] if attributes.key?(:level_one_services_flag)

  self.level_one_expenses_flag = attributes[:level_one_expenses_flag] if attributes.key?(:level_one_expenses_flag)

  self.level_one_products_flag = attributes[:level_one_products_flag] if attributes.key?(:level_one_products_flag)

  self.level_one_apply_single_unit_flag = attributes[:level_one_apply_single_unit_flag] if attributes.key?(:level_one_apply_single_unit_flag)

  self.level_one_apply_single_unit_min = attributes[:level_one_apply_single_unit_min] if attributes.key?(:level_one_apply_single_unit_min)

  self.level_one_apply_single_unit_max = attributes[:level_one_apply_single_unit_max] if attributes.key?(:level_one_apply_single_unit_max)

  self.level_two_rate = attributes[:level_two_rate] if attributes.key?(:level_two_rate)

  self.level_two_rate_type = attributes[:level_two_rate_type] if attributes.key?(:level_two_rate_type)

  self.level_two_taxable_max = attributes[:level_two_taxable_max] if attributes.key?(:level_two_taxable_max)

  self.level_two_caption = attributes[:level_two_caption] if attributes.key?(:level_two_caption)

  self.level_two_tax_code_xref = attributes[:level_two_tax_code_xref] if attributes.key?(:level_two_tax_code_xref)

  self.level_two_agency_xref = attributes[:level_two_agency_xref] if attributes.key?(:level_two_agency_xref)

  self.level_two_services_flag = attributes[:level_two_services_flag] if attributes.key?(:level_two_services_flag)

  self.level_two_expenses_flag = attributes[:level_two_expenses_flag] if attributes.key?(:level_two_expenses_flag)

  self.level_two_products_flag = attributes[:level_two_products_flag] if attributes.key?(:level_two_products_flag)

  self.level_two_apply_single_unit_flag = attributes[:level_two_apply_single_unit_flag] if attributes.key?(:level_two_apply_single_unit_flag)

  self.level_two_apply_single_unit_min = attributes[:level_two_apply_single_unit_min] if attributes.key?(:level_two_apply_single_unit_min)

  self.level_two_apply_single_unit_max = attributes[:level_two_apply_single_unit_max] if attributes.key?(:level_two_apply_single_unit_max)

  self.level_three_rate = attributes[:level_three_rate] if attributes.key?(:level_three_rate)

  self.level_three_rate_type = attributes[:level_three_rate_type] if attributes.key?(:level_three_rate_type)

  self.level_three_taxable_max = attributes[:level_three_taxable_max] if attributes.key?(:level_three_taxable_max)

  self.level_three_caption = attributes[:level_three_caption] if attributes.key?(:level_three_caption)

  self.level_three_tax_code_xref = attributes[:level_three_tax_code_xref] if attributes.key?(:level_three_tax_code_xref)

  self.level_three_agency_xref = attributes[:level_three_agency_xref] if attributes.key?(:level_three_agency_xref)

  self.level_three_services_flag = attributes[:level_three_services_flag] if attributes.key?(:level_three_services_flag)

  self.level_three_expenses_flag = attributes[:level_three_expenses_flag] if attributes.key?(:level_three_expenses_flag)

  self.level_three_products_flag = attributes[:level_three_products_flag] if attributes.key?(:level_three_products_flag)

  self.level_three_apply_single_unit_flag = attributes[:level_three_apply_single_unit_flag] if attributes.key?(:level_three_apply_single_unit_flag)

  self.level_three_apply_single_unit_min = attributes[:level_three_apply_single_unit_min] if attributes.key?(:level_three_apply_single_unit_min)

  self.level_three_apply_single_unit_max = attributes[:level_three_apply_single_unit_max] if attributes.key?(:level_three_apply_single_unit_max)

  self.level_four_rate = attributes[:level_four_rate] if attributes.key?(:level_four_rate)

  self.level_four_rate_type = attributes[:level_four_rate_type] if attributes.key?(:level_four_rate_type)

  self.level_four_taxable_max = attributes[:level_four_taxable_max] if attributes.key?(:level_four_taxable_max)

  self.level_four_caption = attributes[:level_four_caption] if attributes.key?(:level_four_caption)

  self.level_four_tax_code_xref = attributes[:level_four_tax_code_xref] if attributes.key?(:level_four_tax_code_xref)

  self.level_four_agency_xref = attributes[:level_four_agency_xref] if attributes.key?(:level_four_agency_xref)

  self.level_four_services_flag = attributes[:level_four_services_flag] if attributes.key?(:level_four_services_flag)

  self.level_four_expenses_flag = attributes[:level_four_expenses_flag] if attributes.key?(:level_four_expenses_flag)

  self.level_four_products_flag = attributes[:level_four_products_flag] if attributes.key?(:level_four_products_flag)

  self.level_four_apply_single_unit_flag = attributes[:level_four_apply_single_unit_flag] if attributes.key?(:level_four_apply_single_unit_flag)

  self.level_four_apply_single_unit_min = attributes[:level_four_apply_single_unit_min] if attributes.key?(:level_four_apply_single_unit_min)

  self.level_four_apply_single_unit_max = attributes[:level_four_apply_single_unit_max] if attributes.key?(:level_four_apply_single_unit_max)

  self.level_five_rate = attributes[:level_five_rate] if attributes.key?(:level_five_rate)

  self.level_five_rate_type = attributes[:level_five_rate_type] if attributes.key?(:level_five_rate_type)

  self.level_five_taxable_max = attributes[:level_five_taxable_max] if attributes.key?(:level_five_taxable_max)

  self.level_five_caption = attributes[:level_five_caption] if attributes.key?(:level_five_caption)

  self.level_five_tax_code_xref = attributes[:level_five_tax_code_xref] if attributes.key?(:level_five_tax_code_xref)

  self.level_five_agency_xref = attributes[:level_five_agency_xref] if attributes.key?(:level_five_agency_xref)

  self.level_five_services_flag = attributes[:level_five_services_flag] if attributes.key?(:level_five_services_flag)

  self.level_five_expenses_flag = attributes[:level_five_expenses_flag] if attributes.key?(:level_five_expenses_flag)

  self.level_five_products_flag = attributes[:level_five_products_flag] if attributes.key?(:level_five_products_flag)

  self.level_five_apply_single_unit_flag = attributes[:level_five_apply_single_unit_flag] if attributes.key?(:level_five_apply_single_unit_flag)

  self.level_five_apply_single_unit_min = attributes[:level_five_apply_single_unit_min] if attributes.key?(:level_five_apply_single_unit_min)

  self.level_five_apply_single_unit_max = attributes[:level_five_apply_single_unit_max] if attributes.key?(:level_five_apply_single_unit_max)

  self.level_six_rate = attributes[:level_six_rate] if attributes.key?(:level_six_rate)

  self.level_six_rate_type = attributes[:level_six_rate_type] if attributes.key?(:level_six_rate_type)

  self.level_six_taxable_max = attributes[:level_six_taxable_max] if attributes.key?(:level_six_taxable_max)

  self.level_six_caption = attributes[:level_six_caption] if attributes.key?(:level_six_caption)

  self.level_six_tax_code_xref = attributes[:level_six_tax_code_xref] if attributes.key?(:level_six_tax_code_xref)

  self.level_six_agency_xref = attributes[:level_six_agency_xref] if attributes.key?(:level_six_agency_xref)

  self.level_six_services_flag = attributes[:level_six_services_flag] if attributes.key?(:level_six_services_flag)

  self.level_six_expenses_flag = attributes[:level_six_expenses_flag] if attributes.key?(:level_six_expenses_flag)

  self.level_six_products_flag = attributes[:level_six_products_flag] if attributes.key?(:level_six_products_flag)

  self.level_six_apply_single_unit_flag = attributes[:level_six_apply_single_unit_flag] if attributes.key?(:level_six_apply_single_unit_flag)

  self.level_six_apply_single_unit_min = attributes[:level_six_apply_single_unit_min] if attributes.key?(:level_six_apply_single_unit_min)

  self.level_six_apply_single_unit_max = attributes[:level_six_apply_single_unit_max] if attributes.key?(:level_six_apply_single_unit_max)

  if attributes.key?(:work_role_ids) && (value = attributes[:work_role_ids]).is_a?(Array)
    self.work_role_ids = value
  end

  self.add_all_work_roles = attributes[:add_all_work_roles] if attributes.key?(:add_all_work_roles)

  self.remove_all_work_roles = attributes[:remove_all_work_roles] if attributes.key?(:remove_all_work_roles)

  if attributes.key?(:expense_type_ids) && (value = attributes[:expense_type_ids]).is_a?(Array)
    self.expense_type_ids = value
  end

  self.add_all_expense_types = attributes[:add_all_expense_types] if attributes.key?(:add_all_expense_types)

  self.remove_all_expense_types = attributes[:remove_all_expense_types] if attributes.key?(:remove_all_expense_types)

  if attributes.key?(:product_type_ids) && (value = attributes[:product_type_ids]).is_a?(Array)
    self.product_type_ids = value
  end

  self.add_all_product_types = attributes[:add_all_product_types] if attributes.key?(:add_all_product_types)

  self.remove_all_product_types = attributes[:remove_all_product_types] if attributes.key?(:remove_all_product_types)

  return unless attributes.key?(:_info)
  return unless (value = attributes[:_info]).is_a?(Hash)

  self._info = value
end

Instance Attribute Details

#_infoObject

Returns the value of attribute _info.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def _info
  @_info
end

#add_all_expense_typesObject

Returns the value of attribute add_all_expense_types.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def add_all_expense_types
  @add_all_expense_types
end

#add_all_product_typesObject

Returns the value of attribute add_all_product_types.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def add_all_product_types
  @add_all_product_types
end

#add_all_work_rolesObject

Returns the value of attribute add_all_work_roles.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def add_all_work_roles
  @add_all_work_roles
end

#canada_calculate_gst_flagObject

Returns the value of attribute canada_calculate_gst_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def canada_calculate_gst_flag
  @canada_calculate_gst_flag
end

#cancel_dateObject

Returns the value of attribute cancel_date.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def cancel_date
  @cancel_date
end

#countryObject

Returns the value of attribute country.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def country
  @country
end

#default_flagObject

Returns the value of attribute default_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def default_flag
  @default_flag
end

#descriptionObject

Max length: 50;



20
21
22
# File 'lib/connect_wise/models/tax_code.rb', line 20

def description
  @description
end

#display_on_invoice_flagObject

Returns the value of attribute display_on_invoice_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def display_on_invoice_flag
  @display_on_invoice_flag
end

#effective_dateObject

Returns the value of attribute effective_date.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def effective_date
  @effective_date
end

#expense_type_idsObject

Array of expense type exemptions for the tax code



85
86
87
# File 'lib/connect_wise/models/tax_code.rb', line 85

def expense_type_ids
  @expense_type_ids
end

#idObject

Returns the value of attribute id.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def id
  @id
end

#identifierObject

Max length: 8;



17
18
19
# File 'lib/connect_wise/models/tax_code.rb', line 17

def identifier
  @identifier
end

#invoice_captionObject

Max length: 25;



23
24
25
# File 'lib/connect_wise/models/tax_code.rb', line 23

def invoice_caption
  @invoice_caption
end

#level_five_agency_xrefObject

Max length: 100;



70
71
72
# File 'lib/connect_wise/models/tax_code.rb', line 70

def level_five_agency_xref
  @level_five_agency_xref
end

#level_five_apply_single_unit_flagObject

Returns the value of attribute level_five_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_apply_single_unit_flag
  @level_five_apply_single_unit_flag
end

#level_five_apply_single_unit_maxObject

Returns the value of attribute level_five_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_apply_single_unit_max
  @level_five_apply_single_unit_max
end

#level_five_apply_single_unit_minObject

Returns the value of attribute level_five_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_apply_single_unit_min
  @level_five_apply_single_unit_min
end

#level_five_captionObject

Max length: 25;



64
65
66
# File 'lib/connect_wise/models/tax_code.rb', line 64

def level_five_caption
  @level_five_caption
end

#level_five_expenses_flagObject

Returns the value of attribute level_five_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_expenses_flag
  @level_five_expenses_flag
end

#level_five_products_flagObject

Returns the value of attribute level_five_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_products_flag
  @level_five_products_flag
end

#level_five_rateObject

Returns the value of attribute level_five_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_rate
  @level_five_rate
end

#level_five_rate_typeObject

Returns the value of attribute level_five_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_rate_type
  @level_five_rate_type
end

#level_five_services_flagObject

Returns the value of attribute level_five_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_services_flag
  @level_five_services_flag
end

#level_five_tax_code_xrefObject

Max length: 50;



67
68
69
# File 'lib/connect_wise/models/tax_code.rb', line 67

def level_five_tax_code_xref
  @level_five_tax_code_xref
end

#level_five_taxable_maxObject

Returns the value of attribute level_five_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_five_taxable_max
  @level_five_taxable_max
end

#level_four_agency_xrefObject

Max length: 100;



61
62
63
# File 'lib/connect_wise/models/tax_code.rb', line 61

def level_four_agency_xref
  @level_four_agency_xref
end

#level_four_apply_single_unit_flagObject

Returns the value of attribute level_four_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_apply_single_unit_flag
  @level_four_apply_single_unit_flag
end

#level_four_apply_single_unit_maxObject

Returns the value of attribute level_four_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_apply_single_unit_max
  @level_four_apply_single_unit_max
end

#level_four_apply_single_unit_minObject

Returns the value of attribute level_four_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_apply_single_unit_min
  @level_four_apply_single_unit_min
end

#level_four_captionObject

Max length: 25;



55
56
57
# File 'lib/connect_wise/models/tax_code.rb', line 55

def level_four_caption
  @level_four_caption
end

#level_four_expenses_flagObject

Returns the value of attribute level_four_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_expenses_flag
  @level_four_expenses_flag
end

#level_four_products_flagObject

Returns the value of attribute level_four_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_products_flag
  @level_four_products_flag
end

#level_four_rateObject

Returns the value of attribute level_four_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_rate
  @level_four_rate
end

#level_four_rate_typeObject

Returns the value of attribute level_four_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_rate_type
  @level_four_rate_type
end

#level_four_services_flagObject

Returns the value of attribute level_four_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_services_flag
  @level_four_services_flag
end

#level_four_tax_code_xrefObject

Max length: 50;



58
59
60
# File 'lib/connect_wise/models/tax_code.rb', line 58

def level_four_tax_code_xref
  @level_four_tax_code_xref
end

#level_four_taxable_maxObject

Returns the value of attribute level_four_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_four_taxable_max
  @level_four_taxable_max
end

#level_one_agency_xrefObject

Max length: 100;



34
35
36
# File 'lib/connect_wise/models/tax_code.rb', line 34

def level_one_agency_xref
  @level_one_agency_xref
end

#level_one_apply_single_unit_flagObject

Returns the value of attribute level_one_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_apply_single_unit_flag
  @level_one_apply_single_unit_flag
end

#level_one_apply_single_unit_maxObject

Returns the value of attribute level_one_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_apply_single_unit_max
  @level_one_apply_single_unit_max
end

#level_one_apply_single_unit_minObject

Returns the value of attribute level_one_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_apply_single_unit_min
  @level_one_apply_single_unit_min
end

#level_one_captionObject

Max length: 25;



28
29
30
# File 'lib/connect_wise/models/tax_code.rb', line 28

def level_one_caption
  @level_one_caption
end

#level_one_expenses_flagObject

Returns the value of attribute level_one_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_expenses_flag
  @level_one_expenses_flag
end

#level_one_products_flagObject

Returns the value of attribute level_one_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_products_flag
  @level_one_products_flag
end

#level_one_rateObject

Returns the value of attribute level_one_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_rate
  @level_one_rate
end

#level_one_rate_typeObject

Returns the value of attribute level_one_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_rate_type
  @level_one_rate_type
end

#level_one_services_flagObject

Returns the value of attribute level_one_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_services_flag
  @level_one_services_flag
end

#level_one_tax_code_xrefObject

Max length: 50;



31
32
33
# File 'lib/connect_wise/models/tax_code.rb', line 31

def level_one_tax_code_xref
  @level_one_tax_code_xref
end

#level_one_taxable_maxObject

Returns the value of attribute level_one_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_one_taxable_max
  @level_one_taxable_max
end

#level_six_agency_xrefObject

Max length: 100;



79
80
81
# File 'lib/connect_wise/models/tax_code.rb', line 79

def level_six_agency_xref
  @level_six_agency_xref
end

#level_six_apply_single_unit_flagObject

Returns the value of attribute level_six_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_apply_single_unit_flag
  @level_six_apply_single_unit_flag
end

#level_six_apply_single_unit_maxObject

Returns the value of attribute level_six_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_apply_single_unit_max
  @level_six_apply_single_unit_max
end

#level_six_apply_single_unit_minObject

Returns the value of attribute level_six_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_apply_single_unit_min
  @level_six_apply_single_unit_min
end

#level_six_captionObject

Max length: 25;



73
74
75
# File 'lib/connect_wise/models/tax_code.rb', line 73

def level_six_caption
  @level_six_caption
end

#level_six_expenses_flagObject

Returns the value of attribute level_six_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_expenses_flag
  @level_six_expenses_flag
end

#level_six_products_flagObject

Returns the value of attribute level_six_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_products_flag
  @level_six_products_flag
end

#level_six_rateObject

Returns the value of attribute level_six_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_rate
  @level_six_rate
end

#level_six_rate_typeObject

Returns the value of attribute level_six_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_rate_type
  @level_six_rate_type
end

#level_six_services_flagObject

Returns the value of attribute level_six_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_services_flag
  @level_six_services_flag
end

#level_six_tax_code_xrefObject

Max length: 50;



76
77
78
# File 'lib/connect_wise/models/tax_code.rb', line 76

def level_six_tax_code_xref
  @level_six_tax_code_xref
end

#level_six_taxable_maxObject

Returns the value of attribute level_six_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_six_taxable_max
  @level_six_taxable_max
end

#level_three_agency_xrefObject

Max length: 100;



52
53
54
# File 'lib/connect_wise/models/tax_code.rb', line 52

def level_three_agency_xref
  @level_three_agency_xref
end

#level_three_apply_single_unit_flagObject

Returns the value of attribute level_three_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_apply_single_unit_flag
  @level_three_apply_single_unit_flag
end

#level_three_apply_single_unit_maxObject

Returns the value of attribute level_three_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_apply_single_unit_max
  @level_three_apply_single_unit_max
end

#level_three_apply_single_unit_minObject

Returns the value of attribute level_three_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_apply_single_unit_min
  @level_three_apply_single_unit_min
end

#level_three_captionObject

Max length: 25;



46
47
48
# File 'lib/connect_wise/models/tax_code.rb', line 46

def level_three_caption
  @level_three_caption
end

#level_three_expenses_flagObject

Returns the value of attribute level_three_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_expenses_flag
  @level_three_expenses_flag
end

#level_three_products_flagObject

Returns the value of attribute level_three_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_products_flag
  @level_three_products_flag
end

#level_three_rateObject

Returns the value of attribute level_three_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_rate
  @level_three_rate
end

#level_three_rate_typeObject

Returns the value of attribute level_three_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_rate_type
  @level_three_rate_type
end

#level_three_services_flagObject

Returns the value of attribute level_three_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_services_flag
  @level_three_services_flag
end

#level_three_tax_code_xrefObject

Max length: 50;



49
50
51
# File 'lib/connect_wise/models/tax_code.rb', line 49

def level_three_tax_code_xref
  @level_three_tax_code_xref
end

#level_three_taxable_maxObject

Returns the value of attribute level_three_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_three_taxable_max
  @level_three_taxable_max
end

#level_two_agency_xrefObject

Max length: 100;



43
44
45
# File 'lib/connect_wise/models/tax_code.rb', line 43

def level_two_agency_xref
  @level_two_agency_xref
end

#level_two_apply_single_unit_flagObject

Returns the value of attribute level_two_apply_single_unit_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_apply_single_unit_flag
  @level_two_apply_single_unit_flag
end

#level_two_apply_single_unit_maxObject

Returns the value of attribute level_two_apply_single_unit_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_apply_single_unit_max
  @level_two_apply_single_unit_max
end

#level_two_apply_single_unit_minObject

Returns the value of attribute level_two_apply_single_unit_min.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_apply_single_unit_min
  @level_two_apply_single_unit_min
end

#level_two_captionObject

Max length: 25;



37
38
39
# File 'lib/connect_wise/models/tax_code.rb', line 37

def level_two_caption
  @level_two_caption
end

#level_two_expenses_flagObject

Returns the value of attribute level_two_expenses_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_expenses_flag
  @level_two_expenses_flag
end

#level_two_products_flagObject

Returns the value of attribute level_two_products_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_products_flag
  @level_two_products_flag
end

#level_two_rateObject

Returns the value of attribute level_two_rate.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_rate
  @level_two_rate
end

#level_two_rate_typeObject

Returns the value of attribute level_two_rate_type.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_rate_type
  @level_two_rate_type
end

#level_two_services_flagObject

Returns the value of attribute level_two_services_flag.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_services_flag
  @level_two_services_flag
end

#level_two_tax_code_xrefObject

Max length: 50;



40
41
42
# File 'lib/connect_wise/models/tax_code.rb', line 40

def level_two_tax_code_xref
  @level_two_tax_code_xref
end

#level_two_taxable_maxObject

Returns the value of attribute level_two_taxable_max.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def level_two_taxable_max
  @level_two_taxable_max
end

#product_type_idsObject

Array of product type exemptions for the tax code



88
89
90
# File 'lib/connect_wise/models/tax_code.rb', line 88

def product_type_ids
  @product_type_ids
end

#remove_all_expense_typesObject

Returns the value of attribute remove_all_expense_types.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def remove_all_expense_types
  @remove_all_expense_types
end

#remove_all_product_typesObject

Returns the value of attribute remove_all_product_types.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def remove_all_product_types
  @remove_all_product_types
end

#remove_all_work_rolesObject

Returns the value of attribute remove_all_work_roles.



25
26
27
# File 'lib/connect_wise/models/tax_code.rb', line 25

def remove_all_work_roles
  @remove_all_work_roles
end

#work_role_idsObject

Array of work role exemptions for the tax code



82
83
84
# File 'lib/connect_wise/models/tax_code.rb', line 82

def work_role_ids
  @work_role_ids
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



210
211
212
# File 'lib/connect_wise/models/tax_code.rb', line 210

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



112
113
114
115
116
117
118
119
120
121
122
123
124
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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/connect_wise/models/tax_code.rb', line 112

def self.attribute_map
  {
    identifier: :identifier,
    description: :description,
    invoice_caption: :invoiceCaption,
    effective_date: :effectiveDate,
    id: :id,
    country: :country,
    default_flag: :defaultFlag,
    display_on_invoice_flag: :displayOnInvoiceFlag,
    canada_calculate_gst_flag: :canadaCalculateGSTFlag,
    cancel_date: :cancelDate,
    level_one_rate: :levelOneRate,
    level_one_rate_type: :levelOneRateType,
    level_one_taxable_max: :levelOneTaxableMax,
    level_one_caption: :levelOneCaption,
    level_one_tax_code_xref: :levelOneTaxCodeXref,
    level_one_agency_xref: :levelOneAgencyXref,
    level_one_services_flag: :levelOneServicesFlag,
    level_one_expenses_flag: :levelOneExpensesFlag,
    level_one_products_flag: :levelOneProductsFlag,
    level_one_apply_single_unit_flag: :levelOneApplySingleUnitFlag,
    level_one_apply_single_unit_min: :levelOneApplySingleUnitMin,
    level_one_apply_single_unit_max: :levelOneApplySingleUnitMax,
    level_two_rate: :levelTwoRate,
    level_two_rate_type: :levelTwoRateType,
    level_two_taxable_max: :levelTwoTaxableMax,
    level_two_caption: :levelTwoCaption,
    level_two_tax_code_xref: :levelTwoTaxCodeXref,
    level_two_agency_xref: :levelTwoAgencyXref,
    level_two_services_flag: :levelTwoServicesFlag,
    level_two_expenses_flag: :levelTwoExpensesFlag,
    level_two_products_flag: :levelTwoProductsFlag,
    level_two_apply_single_unit_flag: :levelTwoApplySingleUnitFlag,
    level_two_apply_single_unit_min: :levelTwoApplySingleUnitMin,
    level_two_apply_single_unit_max: :levelTwoApplySingleUnitMax,
    level_three_rate: :levelThreeRate,
    level_three_rate_type: :levelThreeRateType,
    level_three_taxable_max: :levelThreeTaxableMax,
    level_three_caption: :levelThreeCaption,
    level_three_tax_code_xref: :levelThreeTaxCodeXref,
    level_three_agency_xref: :levelThreeAgencyXref,
    level_three_services_flag: :levelThreeServicesFlag,
    level_three_expenses_flag: :levelThreeExpensesFlag,
    level_three_products_flag: :levelThreeProductsFlag,
    level_three_apply_single_unit_flag: :levelThreeApplySingleUnitFlag,
    level_three_apply_single_unit_min: :levelThreeApplySingleUnitMin,
    level_three_apply_single_unit_max: :levelThreeApplySingleUnitMax,
    level_four_rate: :levelFourRate,
    level_four_rate_type: :levelFourRateType,
    level_four_taxable_max: :levelFourTaxableMax,
    level_four_caption: :levelFourCaption,
    level_four_tax_code_xref: :levelFourTaxCodeXref,
    level_four_agency_xref: :levelFourAgencyXref,
    level_four_services_flag: :levelFourServicesFlag,
    level_four_expenses_flag: :levelFourExpensesFlag,
    level_four_products_flag: :levelFourProductsFlag,
    level_four_apply_single_unit_flag: :levelFourApplySingleUnitFlag,
    level_four_apply_single_unit_min: :levelFourApplySingleUnitMin,
    level_four_apply_single_unit_max: :levelFourApplySingleUnitMax,
    level_five_rate: :levelFiveRate,
    level_five_rate_type: :levelFiveRateType,
    level_five_taxable_max: :levelFiveTaxableMax,
    level_five_caption: :levelFiveCaption,
    level_five_tax_code_xref: :levelFiveTaxCodeXref,
    level_five_agency_xref: :levelFiveAgencyXref,
    level_five_services_flag: :levelFiveServicesFlag,
    level_five_expenses_flag: :levelFiveExpensesFlag,
    level_five_products_flag: :levelFiveProductsFlag,
    level_five_apply_single_unit_flag: :levelFiveApplySingleUnitFlag,
    level_five_apply_single_unit_min: :levelFiveApplySingleUnitMin,
    level_five_apply_single_unit_max: :levelFiveApplySingleUnitMax,
    level_six_rate: :levelSixRate,
    level_six_rate_type: :levelSixRateType,
    level_six_taxable_max: :levelSixTaxableMax,
    level_six_caption: :levelSixCaption,
    level_six_tax_code_xref: :levelSixTaxCodeXref,
    level_six_agency_xref: :levelSixAgencyXref,
    level_six_services_flag: :levelSixServicesFlag,
    level_six_expenses_flag: :levelSixExpensesFlag,
    level_six_products_flag: :levelSixProductsFlag,
    level_six_apply_single_unit_flag: :levelSixApplySingleUnitFlag,
    level_six_apply_single_unit_min: :levelSixApplySingleUnitMin,
    level_six_apply_single_unit_max: :levelSixApplySingleUnitMax,
    work_role_ids: :workRoleIds,
    add_all_work_roles: :addAllWorkRoles,
    remove_all_work_roles: :removeAllWorkRoles,
    expense_type_ids: :expenseTypeIds,
    add_all_expense_types: :addAllExpenseTypes,
    remove_all_expense_types: :removeAllExpenseTypes,
    product_type_ids: :productTypeIds,
    add_all_product_types: :addAllProductTypes,
    remove_all_product_types: :removeAllProductTypes,
    _info: :_info
  }
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



800
801
802
# File 'lib/connect_wise/models/tax_code.rb', line 800

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



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
# File 'lib/connect_wise/models/tax_code.rb', line 313

def self.openapi_nullable
  Set.new(i[
            default_flag
            display_on_invoice_flag
            canada_calculate_gst_flag
            level_one_rate
            level_one_rate_type
            level_one_taxable_max
            level_one_services_flag
            level_one_expenses_flag
            level_one_products_flag
            level_one_apply_single_unit_flag
            level_one_apply_single_unit_min
            level_one_apply_single_unit_max
            level_two_rate
            level_two_rate_type
            level_two_taxable_max
            level_two_services_flag
            level_two_expenses_flag
            level_two_products_flag
            level_two_apply_single_unit_flag
            level_two_apply_single_unit_min
            level_two_apply_single_unit_max
            level_three_rate
            level_three_rate_type
            level_three_taxable_max
            level_three_services_flag
            level_three_expenses_flag
            level_three_products_flag
            level_three_apply_single_unit_flag
            level_three_apply_single_unit_min
            level_three_apply_single_unit_max
            level_four_rate
            level_four_rate_type
            level_four_taxable_max
            level_four_services_flag
            level_four_expenses_flag
            level_four_products_flag
            level_four_apply_single_unit_flag
            level_four_apply_single_unit_min
            level_four_apply_single_unit_max
            level_five_rate
            level_five_rate_type
            level_five_taxable_max
            level_five_services_flag
            level_five_expenses_flag
            level_five_products_flag
            level_five_apply_single_unit_flag
            level_five_apply_single_unit_min
            level_five_apply_single_unit_max
            level_six_rate
            level_six_rate_type
            level_six_taxable_max
            level_six_services_flag
            level_six_expenses_flag
            level_six_products_flag
            level_six_apply_single_unit_flag
            level_six_apply_single_unit_min
            level_six_apply_single_unit_max
            add_all_work_roles
            remove_all_work_roles
            add_all_expense_types
            remove_all_expense_types
            add_all_product_types
            remove_all_product_types
          ])
end

.openapi_typesObject

Attribute type mapping.



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
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
# File 'lib/connect_wise/models/tax_code.rb', line 215

def self.openapi_types
  {
    identifier: :String,
    description: :String,
    invoice_caption: :String,
    effective_date: :Time,
    id: :Integer,
    country: :CountryReference,
    default_flag: :Boolean,
    display_on_invoice_flag: :Boolean,
    canada_calculate_gst_flag: :Boolean,
    cancel_date: :Time,
    level_one_rate: :Float,
    level_one_rate_type: :String,
    level_one_taxable_max: :Float,
    level_one_caption: :String,
    level_one_tax_code_xref: :String,
    level_one_agency_xref: :String,
    level_one_services_flag: :Boolean,
    level_one_expenses_flag: :Boolean,
    level_one_products_flag: :Boolean,
    level_one_apply_single_unit_flag: :Boolean,
    level_one_apply_single_unit_min: :Float,
    level_one_apply_single_unit_max: :Float,
    level_two_rate: :Float,
    level_two_rate_type: :String,
    level_two_taxable_max: :Float,
    level_two_caption: :String,
    level_two_tax_code_xref: :String,
    level_two_agency_xref: :String,
    level_two_services_flag: :Boolean,
    level_two_expenses_flag: :Boolean,
    level_two_products_flag: :Boolean,
    level_two_apply_single_unit_flag: :Boolean,
    level_two_apply_single_unit_min: :Float,
    level_two_apply_single_unit_max: :Float,
    level_three_rate: :Float,
    level_three_rate_type: :String,
    level_three_taxable_max: :Float,
    level_three_caption: :String,
    level_three_tax_code_xref: :String,
    level_three_agency_xref: :String,
    level_three_services_flag: :Boolean,
    level_three_expenses_flag: :Boolean,
    level_three_products_flag: :Boolean,
    level_three_apply_single_unit_flag: :Boolean,
    level_three_apply_single_unit_min: :Float,
    level_three_apply_single_unit_max: :Float,
    level_four_rate: :Float,
    level_four_rate_type: :String,
    level_four_taxable_max: :Float,
    level_four_caption: :String,
    level_four_tax_code_xref: :String,
    level_four_agency_xref: :String,
    level_four_services_flag: :Boolean,
    level_four_expenses_flag: :Boolean,
    level_four_products_flag: :Boolean,
    level_four_apply_single_unit_flag: :Boolean,
    level_four_apply_single_unit_min: :Float,
    level_four_apply_single_unit_max: :Float,
    level_five_rate: :Float,
    level_five_rate_type: :String,
    level_five_taxable_max: :Float,
    level_five_caption: :String,
    level_five_tax_code_xref: :String,
    level_five_agency_xref: :String,
    level_five_services_flag: :Boolean,
    level_five_expenses_flag: :Boolean,
    level_five_products_flag: :Boolean,
    level_five_apply_single_unit_flag: :Boolean,
    level_five_apply_single_unit_min: :Float,
    level_five_apply_single_unit_max: :Float,
    level_six_rate: :Float,
    level_six_rate_type: :String,
    level_six_taxable_max: :Float,
    level_six_caption: :String,
    level_six_tax_code_xref: :String,
    level_six_agency_xref: :String,
    level_six_services_flag: :Boolean,
    level_six_expenses_flag: :Boolean,
    level_six_products_flag: :Boolean,
    level_six_apply_single_unit_flag: :Boolean,
    level_six_apply_single_unit_min: :Float,
    level_six_apply_single_unit_max: :Float,
    work_role_ids: :'Array<Integer>',
    add_all_work_roles: :Boolean,
    remove_all_work_roles: :Boolean,
    expense_type_ids: :'Array<Integer>',
    add_all_expense_types: :Boolean,
    remove_all_expense_types: :Boolean,
    product_type_ids: :'Array<Integer>',
    add_all_product_types: :Boolean,
    remove_all_product_types: :Boolean,
    _info: :'Hash<String, String>'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
# File 'lib/connect_wise/models/tax_code.rb', line 687

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    identifier == other.identifier &&
    description == other.description &&
    invoice_caption == other.invoice_caption &&
    effective_date == other.effective_date &&
    id == other.id &&
    country == other.country &&
    default_flag == other.default_flag &&
    display_on_invoice_flag == other.display_on_invoice_flag &&
    canada_calculate_gst_flag == other.canada_calculate_gst_flag &&
    cancel_date == other.cancel_date &&
    level_one_rate == other.level_one_rate &&
    level_one_rate_type == other.level_one_rate_type &&
    level_one_taxable_max == other.level_one_taxable_max &&
    level_one_caption == other.level_one_caption &&
    level_one_tax_code_xref == other.level_one_tax_code_xref &&
    level_one_agency_xref == other.level_one_agency_xref &&
    level_one_services_flag == other.level_one_services_flag &&
    level_one_expenses_flag == other.level_one_expenses_flag &&
    level_one_products_flag == other.level_one_products_flag &&
    level_one_apply_single_unit_flag == other.level_one_apply_single_unit_flag &&
    level_one_apply_single_unit_min == other.level_one_apply_single_unit_min &&
    level_one_apply_single_unit_max == other.level_one_apply_single_unit_max &&
    level_two_rate == other.level_two_rate &&
    level_two_rate_type == other.level_two_rate_type &&
    level_two_taxable_max == other.level_two_taxable_max &&
    level_two_caption == other.level_two_caption &&
    level_two_tax_code_xref == other.level_two_tax_code_xref &&
    level_two_agency_xref == other.level_two_agency_xref &&
    level_two_services_flag == other.level_two_services_flag &&
    level_two_expenses_flag == other.level_two_expenses_flag &&
    level_two_products_flag == other.level_two_products_flag &&
    level_two_apply_single_unit_flag == other.level_two_apply_single_unit_flag &&
    level_two_apply_single_unit_min == other.level_two_apply_single_unit_min &&
    level_two_apply_single_unit_max == other.level_two_apply_single_unit_max &&
    level_three_rate == other.level_three_rate &&
    level_three_rate_type == other.level_three_rate_type &&
    level_three_taxable_max == other.level_three_taxable_max &&
    level_three_caption == other.level_three_caption &&
    level_three_tax_code_xref == other.level_three_tax_code_xref &&
    level_three_agency_xref == other.level_three_agency_xref &&
    level_three_services_flag == other.level_three_services_flag &&
    level_three_expenses_flag == other.level_three_expenses_flag &&
    level_three_products_flag == other.level_three_products_flag &&
    level_three_apply_single_unit_flag == other.level_three_apply_single_unit_flag &&
    level_three_apply_single_unit_min == other.level_three_apply_single_unit_min &&
    level_three_apply_single_unit_max == other.level_three_apply_single_unit_max &&
    level_four_rate == other.level_four_rate &&
    level_four_rate_type == other.level_four_rate_type &&
    level_four_taxable_max == other.level_four_taxable_max &&
    level_four_caption == other.level_four_caption &&
    level_four_tax_code_xref == other.level_four_tax_code_xref &&
    level_four_agency_xref == other.level_four_agency_xref &&
    level_four_services_flag == other.level_four_services_flag &&
    level_four_expenses_flag == other.level_four_expenses_flag &&
    level_four_products_flag == other.level_four_products_flag &&
    level_four_apply_single_unit_flag == other.level_four_apply_single_unit_flag &&
    level_four_apply_single_unit_min == other.level_four_apply_single_unit_min &&
    level_four_apply_single_unit_max == other.level_four_apply_single_unit_max &&
    level_five_rate == other.level_five_rate &&
    level_five_rate_type == other.level_five_rate_type &&
    level_five_taxable_max == other.level_five_taxable_max &&
    level_five_caption == other.level_five_caption &&
    level_five_tax_code_xref == other.level_five_tax_code_xref &&
    level_five_agency_xref == other.level_five_agency_xref &&
    level_five_services_flag == other.level_five_services_flag &&
    level_five_expenses_flag == other.level_five_expenses_flag &&
    level_five_products_flag == other.level_five_products_flag &&
    level_five_apply_single_unit_flag == other.level_five_apply_single_unit_flag &&
    level_five_apply_single_unit_min == other.level_five_apply_single_unit_min &&
    level_five_apply_single_unit_max == other.level_five_apply_single_unit_max &&
    level_six_rate == other.level_six_rate &&
    level_six_rate_type == other.level_six_rate_type &&
    level_six_taxable_max == other.level_six_taxable_max &&
    level_six_caption == other.level_six_caption &&
    level_six_tax_code_xref == other.level_six_tax_code_xref &&
    level_six_agency_xref == other.level_six_agency_xref &&
    level_six_services_flag == other.level_six_services_flag &&
    level_six_expenses_flag == other.level_six_expenses_flag &&
    level_six_products_flag == other.level_six_products_flag &&
    level_six_apply_single_unit_flag == other.level_six_apply_single_unit_flag &&
    level_six_apply_single_unit_min == other.level_six_apply_single_unit_min &&
    level_six_apply_single_unit_max == other.level_six_apply_single_unit_max &&
    work_role_ids == other.work_role_ids &&
    add_all_work_roles == other.add_all_work_roles &&
    remove_all_work_roles == other.remove_all_work_roles &&
    expense_type_ids == other.expense_type_ids &&
    add_all_expense_types == other.add_all_expense_types &&
    remove_all_expense_types == other.remove_all_expense_types &&
    product_type_ids == other.product_type_ids &&
    add_all_product_types == other.add_all_product_types &&
    remove_all_product_types == other.remove_all_product_types &&
    _info == other._info
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



830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/connect_wise/models/tax_code.rb', line 830

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = ConnectWise.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



901
902
903
904
905
906
907
908
909
910
911
912
913
# File 'lib/connect_wise/models/tax_code.rb', line 901

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



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/connect_wise/models/tax_code.rb', line 807

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      send("#{key}=", nil)
    elsif 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
      send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array)
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


787
788
789
# File 'lib/connect_wise/models/tax_code.rb', line 787

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



793
794
795
# File 'lib/connect_wise/models/tax_code.rb', line 793

def hash
  [identifier, description, invoice_caption, effective_date, id, country, default_flag, display_on_invoice_flag, canada_calculate_gst_flag, cancel_date, level_one_rate, level_one_rate_type, level_one_taxable_max, level_one_caption, level_one_tax_code_xref, level_one_agency_xref, level_one_services_flag, level_one_expenses_flag, level_one_products_flag, level_one_apply_single_unit_flag, level_one_apply_single_unit_min, level_one_apply_single_unit_max, level_two_rate, level_two_rate_type, level_two_taxable_max, level_two_caption, level_two_tax_code_xref, level_two_agency_xref, level_two_services_flag, level_two_expenses_flag, level_two_products_flag, level_two_apply_single_unit_flag, level_two_apply_single_unit_min, level_two_apply_single_unit_max, level_three_rate, level_three_rate_type, level_three_taxable_max, level_three_caption, level_three_tax_code_xref, level_three_agency_xref, level_three_services_flag, level_three_expenses_flag, level_three_products_flag, level_three_apply_single_unit_flag, level_three_apply_single_unit_min, level_three_apply_single_unit_max, level_four_rate, level_four_rate_type, level_four_taxable_max, level_four_caption, level_four_tax_code_xref, level_four_agency_xref, level_four_services_flag, level_four_expenses_flag, level_four_products_flag, level_four_apply_single_unit_flag, level_four_apply_single_unit_min, level_four_apply_single_unit_max, level_five_rate, level_five_rate_type, level_five_taxable_max, level_five_caption, level_five_tax_code_xref, level_five_agency_xref, level_five_services_flag, level_five_expenses_flag, level_five_products_flag, level_five_apply_single_unit_flag, level_five_apply_single_unit_min, level_five_apply_single_unit_max, level_six_rate, level_six_rate_type, level_six_taxable_max, level_six_caption, level_six_tax_code_xref, level_six_agency_xref, level_six_services_flag, level_six_expenses_flag, level_six_products_flag, level_six_apply_single_unit_flag, level_six_apply_single_unit_min, level_six_apply_single_unit_max, work_role_ids, add_all_work_roles, remove_all_work_roles, expense_type_ids, add_all_expense_types, remove_all_expense_types, product_type_ids, add_all_product_types, remove_all_product_types, _info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/connect_wise/models/tax_code.rb', line 589

def list_invalid_properties
  invalid_properties = []
  invalid_properties.push('invalid value for "identifier", identifier cannot be nil.') if @identifier.nil?

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

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

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

  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



877
878
879
# File 'lib/connect_wise/models/tax_code.rb', line 877

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



883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/connect_wise/models/tax_code.rb', line 883

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



871
872
873
# File 'lib/connect_wise/models/tax_code.rb', line 871

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



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/connect_wise/models/tax_code.rb', line 604

def valid?
  return false if @identifier.nil?
  return false if @description.nil?
  return false if @invoice_caption.nil?
  return false if @effective_date.nil?

  level_one_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_one_rate_type_validator.valid?(@level_one_rate_type)

  level_two_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_two_rate_type_validator.valid?(@level_two_rate_type)

  level_three_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_three_rate_type_validator.valid?(@level_three_rate_type)

  level_four_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_four_rate_type_validator.valid?(@level_four_rate_type)

  level_five_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_five_rate_type_validator.valid?(@level_five_rate_type)

  level_six_rate_type_validator = EnumAttributeValidator.new('String', %w[Amount Percent])
  return false unless level_six_rate_type_validator.valid?(@level_six_rate_type)

  true
end