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.
@@ -80,6 +80,9 @@ module XeroRuby::Accounting
80
80
  # UTC timestamp of last update to the payment
81
81
  attr_accessor :updated_date_utc
82
82
 
83
+ # UTC ISO-8601 formatted timestamp of last update to the payment
84
+ attr_accessor :updated_date_utc_string
85
+
83
86
  # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
84
87
  attr_accessor :payment_id
85
88
 
@@ -153,6 +156,7 @@ module XeroRuby::Accounting
153
156
  :'status' => :'Status',
154
157
  :'payment_type' => :'PaymentType',
155
158
  :'updated_date_utc' => :'UpdatedDateUTC',
159
+ :'updated_date_utc_string' => :'UpdatedDateUTCString',
156
160
  :'payment_id' => :'PaymentID',
157
161
  :'batch_payment_id' => :'BatchPaymentID',
158
162
  :'bank_account_number' => :'BankAccountNumber',
@@ -187,6 +191,7 @@ module XeroRuby::Accounting
187
191
  :'status' => :'String',
188
192
  :'payment_type' => :'String',
189
193
  :'updated_date_utc' => :'DateTime',
194
+ :'updated_date_utc_string' => :'String',
190
195
  :'payment_id' => :'String',
191
196
  :'batch_payment_id' => :'String',
192
197
  :'bank_account_number' => :'String',
@@ -287,6 +292,10 @@ module XeroRuby::Accounting
287
292
  self.updated_date_utc = attributes[:'updated_date_utc']
288
293
  end
289
294
 
295
+ if attributes.key?(:'updated_date_utc_string')
296
+ self.updated_date_utc_string = attributes[:'updated_date_utc_string']
297
+ end
298
+
290
299
  if attributes.key?(:'payment_id')
291
300
  self.payment_id = attributes[:'payment_id']
292
301
  end
@@ -396,6 +405,7 @@ module XeroRuby::Accounting
396
405
  status == o.status &&
397
406
  payment_type == o.payment_type &&
398
407
  updated_date_utc == o.updated_date_utc &&
408
+ updated_date_utc_string == o.updated_date_utc_string &&
399
409
  payment_id == o.payment_id &&
400
410
  batch_payment_id == o.batch_payment_id &&
401
411
  bank_account_number == o.bank_account_number &&
@@ -417,7 +427,7 @@ module XeroRuby::Accounting
417
427
  # Calculates hash code according to all attributes.
418
428
  # @return [Integer] Hash code
419
429
  def hash
420
- [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, batch_payment, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors, warnings].hash
430
+ [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, batch_payment, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, updated_date_utc_string, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors, warnings].hash
421
431
  end
422
432
 
423
433
  # Builds the object from hash
@@ -59,6 +59,9 @@ module XeroRuby::Accounting
59
59
  # UTC timestamp of last update to the prepayment
60
60
  attr_accessor :updated_date_utc
61
61
 
62
+ # UTC ISO-8601 formatted timestamp of last update to the prepayment
63
+ attr_accessor :updated_date_utc_string
64
+
62
65
 
63
66
  attr_accessor :currency_code
64
67
 
@@ -126,6 +129,7 @@ module XeroRuby::Accounting
126
129
  :'reference' => :'Reference',
127
130
  :'invoice_number' => :'InvoiceNumber',
128
131
  :'updated_date_utc' => :'UpdatedDateUTC',
132
+ :'updated_date_utc_string' => :'UpdatedDateUTCString',
129
133
  :'currency_code' => :'CurrencyCode',
130
134
  :'prepayment_id' => :'PrepaymentID',
131
135
  :'branding_theme_id' => :'BrandingThemeID',
@@ -154,6 +158,7 @@ module XeroRuby::Accounting
154
158
  :'reference' => :'String',
155
159
  :'invoice_number' => :'String',
156
160
  :'updated_date_utc' => :'DateTime',
161
+ :'updated_date_utc_string' => :'String',
157
162
  :'currency_code' => :'CurrencyCode',
158
163
  :'prepayment_id' => :'String',
159
164
  :'branding_theme_id' => :'String',
@@ -232,6 +237,10 @@ module XeroRuby::Accounting
232
237
  self.updated_date_utc = attributes[:'updated_date_utc']
233
238
  end
234
239
 
240
+ if attributes.key?(:'updated_date_utc_string')
241
+ self.updated_date_utc_string = attributes[:'updated_date_utc_string']
242
+ end
243
+
235
244
  if attributes.key?(:'currency_code')
236
245
  self.currency_code = attributes[:'currency_code']
237
246
  end
@@ -335,6 +344,7 @@ module XeroRuby::Accounting
335
344
  reference == o.reference &&
336
345
  invoice_number == o.invoice_number &&
337
346
  updated_date_utc == o.updated_date_utc &&
347
+ updated_date_utc_string == o.updated_date_utc_string &&
338
348
  currency_code == o.currency_code &&
339
349
  prepayment_id == o.prepayment_id &&
340
350
  branding_theme_id == o.branding_theme_id &&
@@ -356,7 +366,7 @@ module XeroRuby::Accounting
356
366
  # Calculates hash code according to all attributes.
357
367
  # @return [Integer] Hash code
358
368
  def hash
359
- [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, invoice_number, updated_date_utc, currency_code, prepayment_id, branding_theme_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
369
+ [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, invoice_number, updated_date_utc, updated_date_utc_string, currency_code, prepayment_id, branding_theme_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
360
370
  end
361
371
 
362
372
  # Builds the object from hash
@@ -0,0 +1,277 @@
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 TrackingReference
19
+ # The Xero identifier for a tracking category
20
+ attr_accessor :tracking_category_id
21
+
22
+ # The Xero identifier for a tracking category option
23
+ attr_accessor :tracking_option_id
24
+
25
+ # The name of the tracking category
26
+ attr_accessor :name
27
+
28
+ # See Tracking Options
29
+ attr_accessor :option
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'tracking_category_id' => :'TrackingCategoryID',
35
+ :'tracking_option_id' => :'TrackingOptionID',
36
+ :'name' => :'Name',
37
+ :'option' => :'Option'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'tracking_category_id' => :'String',
45
+ :'tracking_option_id' => :'String',
46
+ :'name' => :'String',
47
+ :'option' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingReference` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'tracking_category_id')
67
+ self.tracking_category_id = attributes[:'tracking_category_id']
68
+ end
69
+
70
+ if attributes.key?(:'tracking_option_id')
71
+ self.tracking_option_id = attributes[:'tracking_option_id']
72
+ end
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'option')
79
+ self.option = attributes[:'option']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @tracking_category_id.nil?
88
+ invalid_properties.push('invalid value for "tracking_category_id", tracking_category_id cannot be nil.')
89
+ end
90
+
91
+ if @tracking_option_id.nil?
92
+ invalid_properties.push('invalid value for "tracking_option_id", tracking_option_id cannot be nil.')
93
+ end
94
+
95
+ if !@name.nil? && @name.to_s.length > 100
96
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @tracking_category_id.nil?
106
+ return false if @tracking_option_id.nil?
107
+ return false if !@name.nil? && @name.to_s.length > 100
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] name Value to be assigned
113
+ def name=(name)
114
+ if !name.nil? && name.to_s.length > 100
115
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
116
+ end
117
+
118
+ @name = name
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ tracking_category_id == o.tracking_category_id &&
127
+ tracking_option_id == o.tracking_option_id &&
128
+ name == o.name &&
129
+ option == o.option
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [tracking_category_id, tracking_option_id, name, option].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.openapi_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(parse_date(value))
179
+ when :Date
180
+ Date.parse(parse_date(value))
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BigDecimal
188
+ BigDecimal(value.to_s)
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ XeroRuby::Accounting.const_get(type).build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash(downcase: false)
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ key = downcase ? attr : param
234
+ hash[key] = _to_hash(value, downcase: downcase)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Returns the object in the form of hash with snake_case
240
+ def to_attributes
241
+ to_hash(downcase: true)
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value, downcase: false)
249
+ if value.is_a?(Array)
250
+ value.map do |v|
251
+ v.to_hash(downcase: downcase)
252
+ end
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash(downcase: downcase)
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ def parse_date(datestring)
265
+ if datestring.include?('Date')
266
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
267
+ original, date, timezone = *date_pattern.match(datestring)
268
+ date = (date.to_i / 1000)
269
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
270
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
271
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
272
+ else # handle date 'types' for small subset of payroll API's
273
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
274
+ end
275
+ end
276
+ end
277
+ end
@@ -34,7 +34,7 @@ module XeroRuby::PayrollAu
34
34
  # Boolean to determine if the earnings rate is reportable or exempt from W1
35
35
  attr_accessor :is_reportable_as_w1
36
36
 
37
- # Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on earnings type and superannuation settings
37
+ # Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations
38
38
  attr_accessor :is_qualifying_earnings
39
39
 
40
40
  # Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT
@@ -245,6 +245,10 @@ module XeroRuby::PayrollAu
245
245
  invalid_properties.push('invalid value for "type_of_units", the character length must be smaller than or equal to 50.')
246
246
  end
247
247
 
248
+ if @is_qualifying_earnings.nil?
249
+ invalid_properties.push('invalid value for "is_qualifying_earnings", is_qualifying_earnings cannot be nil.')
250
+ end
251
+
248
252
  invalid_properties
249
253
  end
250
254
 
@@ -253,6 +257,7 @@ module XeroRuby::PayrollAu
253
257
  def valid?
254
258
  return false if !@name.nil? && @name.to_s.length > 100
255
259
  return false if !@type_of_units.nil? && @type_of_units.to_s.length > 50
260
+ return false if @is_qualifying_earnings.nil?
256
261
  true
257
262
  end
258
263
 
@@ -31,7 +31,7 @@ module XeroRuby::PayrollAu
31
31
  # amount of leave line
32
32
  attr_accessor :include_superannuation_guarantee_contribution
33
33
 
34
- # Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on superannuation settings
34
+ # Boolean to determine if the leave line is considered as qualifying earnings for superannuation guarantee calculations
35
35
  attr_accessor :is_qualifying_earnings
36
36
 
37
37
  # Number of units for leave line.
@@ -129,12 +129,17 @@ module XeroRuby::PayrollAu
129
129
  # @return Array for valid properties with the reasons
130
130
  def list_invalid_properties
131
131
  invalid_properties = Array.new
132
+ if @is_qualifying_earnings.nil?
133
+ invalid_properties.push('invalid value for "is_qualifying_earnings", is_qualifying_earnings cannot be nil.')
134
+ end
135
+
132
136
  invalid_properties
133
137
  end
134
138
 
135
139
  # Check to see if the all the properties in the model are valid
136
140
  # @return true if the model is valid
137
141
  def valid?
142
+ return false if @is_qualifying_earnings.nil?
138
143
  true
139
144
  end
140
145
 
@@ -49,7 +49,7 @@ module XeroRuby::PayrollAu
49
49
  # Set this to indicate that the leave type is exempt from superannuation guarantee contribution
50
50
  attr_accessor :sgc_exempt
51
51
 
52
- # Optional Boolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations. When not specified value is calculated based on earnings type and superannuation settings
52
+ # Boolean to determine if the leave type is considered as qualifying earnings for superannuation guarantee calculations
53
53
  attr_accessor :is_qualifying_earnings
54
54
 
55
55
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -160,6 +160,10 @@ module XeroRuby::PayrollAu
160
160
  invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
161
161
  end
162
162
 
163
+ if @is_qualifying_earnings.nil?
164
+ invalid_properties.push('invalid value for "is_qualifying_earnings", is_qualifying_earnings cannot be nil.')
165
+ end
166
+
163
167
  invalid_properties
164
168
  end
165
169
 
@@ -167,6 +171,7 @@ module XeroRuby::PayrollAu
167
171
  # @return true if the model is valid
168
172
  def valid?
169
173
  return false if !@name.nil? && @name.to_s.length > 100
174
+ return false if @is_qualifying_earnings.nil?
170
175
  true
171
176
  end
172
177
 
@@ -79,7 +79,7 @@ module XeroRuby::PayrollAu
79
79
  # Last modified timestamp
80
80
  attr_accessor :updated_date_utc
81
81
 
82
- # Optional Boolean to determine if leave loading is considered as qualifying earnings for superannuation guarantee calculations
82
+ # Boolean to determine if leave loading is considered as qualifying earnings for superannuation guarantee calculations. Required when IncludeLeaveLoadingInSGC is specified in the payload
83
83
  attr_accessor :include_leave_loading_in_qualifying_earnings
84
84
 
85
85
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -7,9 +7,9 @@ Contact: api@xero.com
7
7
  Generated by: https://openapi-generator.tech
8
8
  OpenAPI Generator version: 4.3.1
9
9
 
10
- The version of the XeroOpenAPI document: 14.0.0
10
+ The version of the XeroOpenAPI document: 16.1.0
11
11
  =end
12
12
 
13
13
  module XeroRuby
14
- VERSION = '16.0.0'
14
+ VERSION = '18.0.0'
15
15
  end
data/lib/xero-ruby.rb CHANGED
@@ -429,7 +429,10 @@ require 'xero-ruby/models/accounting/balances'
429
429
  require 'xero-ruby/models/accounting/bank_transaction'
430
430
  require 'xero-ruby/models/accounting/bank_transactions'
431
431
  require 'xero-ruby/models/accounting/bank_transfer'
432
+ require 'xero-ruby/models/accounting/bank_transfer_delete'
433
+ require 'xero-ruby/models/accounting/bank_transfer_delete_by_url_param'
432
434
  require 'xero-ruby/models/accounting/bank_transfers'
435
+ require 'xero-ruby/models/accounting/bank_transfers_delete'
433
436
  require 'xero-ruby/models/accounting/batch_payment'
434
437
  require 'xero-ruby/models/accounting/batch_payment_delete'
435
438
  require 'xero-ruby/models/accounting/batch_payment_delete_by_url_param'
@@ -544,6 +547,7 @@ require 'xero-ruby/models/accounting/tracking_categories'
544
547
  require 'xero-ruby/models/accounting/tracking_category'
545
548
  require 'xero-ruby/models/accounting/tracking_option'
546
549
  require 'xero-ruby/models/accounting/tracking_options'
550
+ require 'xero-ruby/models/accounting/tracking_reference'
547
551
  require 'xero-ruby/models/accounting/user'
548
552
  require 'xero-ruby/models/accounting/users'
549
553
  require 'xero-ruby/models/accounting/validation_error'