Class: AdvancedBilling::InvoiceAvataxDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/invoice_avatax_details.rb

Overview

InvoiceAvataxDetails Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id: SKIP, status: SKIP, document_code: SKIP, commit_date: SKIP, modify_date: SKIP, additional_properties: {}) ⇒ InvoiceAvataxDetails

Returns a new instance of InvoiceAvataxDetails.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 66

def initialize(id: SKIP, status: SKIP, document_code: SKIP,
               commit_date: SKIP, modify_date: SKIP,
               additional_properties: {})
  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end

  @id = id unless id == SKIP
  @status = status unless status == SKIP
  @document_code = document_code unless document_code == SKIP
  @commit_date = commit_date unless commit_date == SKIP
  @modify_date = modify_date unless modify_date == SKIP
end

Instance Attribute Details

#commit_dateDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


27
28
29
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 27

def commit_date
  @commit_date
end

#document_codeString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 23

def document_code
  @document_code
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


15
16
17
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 15

def id
  @id
end

#modify_dateDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


31
32
33
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 31

def modify_date
  @modify_date
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 19

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  document_code = hash.key?('document_code') ? hash['document_code'] : SKIP
  commit_date = if hash.key?('commit_date')
                  (DateTimeHelper.from_rfc3339(hash['commit_date']) if hash['commit_date'])
                else
                  SKIP
                end
  modify_date = if hash.key?('modify_date')
                  (DateTimeHelper.from_rfc3339(hash['modify_date']) if hash['modify_date'])
                else
                  SKIP
                end

  # Clean out expected properties from Hash.
  additional_properties = hash.reject { |k, _| names.value?(k) }

  # Create object from extracted values.
  InvoiceAvataxDetails.new(id: id,
                           status: status,
                           document_code: document_code,
                           commit_date: commit_date,
                           modify_date: modify_date,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['status'] = 'status'
  @_hash['document_code'] = 'document_code'
  @_hash['commit_date'] = 'commit_date'
  @_hash['modify_date'] = 'modify_date'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
59
60
61
62
63
64
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 56

def self.nullables
  %w[
    id
    status
    document_code
    commit_date
    modify_date
  ]
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
53
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 45

def self.optionals
  %w[
    id
    status
    document_code
    commit_date
    modify_date
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



122
123
124
125
126
127
128
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 122

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#to_custom_commit_dateObject



112
113
114
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 112

def to_custom_commit_date
  DateTimeHelper.to_rfc3339(commit_date)
end

#to_custom_modify_dateObject



116
117
118
# File 'lib/advanced_billing/models/invoice_avatax_details.rb', line 116

def to_custom_modify_date
  DateTimeHelper.to_rfc3339(modify_date)
end