xero-ruby 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xero-ruby/api/finance_api.rb +866 -0
  3. data/lib/xero-ruby/api_client.rb +11 -0
  4. data/lib/xero-ruby/configuration.rb +2 -0
  5. data/lib/xero-ruby/models/accounting/contact.rb +86 -1
  6. data/lib/xero-ruby/models/finance/account_usage.rb +342 -0
  7. data/lib/xero-ruby/models/finance/account_usage_response.rb +254 -0
  8. data/lib/xero-ruby/models/finance/balance_sheet_account_detail.rb +262 -0
  9. data/lib/xero-ruby/models/finance/balance_sheet_account_group.rb +234 -0
  10. data/lib/xero-ruby/models/finance/balance_sheet_account_type.rb +244 -0
  11. data/lib/xero-ruby/models/finance/balance_sheet_response.rb +252 -0
  12. data/lib/xero-ruby/models/finance/bank_statement_response.rb +232 -0
  13. data/lib/xero-ruby/models/finance/cash_account_response.rb +262 -0
  14. data/lib/xero-ruby/models/finance/cash_balance.rb +242 -0
  15. data/lib/xero-ruby/models/finance/cash_validation_response.rb +262 -0
  16. data/lib/xero-ruby/models/finance/cashflow_account.rb +282 -0
  17. data/lib/xero-ruby/models/finance/cashflow_activity.rb +244 -0
  18. data/lib/xero-ruby/models/finance/cashflow_response.rb +254 -0
  19. data/lib/xero-ruby/models/finance/cashflow_type.rb +244 -0
  20. data/lib/xero-ruby/models/finance/contact_detail.rb +274 -0
  21. data/lib/xero-ruby/models/finance/contact_total_detail.rb +242 -0
  22. data/lib/xero-ruby/models/finance/contact_total_other.rb +252 -0
  23. data/lib/xero-ruby/models/finance/current_statement_response.rb +272 -0
  24. data/lib/xero-ruby/models/finance/data_source_response.rb +362 -0
  25. data/lib/xero-ruby/models/finance/history_record_response.rb +262 -0
  26. data/lib/xero-ruby/models/finance/income_by_contact_response.rb +284 -0
  27. data/lib/xero-ruby/models/finance/lock_history_model.rb +242 -0
  28. data/lib/xero-ruby/models/finance/lock_history_response.rb +244 -0
  29. data/lib/xero-ruby/models/finance/manual_journal_total.rb +222 -0
  30. data/lib/xero-ruby/models/finance/pnl_account.rb +272 -0
  31. data/lib/xero-ruby/models/finance/pnl_account_class.rb +234 -0
  32. data/lib/xero-ruby/models/finance/pnl_account_type.rb +244 -0
  33. data/lib/xero-ruby/models/finance/practice_response.rb +262 -0
  34. data/lib/xero-ruby/models/finance/problem.rb +252 -0
  35. data/lib/xero-ruby/models/finance/problem_type.rb +39 -0
  36. data/lib/xero-ruby/models/finance/profit_and_loss_response.rb +262 -0
  37. data/lib/xero-ruby/models/finance/report_history_model.rb +242 -0
  38. data/lib/xero-ruby/models/finance/report_history_response.rb +244 -0
  39. data/lib/xero-ruby/models/finance/statement_balance_response.rb +232 -0
  40. data/lib/xero-ruby/models/finance/statement_lines_response.rb +382 -0
  41. data/lib/xero-ruby/models/finance/total_detail.rb +242 -0
  42. data/lib/xero-ruby/models/finance/total_other.rb +242 -0
  43. data/lib/xero-ruby/models/finance/trial_balance_account.rb +312 -0
  44. data/lib/xero-ruby/models/finance/trial_balance_entry.rb +232 -0
  45. data/lib/xero-ruby/models/finance/trial_balance_movement.rb +252 -0
  46. data/lib/xero-ruby/models/finance/trial_balance_response.rb +244 -0
  47. data/lib/xero-ruby/models/finance/user_activities_response.rb +244 -0
  48. data/lib/xero-ruby/models/finance/user_response.rb +336 -0
  49. data/lib/xero-ruby/version.rb +6 -6
  50. data/lib/xero-ruby.rb +44 -0
  51. data/spec/api_client_spec.rb +3 -0
  52. data/spec/app_store/api/app_store_api_spec.rb +1 -1
  53. data/spec/configuration_spec.rb +1 -0
  54. data/spec/finance/api/finance_api_spec.rb +156 -0
  55. data/spec/finance/models/account_usage_response_spec.rb +58 -0
  56. data/spec/finance/models/account_usage_spec.rb +112 -0
  57. data/spec/finance/models/balance_sheet_account_detail_spec.rb +64 -0
  58. data/spec/finance/models/balance_sheet_account_group_spec.rb +46 -0
  59. data/spec/finance/models/balance_sheet_account_type_spec.rb +52 -0
  60. data/spec/finance/models/balance_sheet_response_spec.rb +58 -0
  61. data/spec/finance/models/bank_statement_response_spec.rb +46 -0
  62. data/spec/finance/models/cash_account_response_spec.rb +64 -0
  63. data/spec/finance/models/cash_balance_spec.rb +52 -0
  64. data/spec/finance/models/cash_validation_response_spec.rb +64 -0
  65. data/spec/finance/models/cashflow_account_spec.rb +76 -0
  66. data/spec/finance/models/cashflow_activity_spec.rb +52 -0
  67. data/spec/finance/models/cashflow_response_spec.rb +58 -0
  68. data/spec/finance/models/cashflow_type_spec.rb +52 -0
  69. data/spec/finance/models/current_statement_response_spec.rb +70 -0
  70. data/spec/finance/models/data_source_response_spec.rb +124 -0
  71. data/spec/finance/models/history_record_response_spec.rb +64 -0
  72. data/spec/finance/models/lock_history_model_spec.rb +52 -0
  73. data/spec/finance/models/lock_history_response_spec.rb +52 -0
  74. data/spec/finance/models/pnl_account_class_spec.rb +46 -0
  75. data/spec/finance/models/pnl_account_spec.rb +70 -0
  76. data/spec/finance/models/pnl_account_type_spec.rb +52 -0
  77. data/spec/finance/models/practice_response_spec.rb +64 -0
  78. data/spec/finance/models/problem_spec.rb +58 -0
  79. data/spec/finance/models/problem_type_spec.rb +34 -0
  80. data/spec/finance/models/profit_and_loss_response_spec.rb +64 -0
  81. data/spec/finance/models/report_history_model_spec.rb +52 -0
  82. data/spec/finance/models/report_history_response_spec.rb +52 -0
  83. data/spec/finance/models/statement_balance_response_spec.rb +46 -0
  84. data/spec/finance/models/statement_lines_response_spec.rb +136 -0
  85. data/spec/finance/models/trial_balance_account_spec.rb +94 -0
  86. data/spec/finance/models/trial_balance_entry_spec.rb +46 -0
  87. data/spec/finance/models/trial_balance_movement_spec.rb +58 -0
  88. data/spec/finance/models/trial_balance_response_spec.rb +52 -0
  89. data/spec/finance/models/user_activities_response_spec.rb +52 -0
  90. data/spec/finance/models/user_response_spec.rb +106 -0
  91. metadata +120 -2
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Xero Finance API
3
+
4
+ #The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
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::Finance
16
+ require 'bigdecimal'
17
+
18
+ class BalanceSheetAccountGroup
19
+
20
+ attr_accessor :account_types
21
+
22
+ # Total value of all the accounts in this type
23
+ attr_accessor :total
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'account_types' => :'accountTypes',
29
+ :'total' => :'total'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'account_types' => :'Array<BalanceSheetAccountType>',
37
+ :'total' => :'BigDecimal'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Finance::BalanceSheetAccountGroup` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Finance::BalanceSheetAccountGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'account_types')
57
+ if (value = attributes[:'account_types']).is_a?(Array)
58
+ self.account_types = value
59
+ end
60
+ end
61
+
62
+ if attributes.key?(:'total')
63
+ self.total = attributes[:'total']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ account_types == o.account_types &&
86
+ total == o.total
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [account_types, total].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(parse_date(value))
136
+ when :Date
137
+ Date.parse(parse_date(value))
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :BigDecimal
145
+ BigDecimal(value.to_s)
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ XeroRuby::Finance.const_get(type).build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash(downcase: false)
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ key = downcase ? attr : param
191
+ hash[key] = _to_hash(value, downcase: downcase)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Returns the object in the form of hash with snake_case
197
+ def to_attributes
198
+ to_hash(downcase: true)
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value, downcase: false)
206
+ if value.is_a?(Array)
207
+ value.map do |v|
208
+ v.to_hash(downcase: downcase)
209
+ end
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash(downcase: downcase)
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ def parse_date(datestring)
222
+ if datestring.include?('Date')
223
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
224
+ original, date, timezone = *date_pattern.match(datestring)
225
+ date = (date.to_i / 1000)
226
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
227
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
228
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
229
+ else # handle date 'types' for small subset of payroll API's
230
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
231
+ end
232
+ end
233
+ end
234
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Xero Finance API
3
+
4
+ #The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
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::Finance
16
+ require 'bigdecimal'
17
+
18
+ class BalanceSheetAccountType
19
+ # The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a>
20
+ attr_accessor :account_type
21
+
22
+ # A list of all accounts of this type. Refer to the Account section below for each account element detail.
23
+ attr_accessor :accounts
24
+
25
+ # Total value of all the accounts in this type
26
+ attr_accessor :total
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'account_type' => :'accountType',
32
+ :'accounts' => :'accounts',
33
+ :'total' => :'total'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'account_type' => :'String',
41
+ :'accounts' => :'Array<BalanceSheetAccountDetail>',
42
+ :'total' => :'BigDecimal'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Finance::BalanceSheetAccountType` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Finance::BalanceSheetAccountType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'account_type')
62
+ self.account_type = attributes[:'account_type']
63
+ end
64
+
65
+ if attributes.key?(:'accounts')
66
+ if (value = attributes[:'accounts']).is_a?(Array)
67
+ self.accounts = value
68
+ end
69
+ end
70
+
71
+ if attributes.key?(:'total')
72
+ self.total = attributes[:'total']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ account_type == o.account_type &&
95
+ accounts == o.accounts &&
96
+ total == o.total
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [account_type, accounts, total].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(parse_date(value))
146
+ when :Date
147
+ Date.parse(parse_date(value))
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BigDecimal
155
+ BigDecimal(value.to_s)
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ XeroRuby::Finance.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash(downcase: false)
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ key = downcase ? attr : param
201
+ hash[key] = _to_hash(value, downcase: downcase)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Returns the object in the form of hash with snake_case
207
+ def to_attributes
208
+ to_hash(downcase: true)
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value, downcase: false)
216
+ if value.is_a?(Array)
217
+ value.map do |v|
218
+ v.to_hash(downcase: downcase)
219
+ end
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash(downcase: downcase)
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ def parse_date(datestring)
232
+ if datestring.include?('Date')
233
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
234
+ original, date, timezone = *date_pattern.match(datestring)
235
+ date = (date.to_i / 1000)
236
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
237
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
238
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
239
+ else # handle date 'types' for small subset of payroll API's
240
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
241
+ end
242
+ end
243
+ end
244
+ end