xero-ruby 16.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xero-ruby/api/accounting_api.rb +172 -0
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +71 -1
- data/lib/xero-ruby/models/accounting/bank_transfer_delete.rb +244 -0
- data/lib/xero-ruby/models/accounting/bank_transfer_delete_by_url_param.rb +229 -0
- data/lib/xero-ruby/models/accounting/bank_transfers_delete.rb +224 -0
- data/lib/xero-ruby/models/accounting/credit_note.rb +11 -1
- data/lib/xero-ruby/models/accounting/invoice.rb +12 -2
- data/lib/xero-ruby/models/accounting/organisation.rb +3 -2
- data/lib/xero-ruby/models/accounting/overpayment.rb +11 -1
- data/lib/xero-ruby/models/accounting/payment.rb +11 -1
- data/lib/xero-ruby/models/accounting/prepayment.rb +11 -1
- data/lib/xero-ruby/models/accounting/tracking_reference.rb +277 -0
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +6 -1
- data/lib/xero-ruby/models/payroll_au/leave_line.rb +6 -1
- data/lib/xero-ruby/models/payroll_au/leave_type.rb +6 -1
- data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +1 -1
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +4 -0
- metadata +367 -363
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero Accounting API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'time'
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module XeroRuby::Accounting
|
|
16
|
+
require 'bigdecimal'
|
|
17
|
+
|
|
18
|
+
class BankTransferDeleteByUrlParam
|
|
19
|
+
# The status of the bank transfer.
|
|
20
|
+
attr_accessor :status
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'status' => :'Status'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Attribute type mapping.
|
|
30
|
+
def self.openapi_types
|
|
31
|
+
{
|
|
32
|
+
:'status' => :'String'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Initializes the object
|
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
38
|
+
def initialize(attributes = {})
|
|
39
|
+
if (!attributes.is_a?(Hash))
|
|
40
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransferDeleteByUrlParam` initialize method"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
45
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
46
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransferDeleteByUrlParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
47
|
+
end
|
|
48
|
+
h[k.to_sym] = v
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if attributes.key?(:'status')
|
|
52
|
+
self.status = attributes[:'status']
|
|
53
|
+
else
|
|
54
|
+
self.status = 'DELETED'
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
59
|
+
# @return Array for valid properties with the reasons
|
|
60
|
+
def list_invalid_properties
|
|
61
|
+
invalid_properties = Array.new
|
|
62
|
+
if @status.nil?
|
|
63
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
invalid_properties
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Check to see if the all the properties in the model are valid
|
|
70
|
+
# @return true if the model is valid
|
|
71
|
+
def valid?
|
|
72
|
+
return false if @status.nil?
|
|
73
|
+
true
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Checks equality by comparing each attribute.
|
|
77
|
+
# @param [Object] Object to be compared
|
|
78
|
+
def ==(o)
|
|
79
|
+
return true if self.equal?(o)
|
|
80
|
+
self.class == o.class &&
|
|
81
|
+
status == o.status
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# @see the `==` method
|
|
85
|
+
# @param [Object] Object to be compared
|
|
86
|
+
def eql?(o)
|
|
87
|
+
self == o
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Calculates hash code according to all attributes.
|
|
91
|
+
# @return [Integer] Hash code
|
|
92
|
+
def hash
|
|
93
|
+
[status].hash
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Builds the object from hash
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
# @return [Object] Returns the model itself
|
|
99
|
+
def self.build_from_hash(attributes)
|
|
100
|
+
new.build_from_hash(attributes)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Builds the object from hash
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
# @return [Object] Returns the model itself
|
|
106
|
+
def build_from_hash(attributes)
|
|
107
|
+
return nil unless attributes.is_a?(Hash)
|
|
108
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
109
|
+
if type =~ /\AArray<(.*)>/i
|
|
110
|
+
# check to ensure the input is an array given that the attribute
|
|
111
|
+
# is documented as an array but the input is not
|
|
112
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
114
|
+
end
|
|
115
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
116
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
117
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
self
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Deserializes the data based on type
|
|
124
|
+
# @param string type Data type
|
|
125
|
+
# @param string value Value to be deserialized
|
|
126
|
+
# @return [Object] Deserialized data
|
|
127
|
+
def _deserialize(type, value)
|
|
128
|
+
case type.to_sym
|
|
129
|
+
when :DateTime
|
|
130
|
+
DateTime.parse(parse_date(value))
|
|
131
|
+
when :Date
|
|
132
|
+
Date.parse(parse_date(value))
|
|
133
|
+
when :String
|
|
134
|
+
value.to_s
|
|
135
|
+
when :Integer
|
|
136
|
+
value.to_i
|
|
137
|
+
when :Float
|
|
138
|
+
value.to_f
|
|
139
|
+
when :BigDecimal
|
|
140
|
+
BigDecimal(value.to_s)
|
|
141
|
+
when :Boolean
|
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
143
|
+
true
|
|
144
|
+
else
|
|
145
|
+
false
|
|
146
|
+
end
|
|
147
|
+
when :Object
|
|
148
|
+
# generic object (usually a Hash), return directly
|
|
149
|
+
value
|
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
|
156
|
+
{}.tap do |hash|
|
|
157
|
+
value.each do |k, v|
|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
else # model
|
|
162
|
+
XeroRuby::Accounting.const_get(type).build_from_hash(value)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the string representation of the object
|
|
167
|
+
# @return [String] String presentation of the object
|
|
168
|
+
def to_s
|
|
169
|
+
to_hash.to_s
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_body
|
|
175
|
+
to_hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Returns the object in the form of hash
|
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
|
180
|
+
def to_hash(downcase: false)
|
|
181
|
+
hash = {}
|
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
183
|
+
value = self.send(attr)
|
|
184
|
+
next if value.nil?
|
|
185
|
+
key = downcase ? attr : param
|
|
186
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Returns the object in the form of hash with snake_case
|
|
192
|
+
def to_attributes
|
|
193
|
+
to_hash(downcase: true)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Outputs non-array value in the form of hash
|
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
198
|
+
# @param [Object] value Any valid value
|
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
|
200
|
+
def _to_hash(value, downcase: false)
|
|
201
|
+
if value.is_a?(Array)
|
|
202
|
+
value.map do |v|
|
|
203
|
+
v.to_hash(downcase: downcase)
|
|
204
|
+
end
|
|
205
|
+
elsif value.is_a?(Hash)
|
|
206
|
+
{}.tap do |hash|
|
|
207
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
|
208
|
+
end
|
|
209
|
+
elsif value.respond_to? :to_hash
|
|
210
|
+
value.to_hash(downcase: downcase)
|
|
211
|
+
else
|
|
212
|
+
value
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
def parse_date(datestring)
|
|
217
|
+
if datestring.include?('Date')
|
|
218
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
|
219
|
+
original, date, timezone = *date_pattern.match(datestring)
|
|
220
|
+
date = (date.to_i / 1000)
|
|
221
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
|
222
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
|
223
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
224
|
+
else # handle date 'types' for small subset of payroll API's
|
|
225
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero Accounting API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'time'
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module XeroRuby::Accounting
|
|
16
|
+
require 'bigdecimal'
|
|
17
|
+
|
|
18
|
+
class BankTransfersDelete
|
|
19
|
+
|
|
20
|
+
attr_accessor :bank_transfers
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'bank_transfers' => :'BankTransfers'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Attribute type mapping.
|
|
30
|
+
def self.openapi_types
|
|
31
|
+
{
|
|
32
|
+
:'bank_transfers' => :'Array<BankTransferDelete>'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Initializes the object
|
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
38
|
+
def initialize(attributes = {})
|
|
39
|
+
if (!attributes.is_a?(Hash))
|
|
40
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransfersDelete` initialize method"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
45
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
46
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransfersDelete`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
47
|
+
end
|
|
48
|
+
h[k.to_sym] = v
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if attributes.key?(:'bank_transfers')
|
|
52
|
+
if (value = attributes[:'bank_transfers']).is_a?(Array)
|
|
53
|
+
self.bank_transfers = value
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
59
|
+
# @return Array for valid properties with the reasons
|
|
60
|
+
def list_invalid_properties
|
|
61
|
+
invalid_properties = Array.new
|
|
62
|
+
invalid_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Check to see if the all the properties in the model are valid
|
|
66
|
+
# @return true if the model is valid
|
|
67
|
+
def valid?
|
|
68
|
+
true
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Checks equality by comparing each attribute.
|
|
72
|
+
# @param [Object] Object to be compared
|
|
73
|
+
def ==(o)
|
|
74
|
+
return true if self.equal?(o)
|
|
75
|
+
self.class == o.class &&
|
|
76
|
+
bank_transfers == o.bank_transfers
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @see the `==` method
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def eql?(o)
|
|
82
|
+
self == o
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Calculates hash code according to all attributes.
|
|
86
|
+
# @return [Integer] Hash code
|
|
87
|
+
def hash
|
|
88
|
+
[bank_transfers].hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def self.build_from_hash(attributes)
|
|
95
|
+
new.build_from_hash(attributes)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Builds the object from hash
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
# @return [Object] Returns the model itself
|
|
101
|
+
def build_from_hash(attributes)
|
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
|
103
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
|
105
|
+
# check to ensure the input is an array given that the attribute
|
|
106
|
+
# is documented as an array but the input is not
|
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
109
|
+
end
|
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
112
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
self
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Deserializes the data based on type
|
|
119
|
+
# @param string type Data type
|
|
120
|
+
# @param string value Value to be deserialized
|
|
121
|
+
# @return [Object] Deserialized data
|
|
122
|
+
def _deserialize(type, value)
|
|
123
|
+
case type.to_sym
|
|
124
|
+
when :DateTime
|
|
125
|
+
DateTime.parse(parse_date(value))
|
|
126
|
+
when :Date
|
|
127
|
+
Date.parse(parse_date(value))
|
|
128
|
+
when :String
|
|
129
|
+
value.to_s
|
|
130
|
+
when :Integer
|
|
131
|
+
value.to_i
|
|
132
|
+
when :Float
|
|
133
|
+
value.to_f
|
|
134
|
+
when :BigDecimal
|
|
135
|
+
BigDecimal(value.to_s)
|
|
136
|
+
when :Boolean
|
|
137
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
138
|
+
true
|
|
139
|
+
else
|
|
140
|
+
false
|
|
141
|
+
end
|
|
142
|
+
when :Object
|
|
143
|
+
# generic object (usually a Hash), return directly
|
|
144
|
+
value
|
|
145
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
146
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
147
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
148
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
149
|
+
k_type = Regexp.last_match[:k_type]
|
|
150
|
+
v_type = Regexp.last_match[:v_type]
|
|
151
|
+
{}.tap do |hash|
|
|
152
|
+
value.each do |k, v|
|
|
153
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
else # model
|
|
157
|
+
XeroRuby::Accounting.const_get(type).build_from_hash(value)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Returns the string representation of the object
|
|
162
|
+
# @return [String] String presentation of the object
|
|
163
|
+
def to_s
|
|
164
|
+
to_hash.to_s
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
|
169
|
+
def to_body
|
|
170
|
+
to_hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Returns the object in the form of hash
|
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
|
175
|
+
def to_hash(downcase: false)
|
|
176
|
+
hash = {}
|
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = self.send(attr)
|
|
179
|
+
next if value.nil?
|
|
180
|
+
key = downcase ? attr : param
|
|
181
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
|
182
|
+
end
|
|
183
|
+
hash
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the object in the form of hash with snake_case
|
|
187
|
+
def to_attributes
|
|
188
|
+
to_hash(downcase: true)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Outputs non-array value in the form of hash
|
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
193
|
+
# @param [Object] value Any valid value
|
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
|
195
|
+
def _to_hash(value, downcase: false)
|
|
196
|
+
if value.is_a?(Array)
|
|
197
|
+
value.map do |v|
|
|
198
|
+
v.to_hash(downcase: downcase)
|
|
199
|
+
end
|
|
200
|
+
elsif value.is_a?(Hash)
|
|
201
|
+
{}.tap do |hash|
|
|
202
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
|
203
|
+
end
|
|
204
|
+
elsif value.respond_to? :to_hash
|
|
205
|
+
value.to_hash(downcase: downcase)
|
|
206
|
+
else
|
|
207
|
+
value
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def parse_date(datestring)
|
|
212
|
+
if datestring.include?('Date')
|
|
213
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
|
214
|
+
original, date, timezone = *date_pattern.match(datestring)
|
|
215
|
+
date = (date.to_i / 1000)
|
|
216
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
|
217
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
|
218
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
219
|
+
else # handle date 'types' for small subset of payroll API's
|
|
220
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
@@ -63,6 +63,9 @@ module XeroRuby::Accounting
|
|
|
63
63
|
# UTC timestamp of last update to the credit note
|
|
64
64
|
attr_accessor :updated_date_utc
|
|
65
65
|
|
|
66
|
+
# UTC ISO-8601 formatted timestamp of last update to the credit note
|
|
67
|
+
attr_accessor :updated_date_utc_string
|
|
68
|
+
|
|
66
69
|
|
|
67
70
|
attr_accessor :currency_code
|
|
68
71
|
|
|
@@ -155,6 +158,7 @@ module XeroRuby::Accounting
|
|
|
155
158
|
:'cis_deduction' => :'CISDeduction',
|
|
156
159
|
:'cis_rate' => :'CISRate',
|
|
157
160
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
161
|
+
:'updated_date_utc_string' => :'UpdatedDateUTCString',
|
|
158
162
|
:'currency_code' => :'CurrencyCode',
|
|
159
163
|
:'fully_paid_on_date' => :'FullyPaidOnDate',
|
|
160
164
|
:'credit_note_id' => :'CreditNoteID',
|
|
@@ -192,6 +196,7 @@ module XeroRuby::Accounting
|
|
|
192
196
|
:'cis_deduction' => :'BigDecimal',
|
|
193
197
|
:'cis_rate' => :'BigDecimal',
|
|
194
198
|
:'updated_date_utc' => :'DateTime',
|
|
199
|
+
:'updated_date_utc_string' => :'String',
|
|
195
200
|
:'currency_code' => :'CurrencyCode',
|
|
196
201
|
:'fully_paid_on_date' => :'Date',
|
|
197
202
|
:'credit_note_id' => :'String',
|
|
@@ -282,6 +287,10 @@ module XeroRuby::Accounting
|
|
|
282
287
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
283
288
|
end
|
|
284
289
|
|
|
290
|
+
if attributes.key?(:'updated_date_utc_string')
|
|
291
|
+
self.updated_date_utc_string = attributes[:'updated_date_utc_string']
|
|
292
|
+
end
|
|
293
|
+
|
|
285
294
|
if attributes.key?(:'currency_code')
|
|
286
295
|
self.currency_code = attributes[:'currency_code']
|
|
287
296
|
end
|
|
@@ -424,6 +433,7 @@ module XeroRuby::Accounting
|
|
|
424
433
|
cis_deduction == o.cis_deduction &&
|
|
425
434
|
cis_rate == o.cis_rate &&
|
|
426
435
|
updated_date_utc == o.updated_date_utc &&
|
|
436
|
+
updated_date_utc_string == o.updated_date_utc_string &&
|
|
427
437
|
currency_code == o.currency_code &&
|
|
428
438
|
fully_paid_on_date == o.fully_paid_on_date &&
|
|
429
439
|
credit_note_id == o.credit_note_id &&
|
|
@@ -453,7 +463,7 @@ module XeroRuby::Accounting
|
|
|
453
463
|
# Calculates hash code according to all attributes.
|
|
454
464
|
# @return [Integer] Hash code
|
|
455
465
|
def hash
|
|
456
|
-
[type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings, invoice_addresses].hash
|
|
466
|
+
[type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, updated_date_utc_string, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings, invoice_addresses].hash
|
|
457
467
|
end
|
|
458
468
|
|
|
459
469
|
# Builds the object from hash
|
|
@@ -129,9 +129,12 @@ module XeroRuby::Accounting
|
|
|
129
129
|
# Sum of all credit notes, over-payments and pre-payments applied to invoice
|
|
130
130
|
attr_accessor :amount_credited
|
|
131
131
|
|
|
132
|
-
#
|
|
132
|
+
# UTC timestamp of last update to the invoice
|
|
133
133
|
attr_accessor :updated_date_utc
|
|
134
134
|
|
|
135
|
+
# UTC ISO-8601 formatted timestamp of last update to the invoice
|
|
136
|
+
attr_accessor :updated_date_utc_string
|
|
137
|
+
|
|
135
138
|
# Details of credit notes that have been applied to an invoice
|
|
136
139
|
attr_accessor :credit_notes
|
|
137
140
|
|
|
@@ -212,6 +215,7 @@ module XeroRuby::Accounting
|
|
|
212
215
|
:'fully_paid_on_date' => :'FullyPaidOnDate',
|
|
213
216
|
:'amount_credited' => :'AmountCredited',
|
|
214
217
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
218
|
+
:'updated_date_utc_string' => :'UpdatedDateUTCString',
|
|
215
219
|
:'credit_notes' => :'CreditNotes',
|
|
216
220
|
:'attachments' => :'Attachments',
|
|
217
221
|
:'has_errors' => :'HasErrors',
|
|
@@ -259,6 +263,7 @@ module XeroRuby::Accounting
|
|
|
259
263
|
:'fully_paid_on_date' => :'Date',
|
|
260
264
|
:'amount_credited' => :'BigDecimal',
|
|
261
265
|
:'updated_date_utc' => :'DateTime',
|
|
266
|
+
:'updated_date_utc_string' => :'String',
|
|
262
267
|
:'credit_notes' => :'Array<CreditNote>',
|
|
263
268
|
:'attachments' => :'Array<Attachment>',
|
|
264
269
|
:'has_errors' => :'Boolean',
|
|
@@ -430,6 +435,10 @@ module XeroRuby::Accounting
|
|
|
430
435
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
431
436
|
end
|
|
432
437
|
|
|
438
|
+
if attributes.key?(:'updated_date_utc_string')
|
|
439
|
+
self.updated_date_utc_string = attributes[:'updated_date_utc_string']
|
|
440
|
+
end
|
|
441
|
+
|
|
433
442
|
if attributes.key?(:'credit_notes')
|
|
434
443
|
if (value = attributes[:'credit_notes']).is_a?(Array)
|
|
435
444
|
self.credit_notes = value
|
|
@@ -562,6 +571,7 @@ module XeroRuby::Accounting
|
|
|
562
571
|
fully_paid_on_date == o.fully_paid_on_date &&
|
|
563
572
|
amount_credited == o.amount_credited &&
|
|
564
573
|
updated_date_utc == o.updated_date_utc &&
|
|
574
|
+
updated_date_utc_string == o.updated_date_utc_string &&
|
|
565
575
|
credit_notes == o.credit_notes &&
|
|
566
576
|
attachments == o.attachments &&
|
|
567
577
|
has_errors == o.has_errors &&
|
|
@@ -580,7 +590,7 @@ module XeroRuby::Accounting
|
|
|
580
590
|
# Calculates hash code according to all attributes.
|
|
581
591
|
# @return [Integer] Hash code
|
|
582
592
|
def hash
|
|
583
|
-
[type, contact, line_items, date, due_date, line_amount_types, invoice_number, reference, branding_theme_id, url, currency_code, currency_rate, status, sent_to_contact, expected_payment_date, planned_payment_date, cis_deduction, cis_rate, sub_total, total_tax, total, total_discount, invoice_id, repeating_invoice_id, has_attachments, is_discounted, payments, prepayments, overpayments, amount_due, amount_paid, fully_paid_on_date, amount_credited, updated_date_utc, credit_notes, attachments, has_errors, status_attribute_string, validation_errors, warnings, invoice_addresses].hash
|
|
593
|
+
[type, contact, line_items, date, due_date, line_amount_types, invoice_number, reference, branding_theme_id, url, currency_code, currency_rate, status, sent_to_contact, expected_payment_date, planned_payment_date, cis_deduction, cis_rate, sub_total, total_tax, total, total_discount, invoice_id, repeating_invoice_id, has_attachments, is_discounted, payments, prepayments, overpayments, amount_due, amount_paid, fully_paid_on_date, amount_credited, updated_date_utc, updated_date_utc_string, credit_notes, attachments, has_errors, status_attribute_string, validation_errors, warnings, invoice_addresses].hash
|
|
584
594
|
end
|
|
585
595
|
|
|
586
596
|
# Builds the object from hash
|
|
@@ -193,6 +193,7 @@ module XeroRuby::Accounting
|
|
|
193
193
|
COMPREHENSIVE ||= "COMPREHENSIVE".freeze
|
|
194
194
|
SIMPLE ||= "SIMPLE".freeze
|
|
195
195
|
BASICLITE ||= "BASICLITE".freeze
|
|
196
|
+
ULTRA ||= "ULTRA".freeze
|
|
196
197
|
|
|
197
198
|
# BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)
|
|
198
199
|
attr_accessor :edition
|
|
@@ -488,7 +489,7 @@ module XeroRuby::Accounting
|
|
|
488
489
|
return false unless sales_tax_period_validator.valid?(@sales_tax_period)
|
|
489
490
|
organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
|
|
490
491
|
return false unless organisation_entity_type_validator.valid?(@organisation_entity_type)
|
|
491
|
-
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE"])
|
|
492
|
+
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE", "ULTRA"])
|
|
492
493
|
return false unless _class_validator.valid?(@_class)
|
|
493
494
|
edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"])
|
|
494
495
|
return false unless edition_validator.valid?(@edition)
|
|
@@ -548,7 +549,7 @@ module XeroRuby::Accounting
|
|
|
548
549
|
# Custom attribute writer method checking allowed values (enum).
|
|
549
550
|
# @param [Object] _class Object to be assigned
|
|
550
551
|
def _class=(_class)
|
|
551
|
-
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE"])
|
|
552
|
+
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE", "ULTRA"])
|
|
552
553
|
unless validator.valid?(_class)
|
|
553
554
|
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
|
|
554
555
|
end
|
|
@@ -52,6 +52,9 @@ module XeroRuby::Accounting
|
|
|
52
52
|
# UTC timestamp of last update to the overpayment
|
|
53
53
|
attr_accessor :updated_date_utc
|
|
54
54
|
|
|
55
|
+
# UTC ISO-8601 formatted timestamp of last update to the overpayment
|
|
56
|
+
attr_accessor :updated_date_utc_string
|
|
57
|
+
|
|
55
58
|
|
|
56
59
|
attr_accessor :currency_code
|
|
57
60
|
|
|
@@ -117,6 +120,7 @@ module XeroRuby::Accounting
|
|
|
117
120
|
:'total_tax' => :'TotalTax',
|
|
118
121
|
:'total' => :'Total',
|
|
119
122
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
123
|
+
:'updated_date_utc_string' => :'UpdatedDateUTCString',
|
|
120
124
|
:'currency_code' => :'CurrencyCode',
|
|
121
125
|
:'overpayment_id' => :'OverpaymentID',
|
|
122
126
|
:'currency_rate' => :'CurrencyRate',
|
|
@@ -143,6 +147,7 @@ module XeroRuby::Accounting
|
|
|
143
147
|
:'total_tax' => :'BigDecimal',
|
|
144
148
|
:'total' => :'BigDecimal',
|
|
145
149
|
:'updated_date_utc' => :'DateTime',
|
|
150
|
+
:'updated_date_utc_string' => :'String',
|
|
146
151
|
:'currency_code' => :'CurrencyCode',
|
|
147
152
|
:'overpayment_id' => :'String',
|
|
148
153
|
:'currency_rate' => :'BigDecimal',
|
|
@@ -213,6 +218,10 @@ module XeroRuby::Accounting
|
|
|
213
218
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
214
219
|
end
|
|
215
220
|
|
|
221
|
+
if attributes.key?(:'updated_date_utc_string')
|
|
222
|
+
self.updated_date_utc_string = attributes[:'updated_date_utc_string']
|
|
223
|
+
end
|
|
224
|
+
|
|
216
225
|
if attributes.key?(:'currency_code')
|
|
217
226
|
self.currency_code = attributes[:'currency_code']
|
|
218
227
|
end
|
|
@@ -314,6 +323,7 @@ module XeroRuby::Accounting
|
|
|
314
323
|
total_tax == o.total_tax &&
|
|
315
324
|
total == o.total &&
|
|
316
325
|
updated_date_utc == o.updated_date_utc &&
|
|
326
|
+
updated_date_utc_string == o.updated_date_utc_string &&
|
|
317
327
|
currency_code == o.currency_code &&
|
|
318
328
|
overpayment_id == o.overpayment_id &&
|
|
319
329
|
currency_rate == o.currency_rate &&
|
|
@@ -335,7 +345,7 @@ module XeroRuby::Accounting
|
|
|
335
345
|
# Calculates hash code according to all attributes.
|
|
336
346
|
# @return [Integer] Hash code
|
|
337
347
|
def hash
|
|
338
|
-
[type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, reference, attachments].hash
|
|
348
|
+
[type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, updated_date_utc_string, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, reference, attachments].hash
|
|
339
349
|
end
|
|
340
350
|
|
|
341
351
|
# Builds the object from hash
|