xero-ruby 3.2.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +71 -2
  3. data/lib/xero-ruby/api/accounting_api.rb +11 -2
  4. data/lib/xero-ruby/api/app_store_api.rb +87 -0
  5. data/lib/xero-ruby/api/finance_api.rb +866 -0
  6. data/lib/xero-ruby/api/payroll_au_api.rb +14 -14
  7. data/lib/xero-ruby/api/payroll_nz_api.rb +18 -12
  8. data/lib/xero-ruby/api/payroll_uk_api.rb +14 -2
  9. data/lib/xero-ruby/api_client.rb +30 -4
  10. data/lib/xero-ruby/configuration.rb +4 -0
  11. data/lib/xero-ruby/models/accounting/bank_transfer.rb +35 -1
  12. data/lib/xero-ruby/models/accounting/budget_balance.rb +2 -2
  13. data/lib/xero-ruby/models/accounting/contact.rb +86 -1
  14. data/lib/xero-ruby/models/accounting/payment.rb +11 -1
  15. data/lib/xero-ruby/models/accounting/time_zone.rb +1 -0
  16. data/lib/xero-ruby/models/app_store/plan.rb +310 -0
  17. data/lib/xero-ruby/models/app_store/price.rb +257 -0
  18. data/lib/xero-ruby/models/app_store/problem_details.rb +272 -0
  19. data/lib/xero-ruby/models/app_store/product.rb +288 -0
  20. data/lib/xero-ruby/models/app_store/subscription.rb +324 -0
  21. data/lib/xero-ruby/models/app_store/subscription_item.rb +292 -0
  22. data/lib/xero-ruby/models/finance/account_usage.rb +342 -0
  23. data/lib/xero-ruby/models/finance/account_usage_response.rb +254 -0
  24. data/lib/xero-ruby/models/finance/balance_sheet_account_detail.rb +262 -0
  25. data/lib/xero-ruby/models/finance/balance_sheet_account_group.rb +234 -0
  26. data/lib/xero-ruby/models/finance/balance_sheet_account_type.rb +244 -0
  27. data/lib/xero-ruby/models/finance/balance_sheet_response.rb +252 -0
  28. data/lib/xero-ruby/models/finance/bank_statement_response.rb +232 -0
  29. data/lib/xero-ruby/models/finance/cash_account_response.rb +262 -0
  30. data/lib/xero-ruby/models/finance/cash_balance.rb +242 -0
  31. data/lib/xero-ruby/models/finance/cash_validation_response.rb +262 -0
  32. data/lib/xero-ruby/models/finance/cashflow_account.rb +282 -0
  33. data/lib/xero-ruby/models/finance/cashflow_activity.rb +244 -0
  34. data/lib/xero-ruby/models/finance/cashflow_response.rb +254 -0
  35. data/lib/xero-ruby/models/finance/cashflow_type.rb +244 -0
  36. data/lib/xero-ruby/models/finance/contact_detail.rb +274 -0
  37. data/lib/xero-ruby/models/finance/contact_total_detail.rb +242 -0
  38. data/lib/xero-ruby/models/finance/contact_total_other.rb +252 -0
  39. data/lib/xero-ruby/models/finance/current_statement_response.rb +272 -0
  40. data/lib/xero-ruby/models/finance/data_source_response.rb +362 -0
  41. data/lib/xero-ruby/models/finance/history_record_response.rb +262 -0
  42. data/lib/xero-ruby/models/finance/income_by_contact_response.rb +284 -0
  43. data/lib/xero-ruby/models/finance/lock_history_model.rb +242 -0
  44. data/lib/xero-ruby/models/finance/lock_history_response.rb +244 -0
  45. data/lib/xero-ruby/models/finance/manual_journal_total.rb +222 -0
  46. data/lib/xero-ruby/models/finance/pnl_account.rb +272 -0
  47. data/lib/xero-ruby/models/finance/pnl_account_class.rb +234 -0
  48. data/lib/xero-ruby/models/finance/pnl_account_type.rb +244 -0
  49. data/lib/xero-ruby/models/finance/practice_response.rb +262 -0
  50. data/lib/xero-ruby/models/finance/problem.rb +252 -0
  51. data/lib/xero-ruby/models/finance/problem_type.rb +39 -0
  52. data/lib/xero-ruby/models/finance/profit_and_loss_response.rb +262 -0
  53. data/lib/xero-ruby/models/finance/report_history_model.rb +242 -0
  54. data/lib/xero-ruby/models/finance/report_history_response.rb +244 -0
  55. data/lib/xero-ruby/models/finance/statement_balance_response.rb +232 -0
  56. data/lib/xero-ruby/models/finance/statement_lines_response.rb +382 -0
  57. data/lib/xero-ruby/models/finance/total_detail.rb +242 -0
  58. data/lib/xero-ruby/models/finance/total_other.rb +242 -0
  59. data/lib/xero-ruby/models/finance/trial_balance_account.rb +312 -0
  60. data/lib/xero-ruby/models/finance/trial_balance_entry.rb +232 -0
  61. data/lib/xero-ruby/models/finance/trial_balance_movement.rb +252 -0
  62. data/lib/xero-ruby/models/finance/trial_balance_response.rb +244 -0
  63. data/lib/xero-ruby/models/finance/user_activities_response.rb +244 -0
  64. data/lib/xero-ruby/models/finance/user_response.rb +336 -0
  65. data/lib/xero-ruby/models/payroll_au/earnings_type.rb +2 -0
  66. data/lib/xero-ruby/models/payroll_au/employee.rb +30 -1
  67. data/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +1 -0
  68. data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +11 -1
  69. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +4 -4
  70. data/lib/xero-ruby/version.rb +6 -6
  71. data/lib/xero-ruby.rb +51 -0
  72. data/spec/api_client_spec.rb +5 -2
  73. data/spec/app_store/api/app_store_api_spec.rb +45 -0
  74. data/spec/app_store/models/plan_spec.rb +62 -0
  75. data/spec/app_store/models/price_spec.rb +52 -0
  76. data/spec/app_store/models/problem_details_spec.rb +70 -0
  77. data/spec/app_store/models/product_spec.rb +56 -0
  78. data/spec/app_store/models/subscription_item_spec.rb +70 -0
  79. data/spec/app_store/models/subscription_spec.rb +82 -0
  80. data/spec/configuration_spec.rb +1 -0
  81. data/spec/finance/api/finance_api_spec.rb +156 -0
  82. data/spec/finance/models/account_usage_response_spec.rb +58 -0
  83. data/spec/finance/models/account_usage_spec.rb +112 -0
  84. data/spec/finance/models/balance_sheet_account_detail_spec.rb +64 -0
  85. data/spec/finance/models/balance_sheet_account_group_spec.rb +46 -0
  86. data/spec/finance/models/balance_sheet_account_type_spec.rb +52 -0
  87. data/spec/finance/models/balance_sheet_response_spec.rb +58 -0
  88. data/spec/finance/models/bank_statement_response_spec.rb +46 -0
  89. data/spec/finance/models/cash_account_response_spec.rb +64 -0
  90. data/spec/finance/models/cash_balance_spec.rb +52 -0
  91. data/spec/finance/models/cash_validation_response_spec.rb +64 -0
  92. data/spec/finance/models/cashflow_account_spec.rb +76 -0
  93. data/spec/finance/models/cashflow_activity_spec.rb +52 -0
  94. data/spec/finance/models/cashflow_response_spec.rb +58 -0
  95. data/spec/finance/models/cashflow_type_spec.rb +52 -0
  96. data/spec/finance/models/current_statement_response_spec.rb +70 -0
  97. data/spec/finance/models/data_source_response_spec.rb +124 -0
  98. data/spec/finance/models/history_record_response_spec.rb +64 -0
  99. data/spec/finance/models/lock_history_model_spec.rb +52 -0
  100. data/spec/finance/models/lock_history_response_spec.rb +52 -0
  101. data/spec/finance/models/pnl_account_class_spec.rb +46 -0
  102. data/spec/finance/models/pnl_account_spec.rb +70 -0
  103. data/spec/finance/models/pnl_account_type_spec.rb +52 -0
  104. data/spec/finance/models/practice_response_spec.rb +64 -0
  105. data/spec/finance/models/problem_spec.rb +58 -0
  106. data/spec/finance/models/problem_type_spec.rb +34 -0
  107. data/spec/finance/models/profit_and_loss_response_spec.rb +64 -0
  108. data/spec/finance/models/report_history_model_spec.rb +52 -0
  109. data/spec/finance/models/report_history_response_spec.rb +52 -0
  110. data/spec/finance/models/statement_balance_response_spec.rb +46 -0
  111. data/spec/finance/models/statement_lines_response_spec.rb +136 -0
  112. data/spec/finance/models/trial_balance_account_spec.rb +94 -0
  113. data/spec/finance/models/trial_balance_entry_spec.rb +46 -0
  114. data/spec/finance/models/trial_balance_movement_spec.rb +58 -0
  115. data/spec/finance/models/trial_balance_response_spec.rb +52 -0
  116. data/spec/finance/models/user_activities_response_spec.rb +52 -0
  117. data/spec/finance/models/user_response_spec.rb +106 -0
  118. metadata +142 -3
@@ -0,0 +1,866 @@
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
+ module XeroRuby
13
+ class FinanceApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.new)
17
+ @api_client = api_client
18
+ end
19
+ # Get account usage
20
+ # A summary of how each account is being transacted on exposing the level of detail and amounts attributable to manual adjustments.
21
+ # @param xero_tenant_id [String] Xero identifier for Tenant
22
+ # @param [Hash] opts the optional parameters
23
+ # @option opts [String] :start_month date, yyyy-MM If no parameter is provided, the month 12 months prior to the end month will be used. Account usage for up to 12 months from this date will be returned.
24
+ # @option opts [String] :end_month date, yyyy-MM If no parameter is provided, the current month will be used. Account usage for up to 12 months prior to this date will be returned.
25
+ # @return [AccountUsageResponse]
26
+ def get_accounting_activity_account_usage(xero_tenant_id, opts = {})
27
+ data, _status_code, _headers = get_accounting_activity_account_usage_with_http_info(xero_tenant_id, opts)
28
+ data
29
+ end
30
+
31
+ # Get account usage
32
+ # A summary of how each account is being transacted on exposing the level of detail and amounts attributable to manual adjustments.
33
+ # @param xero_tenant_id [String] Xero identifier for Tenant
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :start_month date, yyyy-MM If no parameter is provided, the month 12 months prior to the end month will be used. Account usage for up to 12 months from this date will be returned.
36
+ # @option opts [String] :end_month date, yyyy-MM If no parameter is provided, the current month will be used. Account usage for up to 12 months prior to this date will be returned.
37
+ # @return [Array<(AccountUsageResponse, Integer, Hash)>] AccountUsageResponse data, response status code and response headers
38
+ def get_accounting_activity_account_usage_with_http_info(xero_tenant_id, options = {})
39
+ opts = options.dup
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_accounting_activity_account_usage ...'
42
+ end
43
+ # verify the required parameter 'xero_tenant_id' is set
44
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_accounting_activity_account_usage"
46
+ end
47
+ # resource path
48
+ local_var_path = '/AccountingActivities/AccountUsage'
49
+
50
+ # camelize keys of incoming `where` opts
51
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+ query_params[:'startMonth'] = opts[:'start_month'] if !opts[:'start_month'].nil?
56
+ query_params[:'endMonth'] = opts[:'end_month'] if !opts[:'end_month'].nil?
57
+
58
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
59
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
60
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
61
+
62
+ # header parameters
63
+ header_params = opts[:header_params] || {}
64
+ # HTTP header 'Accept' (if needed)
65
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
66
+ header_params[:'xero-tenant-id'] = xero_tenant_id
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:body]
73
+
74
+ # return_type
75
+ return_type = opts[:return_type] || 'AccountUsageResponse'
76
+
77
+ # auth_names
78
+ auth_names = opts[:auth_names] || ['OAuth2']
79
+
80
+ new_options = opts.merge(
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: FinanceApi#get_accounting_activity_account_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Get lock history
97
+ # Provides a history of locking of accounting books. Locking may be an indicator of good accounting practices that could reduce the risk of changes to accounting records in prior periods.
98
+ # @param xero_tenant_id [String] Xero identifier for Tenant
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [String] :end_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any changes to hard or soft lock dates that were made within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a change is visible from this API.
101
+ # @return [LockHistoryResponse]
102
+ def get_accounting_activity_lock_history(xero_tenant_id, opts = {})
103
+ data, _status_code, _headers = get_accounting_activity_lock_history_with_http_info(xero_tenant_id, opts)
104
+ data
105
+ end
106
+
107
+ # Get lock history
108
+ # Provides a history of locking of accounting books. Locking may be an indicator of good accounting practices that could reduce the risk of changes to accounting records in prior periods.
109
+ # @param xero_tenant_id [String] Xero identifier for Tenant
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :end_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any changes to hard or soft lock dates that were made within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a change is visible from this API.
112
+ # @return [Array<(LockHistoryResponse, Integer, Hash)>] LockHistoryResponse data, response status code and response headers
113
+ def get_accounting_activity_lock_history_with_http_info(xero_tenant_id, options = {})
114
+ opts = options.dup
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_accounting_activity_lock_history ...'
117
+ end
118
+ # verify the required parameter 'xero_tenant_id' is set
119
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
120
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_accounting_activity_lock_history"
121
+ end
122
+ # resource path
123
+ local_var_path = '/AccountingActivities/LockHistory'
124
+
125
+ # camelize keys of incoming `where` opts
126
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
131
+
132
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
133
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
134
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
135
+
136
+ # header parameters
137
+ header_params = opts[:header_params] || {}
138
+ # HTTP header 'Accept' (if needed)
139
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
140
+ header_params[:'xero-tenant-id'] = xero_tenant_id
141
+
142
+ # form parameters
143
+ form_params = opts[:form_params] || {}
144
+
145
+ # http body (model)
146
+ post_body = opts[:body]
147
+
148
+ # return_type
149
+ return_type = opts[:return_type] || 'LockHistoryResponse'
150
+
151
+ # auth_names
152
+ auth_names = opts[:auth_names] || ['OAuth2']
153
+
154
+ new_options = opts.merge(
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: FinanceApi#get_accounting_activity_lock_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
170
+ # Get report history
171
+ # For a specified organisation, provides a summary of all the reports published within a given period, which may be an indicator for good business management and oversight.
172
+ # @param xero_tenant_id [String] Xero identifier for Tenant
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :end_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any reports that were published within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a published report is visible from this API.
175
+ # @return [ReportHistoryResponse]
176
+ def get_accounting_activity_report_history(xero_tenant_id, opts = {})
177
+ data, _status_code, _headers = get_accounting_activity_report_history_with_http_info(xero_tenant_id, opts)
178
+ data
179
+ end
180
+
181
+ # Get report history
182
+ # For a specified organisation, provides a summary of all the reports published within a given period, which may be an indicator for good business management and oversight.
183
+ # @param xero_tenant_id [String] Xero identifier for Tenant
184
+ # @param [Hash] opts the optional parameters
185
+ # @option opts [String] :end_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any reports that were published within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a published report is visible from this API.
186
+ # @return [Array<(ReportHistoryResponse, Integer, Hash)>] ReportHistoryResponse data, response status code and response headers
187
+ def get_accounting_activity_report_history_with_http_info(xero_tenant_id, options = {})
188
+ opts = options.dup
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_accounting_activity_report_history ...'
191
+ end
192
+ # verify the required parameter 'xero_tenant_id' is set
193
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
194
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_accounting_activity_report_history"
195
+ end
196
+ # resource path
197
+ local_var_path = '/AccountingActivities/ReportHistory'
198
+
199
+ # camelize keys of incoming `where` opts
200
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
201
+
202
+ # query parameters
203
+ query_params = opts[:query_params] || {}
204
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
205
+
206
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
207
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
208
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
209
+
210
+ # header parameters
211
+ header_params = opts[:header_params] || {}
212
+ # HTTP header 'Accept' (if needed)
213
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
214
+ header_params[:'xero-tenant-id'] = xero_tenant_id
215
+
216
+ # form parameters
217
+ form_params = opts[:form_params] || {}
218
+
219
+ # http body (model)
220
+ post_body = opts[:body]
221
+
222
+ # return_type
223
+ return_type = opts[:return_type] || 'ReportHistoryResponse'
224
+
225
+ # auth_names
226
+ auth_names = opts[:auth_names] || ['OAuth2']
227
+
228
+ new_options = opts.merge(
229
+ :header_params => header_params,
230
+ :query_params => query_params,
231
+ :form_params => form_params,
232
+ :body => post_body,
233
+ :auth_names => auth_names,
234
+ :return_type => return_type
235
+ )
236
+
237
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug "API called: FinanceApi#get_accounting_activity_report_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
240
+ end
241
+ return data, status_code, headers
242
+ end
243
+
244
+ # Get user activities
245
+ # For a specified organisation, provides a list of all the users registered, and a history of their accounting transactions. Also identifies the existence of an external accounting advisor and the level of interaction.
246
+ # @param xero_tenant_id [String] Xero identifier for Tenant
247
+ # @param [Hash] opts the optional parameters
248
+ # @option opts [String] :data_month date, yyyy-MM The specified month must be complete (in the past); The current month cannot be specified since it is not complete. If no parameter is provided, the month immediately previous to the current month will be used. Any user activities occurring within the specified month will be returned. Please be aware that there may be a delay of up to 3 days before a user activity is visible from this API.
249
+ # @return [UserActivitiesResponse]
250
+ def get_accounting_activity_user_activities(xero_tenant_id, opts = {})
251
+ data, _status_code, _headers = get_accounting_activity_user_activities_with_http_info(xero_tenant_id, opts)
252
+ data
253
+ end
254
+
255
+ # Get user activities
256
+ # For a specified organisation, provides a list of all the users registered, and a history of their accounting transactions. Also identifies the existence of an external accounting advisor and the level of interaction.
257
+ # @param xero_tenant_id [String] Xero identifier for Tenant
258
+ # @param [Hash] opts the optional parameters
259
+ # @option opts [String] :data_month date, yyyy-MM The specified month must be complete (in the past); The current month cannot be specified since it is not complete. If no parameter is provided, the month immediately previous to the current month will be used. Any user activities occurring within the specified month will be returned. Please be aware that there may be a delay of up to 3 days before a user activity is visible from this API.
260
+ # @return [Array<(UserActivitiesResponse, Integer, Hash)>] UserActivitiesResponse data, response status code and response headers
261
+ def get_accounting_activity_user_activities_with_http_info(xero_tenant_id, options = {})
262
+ opts = options.dup
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_accounting_activity_user_activities ...'
265
+ end
266
+ # verify the required parameter 'xero_tenant_id' is set
267
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_accounting_activity_user_activities"
269
+ end
270
+ # resource path
271
+ local_var_path = '/AccountingActivities/UserActivities'
272
+
273
+ # camelize keys of incoming `where` opts
274
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
275
+
276
+ # query parameters
277
+ query_params = opts[:query_params] || {}
278
+ query_params[:'dataMonth'] = opts[:'data_month'] if !opts[:'data_month'].nil?
279
+
280
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
281
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
282
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
283
+
284
+ # header parameters
285
+ header_params = opts[:header_params] || {}
286
+ # HTTP header 'Accept' (if needed)
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
288
+ header_params[:'xero-tenant-id'] = xero_tenant_id
289
+
290
+ # form parameters
291
+ form_params = opts[:form_params] || {}
292
+
293
+ # http body (model)
294
+ post_body = opts[:body]
295
+
296
+ # return_type
297
+ return_type = opts[:return_type] || 'UserActivitiesResponse'
298
+
299
+ # auth_names
300
+ auth_names = opts[:auth_names] || ['OAuth2']
301
+
302
+ new_options = opts.merge(
303
+ :header_params => header_params,
304
+ :query_params => query_params,
305
+ :form_params => form_params,
306
+ :body => post_body,
307
+ :auth_names => auth_names,
308
+ :return_type => return_type
309
+ )
310
+
311
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
312
+ if @api_client.config.debugging
313
+ @api_client.config.logger.debug "API called: FinanceApi#get_accounting_activity_user_activities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
314
+ end
315
+ return data, status_code, headers
316
+ end
317
+
318
+ # Get cash validation
319
+ # Summarizes the total cash position for each account for an org
320
+ # @param xero_tenant_id [String] Xero identifier for Tenant
321
+ # @param [Hash] opts the optional parameters
322
+ # @option opts [String] :balance_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included. The user has discretion as to which accounting period the transaction relates to. The ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified)
323
+ # @option opts [String] :as_at_system_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’. The ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement. Note; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted.
324
+ # @option opts [String] :begin_date date, yyyy-MM-dd If no parameter is provided, the aggregate results will be drawn from the user’s total history. The ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included. The user has discretion as to which accounting period the transaction relates to.
325
+ # @return [Array<CashValidationResponse>]
326
+ def get_cash_validation(xero_tenant_id, opts = {})
327
+ data, _status_code, _headers = get_cash_validation_with_http_info(xero_tenant_id, opts)
328
+ data
329
+ end
330
+
331
+ # Get cash validation
332
+ # Summarizes the total cash position for each account for an org
333
+ # @param xero_tenant_id [String] Xero identifier for Tenant
334
+ # @param [Hash] opts the optional parameters
335
+ # @option opts [String] :balance_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included. The user has discretion as to which accounting period the transaction relates to. The ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified)
336
+ # @option opts [String] :as_at_system_date date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’. The ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement. Note; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted.
337
+ # @option opts [String] :begin_date date, yyyy-MM-dd If no parameter is provided, the aggregate results will be drawn from the user’s total history. The ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included. The user has discretion as to which accounting period the transaction relates to.
338
+ # @return [Array<(Array<CashValidationResponse>, Integer, Hash)>] Array<CashValidationResponse> data, response status code and response headers
339
+ def get_cash_validation_with_http_info(xero_tenant_id, options = {})
340
+ opts = options.dup
341
+ if @api_client.config.debugging
342
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_cash_validation ...'
343
+ end
344
+ # verify the required parameter 'xero_tenant_id' is set
345
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
346
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_cash_validation"
347
+ end
348
+ # resource path
349
+ local_var_path = '/CashValidation'
350
+
351
+ # camelize keys of incoming `where` opts
352
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
353
+
354
+ # query parameters
355
+ query_params = opts[:query_params] || {}
356
+ query_params[:'balanceDate'] = opts[:'balance_date'] if !opts[:'balance_date'].nil?
357
+ query_params[:'asAtSystemDate'] = opts[:'as_at_system_date'] if !opts[:'as_at_system_date'].nil?
358
+ query_params[:'beginDate'] = opts[:'begin_date'] if !opts[:'begin_date'].nil?
359
+
360
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
361
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
362
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
363
+
364
+ # header parameters
365
+ header_params = opts[:header_params] || {}
366
+ # HTTP header 'Accept' (if needed)
367
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
368
+ header_params[:'xero-tenant-id'] = xero_tenant_id
369
+
370
+ # form parameters
371
+ form_params = opts[:form_params] || {}
372
+
373
+ # http body (model)
374
+ post_body = opts[:body]
375
+
376
+ # return_type
377
+ return_type = opts[:return_type] || 'Array<CashValidationResponse>'
378
+
379
+ # auth_names
380
+ auth_names = opts[:auth_names] || ['OAuth2']
381
+
382
+ new_options = opts.merge(
383
+ :header_params => header_params,
384
+ :query_params => query_params,
385
+ :form_params => form_params,
386
+ :body => post_body,
387
+ :auth_names => auth_names,
388
+ :return_type => return_type
389
+ )
390
+
391
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug "API called: FinanceApi#get_cash_validation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
394
+ end
395
+ return data, status_code, headers
396
+ end
397
+
398
+ # Get Balance Sheet report
399
+ # The balance sheet report is a standard financial report which describes the financial position of an organisation at a point in time.
400
+ # @param xero_tenant_id [String] Xero identifier for Tenant
401
+ # @param [Hash] opts the optional parameters
402
+ # @option opts [String] :balance_date Specifies the date for balance sheet report. Format yyyy-MM-dd. If no parameter is provided, the current date will be used.
403
+ # @return [BalanceSheetResponse]
404
+ def get_financial_statement_balance_sheet(xero_tenant_id, opts = {})
405
+ data, _status_code, _headers = get_financial_statement_balance_sheet_with_http_info(xero_tenant_id, opts)
406
+ data
407
+ end
408
+
409
+ # Get Balance Sheet report
410
+ # The balance sheet report is a standard financial report which describes the financial position of an organisation at a point in time.
411
+ # @param xero_tenant_id [String] Xero identifier for Tenant
412
+ # @param [Hash] opts the optional parameters
413
+ # @option opts [String] :balance_date Specifies the date for balance sheet report. Format yyyy-MM-dd. If no parameter is provided, the current date will be used.
414
+ # @return [Array<(BalanceSheetResponse, Integer, Hash)>] BalanceSheetResponse data, response status code and response headers
415
+ def get_financial_statement_balance_sheet_with_http_info(xero_tenant_id, options = {})
416
+ opts = options.dup
417
+ if @api_client.config.debugging
418
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_balance_sheet ...'
419
+ end
420
+ # verify the required parameter 'xero_tenant_id' is set
421
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
422
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_balance_sheet"
423
+ end
424
+ # resource path
425
+ local_var_path = '/FinancialStatements/BalanceSheet'
426
+
427
+ # camelize keys of incoming `where` opts
428
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
429
+
430
+ # query parameters
431
+ query_params = opts[:query_params] || {}
432
+ query_params[:'balanceDate'] = opts[:'balance_date'] if !opts[:'balance_date'].nil?
433
+
434
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
435
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
436
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
437
+
438
+ # header parameters
439
+ header_params = opts[:header_params] || {}
440
+ # HTTP header 'Accept' (if needed)
441
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
442
+ header_params[:'xero-tenant-id'] = xero_tenant_id
443
+
444
+ # form parameters
445
+ form_params = opts[:form_params] || {}
446
+
447
+ # http body (model)
448
+ post_body = opts[:body]
449
+
450
+ # return_type
451
+ return_type = opts[:return_type] || 'BalanceSheetResponse'
452
+
453
+ # auth_names
454
+ auth_names = opts[:auth_names] || ['OAuth2']
455
+
456
+ new_options = opts.merge(
457
+ :header_params => header_params,
458
+ :query_params => query_params,
459
+ :form_params => form_params,
460
+ :body => post_body,
461
+ :auth_names => auth_names,
462
+ :return_type => return_type
463
+ )
464
+
465
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
466
+ if @api_client.config.debugging
467
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_balance_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
468
+ end
469
+ return data, status_code, headers
470
+ end
471
+
472
+ # Get Cash flow report
473
+ # The statement of cash flows - direct method, provides the year to date changes in operating, financing and investing cash flow activities for an organisation. Cashflow statement is not available in US region at this stage.
474
+ # @param xero_tenant_id [String] Xero identifier for Tenant
475
+ # @param [Hash] opts the optional parameters
476
+ # @option opts [String] :start_date Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no parameter is provided, the date of 12 months before the end date will be used.
477
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no parameter is provided, the current date will be used.
478
+ # @return [CashflowResponse]
479
+ def get_financial_statement_cashflow(xero_tenant_id, opts = {})
480
+ data, _status_code, _headers = get_financial_statement_cashflow_with_http_info(xero_tenant_id, opts)
481
+ data
482
+ end
483
+
484
+ # Get Cash flow report
485
+ # The statement of cash flows - direct method, provides the year to date changes in operating, financing and investing cash flow activities for an organisation. Cashflow statement is not available in US region at this stage.
486
+ # @param xero_tenant_id [String] Xero identifier for Tenant
487
+ # @param [Hash] opts the optional parameters
488
+ # @option opts [String] :start_date Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no parameter is provided, the date of 12 months before the end date will be used.
489
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no parameter is provided, the current date will be used.
490
+ # @return [Array<(CashflowResponse, Integer, Hash)>] CashflowResponse data, response status code and response headers
491
+ def get_financial_statement_cashflow_with_http_info(xero_tenant_id, options = {})
492
+ opts = options.dup
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_cashflow ...'
495
+ end
496
+ # verify the required parameter 'xero_tenant_id' is set
497
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
498
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_cashflow"
499
+ end
500
+ # resource path
501
+ local_var_path = '/FinancialStatements/Cashflow'
502
+
503
+ # camelize keys of incoming `where` opts
504
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
505
+
506
+ # query parameters
507
+ query_params = opts[:query_params] || {}
508
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
509
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
510
+
511
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
512
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
513
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
514
+
515
+ # header parameters
516
+ header_params = opts[:header_params] || {}
517
+ # HTTP header 'Accept' (if needed)
518
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
519
+ header_params[:'xero-tenant-id'] = xero_tenant_id
520
+
521
+ # form parameters
522
+ form_params = opts[:form_params] || {}
523
+
524
+ # http body (model)
525
+ post_body = opts[:body]
526
+
527
+ # return_type
528
+ return_type = opts[:return_type] || 'CashflowResponse'
529
+
530
+ # auth_names
531
+ auth_names = opts[:auth_names] || ['OAuth2']
532
+
533
+ new_options = opts.merge(
534
+ :header_params => header_params,
535
+ :query_params => query_params,
536
+ :form_params => form_params,
537
+ :body => post_body,
538
+ :auth_names => auth_names,
539
+ :return_type => return_type
540
+ )
541
+
542
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
543
+ if @api_client.config.debugging
544
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_cashflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
545
+ end
546
+ return data, status_code, headers
547
+ end
548
+
549
+ # Get expense by contacts report
550
+ # The expense by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
551
+ # @param xero_tenant_id [String] Xero identifier for Tenant
552
+ # @param [Hash] opts the optional parameters
553
+ # @option opts [Array<String>] :contact_ids Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
554
+ # @option opts [Boolean] :include_manual_journals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included.
555
+ # @option opts [String] :start_date Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
556
+ # @option opts [String] :end_date Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
557
+ # @return [IncomeByContactResponse]
558
+ def get_financial_statement_contacts_expense(xero_tenant_id, opts = {})
559
+ data, _status_code, _headers = get_financial_statement_contacts_expense_with_http_info(xero_tenant_id, opts)
560
+ data
561
+ end
562
+
563
+ # Get expense by contacts report
564
+ # The expense by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
565
+ # @param xero_tenant_id [String] Xero identifier for Tenant
566
+ # @param [Hash] opts the optional parameters
567
+ # @option opts [Array<String>] :contact_ids Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
568
+ # @option opts [Boolean] :include_manual_journals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included.
569
+ # @option opts [String] :start_date Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
570
+ # @option opts [String] :end_date Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
571
+ # @return [Array<(IncomeByContactResponse, Integer, Hash)>] IncomeByContactResponse data, response status code and response headers
572
+ def get_financial_statement_contacts_expense_with_http_info(xero_tenant_id, options = {})
573
+ opts = options.dup
574
+ if @api_client.config.debugging
575
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_contacts_expense ...'
576
+ end
577
+ # verify the required parameter 'xero_tenant_id' is set
578
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
579
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_contacts_expense"
580
+ end
581
+ # resource path
582
+ local_var_path = '/FinancialStatements/contacts/expense'
583
+
584
+ # camelize keys of incoming `where` opts
585
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
586
+
587
+ # query parameters
588
+ query_params = opts[:query_params] || {}
589
+ query_params[:'contactIds'] = @api_client.build_collection_param(opts[:'contact_ids'], :multi) if !opts[:'contact_ids'].nil?
590
+ query_params[:'includeManualJournals'] = opts[:'include_manual_journals'] if !opts[:'include_manual_journals'].nil?
591
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
592
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
593
+
594
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
595
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
596
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
597
+
598
+ # header parameters
599
+ header_params = opts[:header_params] || {}
600
+ # HTTP header 'Accept' (if needed)
601
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
602
+ header_params[:'xero-tenant-id'] = xero_tenant_id
603
+
604
+ # form parameters
605
+ form_params = opts[:form_params] || {}
606
+
607
+ # http body (model)
608
+ post_body = opts[:body]
609
+
610
+ # return_type
611
+ return_type = opts[:return_type] || 'IncomeByContactResponse'
612
+
613
+ # auth_names
614
+ auth_names = opts[:auth_names] || ['OAuth2']
615
+
616
+ new_options = opts.merge(
617
+ :header_params => header_params,
618
+ :query_params => query_params,
619
+ :form_params => form_params,
620
+ :body => post_body,
621
+ :auth_names => auth_names,
622
+ :return_type => return_type
623
+ )
624
+
625
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
626
+ if @api_client.config.debugging
627
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_contacts_expense\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
628
+ end
629
+ return data, status_code, headers
630
+ end
631
+
632
+ # Get revenue by contacts report
633
+ # The revenue by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
634
+ # @param xero_tenant_id [String] Xero identifier for Tenant
635
+ # @param [Hash] opts the optional parameters
636
+ # @option opts [Array<String>] :contact_ids Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
637
+ # @option opts [Boolean] :include_manual_journals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included.
638
+ # @option opts [String] :start_date Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
639
+ # @option opts [String] :end_date Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
640
+ # @return [IncomeByContactResponse]
641
+ def get_financial_statement_contacts_revenue(xero_tenant_id, opts = {})
642
+ data, _status_code, _headers = get_financial_statement_contacts_revenue_with_http_info(xero_tenant_id, opts)
643
+ data
644
+ end
645
+
646
+ # Get revenue by contacts report
647
+ # The revenue by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
648
+ # @param xero_tenant_id [String] Xero identifier for Tenant
649
+ # @param [Hash] opts the optional parameters
650
+ # @option opts [Array<String>] :contact_ids Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
651
+ # @option opts [Boolean] :include_manual_journals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included.
652
+ # @option opts [String] :start_date Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
653
+ # @option opts [String] :end_date Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency.
654
+ # @return [Array<(IncomeByContactResponse, Integer, Hash)>] IncomeByContactResponse data, response status code and response headers
655
+ def get_financial_statement_contacts_revenue_with_http_info(xero_tenant_id, options = {})
656
+ opts = options.dup
657
+ if @api_client.config.debugging
658
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_contacts_revenue ...'
659
+ end
660
+ # verify the required parameter 'xero_tenant_id' is set
661
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
662
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_contacts_revenue"
663
+ end
664
+ # resource path
665
+ local_var_path = '/FinancialStatements/contacts/revenue'
666
+
667
+ # camelize keys of incoming `where` opts
668
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
669
+
670
+ # query parameters
671
+ query_params = opts[:query_params] || {}
672
+ query_params[:'contactIds'] = @api_client.build_collection_param(opts[:'contact_ids'], :multi) if !opts[:'contact_ids'].nil?
673
+ query_params[:'includeManualJournals'] = opts[:'include_manual_journals'] if !opts[:'include_manual_journals'].nil?
674
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
675
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
676
+
677
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
678
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
679
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
680
+
681
+ # header parameters
682
+ header_params = opts[:header_params] || {}
683
+ # HTTP header 'Accept' (if needed)
684
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
685
+ header_params[:'xero-tenant-id'] = xero_tenant_id
686
+
687
+ # form parameters
688
+ form_params = opts[:form_params] || {}
689
+
690
+ # http body (model)
691
+ post_body = opts[:body]
692
+
693
+ # return_type
694
+ return_type = opts[:return_type] || 'IncomeByContactResponse'
695
+
696
+ # auth_names
697
+ auth_names = opts[:auth_names] || ['OAuth2']
698
+
699
+ new_options = opts.merge(
700
+ :header_params => header_params,
701
+ :query_params => query_params,
702
+ :form_params => form_params,
703
+ :body => post_body,
704
+ :auth_names => auth_names,
705
+ :return_type => return_type
706
+ )
707
+
708
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
709
+ if @api_client.config.debugging
710
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_contacts_revenue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
711
+ end
712
+ return data, status_code, headers
713
+ end
714
+
715
+ # Get Profit & Loss report
716
+ # The profit and loss statement is a standard financial report providing detailed year to date income and expense detail for an organisation.
717
+ # @param xero_tenant_id [String] Xero identifier for Tenant
718
+ # @param [Hash] opts the optional parameters
719
+ # @option opts [String] :start_date Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no parameter is provided, the date of 12 months before the end date will be used.
720
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no parameter is provided, the current date will be used.
721
+ # @return [ProfitAndLossResponse]
722
+ def get_financial_statement_profit_and_loss(xero_tenant_id, opts = {})
723
+ data, _status_code, _headers = get_financial_statement_profit_and_loss_with_http_info(xero_tenant_id, opts)
724
+ data
725
+ end
726
+
727
+ # Get Profit &amp; Loss report
728
+ # The profit and loss statement is a standard financial report providing detailed year to date income and expense detail for an organisation.
729
+ # @param xero_tenant_id [String] Xero identifier for Tenant
730
+ # @param [Hash] opts the optional parameters
731
+ # @option opts [String] :start_date Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no parameter is provided, the date of 12 months before the end date will be used.
732
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no parameter is provided, the current date will be used.
733
+ # @return [Array<(ProfitAndLossResponse, Integer, Hash)>] ProfitAndLossResponse data, response status code and response headers
734
+ def get_financial_statement_profit_and_loss_with_http_info(xero_tenant_id, options = {})
735
+ opts = options.dup
736
+ if @api_client.config.debugging
737
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_profit_and_loss ...'
738
+ end
739
+ # verify the required parameter 'xero_tenant_id' is set
740
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
741
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_profit_and_loss"
742
+ end
743
+ # resource path
744
+ local_var_path = '/FinancialStatements/ProfitAndLoss'
745
+
746
+ # camelize keys of incoming `where` opts
747
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
748
+
749
+ # query parameters
750
+ query_params = opts[:query_params] || {}
751
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
752
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
753
+
754
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
755
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
756
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
757
+
758
+ # header parameters
759
+ header_params = opts[:header_params] || {}
760
+ # HTTP header 'Accept' (if needed)
761
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
762
+ header_params[:'xero-tenant-id'] = xero_tenant_id
763
+
764
+ # form parameters
765
+ form_params = opts[:form_params] || {}
766
+
767
+ # http body (model)
768
+ post_body = opts[:body]
769
+
770
+ # return_type
771
+ return_type = opts[:return_type] || 'ProfitAndLossResponse'
772
+
773
+ # auth_names
774
+ auth_names = opts[:auth_names] || ['OAuth2']
775
+
776
+ new_options = opts.merge(
777
+ :header_params => header_params,
778
+ :query_params => query_params,
779
+ :form_params => form_params,
780
+ :body => post_body,
781
+ :auth_names => auth_names,
782
+ :return_type => return_type
783
+ )
784
+
785
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
786
+ if @api_client.config.debugging
787
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_profit_and_loss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
788
+ end
789
+ return data, status_code, headers
790
+ end
791
+
792
+ # Get Trial Balance report
793
+ # The trial balance provides a detailed list of all accounts of an organisation at a point in time, with revenue and expense items being year to date.
794
+ # @param xero_tenant_id [String] Xero identifier for Tenant
795
+ # @param [Hash] opts the optional parameters
796
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no parameter is provided, the current date will be used.
797
+ # @return [TrialBalanceResponse]
798
+ def get_financial_statement_trial_balance(xero_tenant_id, opts = {})
799
+ data, _status_code, _headers = get_financial_statement_trial_balance_with_http_info(xero_tenant_id, opts)
800
+ data
801
+ end
802
+
803
+ # Get Trial Balance report
804
+ # The trial balance provides a detailed list of all accounts of an organisation at a point in time, with revenue and expense items being year to date.
805
+ # @param xero_tenant_id [String] Xero identifier for Tenant
806
+ # @param [Hash] opts the optional parameters
807
+ # @option opts [String] :end_date Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no parameter is provided, the current date will be used.
808
+ # @return [Array<(TrialBalanceResponse, Integer, Hash)>] TrialBalanceResponse data, response status code and response headers
809
+ def get_financial_statement_trial_balance_with_http_info(xero_tenant_id, options = {})
810
+ opts = options.dup
811
+ if @api_client.config.debugging
812
+ @api_client.config.logger.debug 'Calling API: FinanceApi.get_financial_statement_trial_balance ...'
813
+ end
814
+ # verify the required parameter 'xero_tenant_id' is set
815
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
816
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_financial_statement_trial_balance"
817
+ end
818
+ # resource path
819
+ local_var_path = '/FinancialStatements/TrialBalance'
820
+
821
+ # camelize keys of incoming `where` opts
822
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
823
+
824
+ # query parameters
825
+ query_params = opts[:query_params] || {}
826
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
827
+
828
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
829
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
830
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
831
+
832
+ # header parameters
833
+ header_params = opts[:header_params] || {}
834
+ # HTTP header 'Accept' (if needed)
835
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
836
+ header_params[:'xero-tenant-id'] = xero_tenant_id
837
+
838
+ # form parameters
839
+ form_params = opts[:form_params] || {}
840
+
841
+ # http body (model)
842
+ post_body = opts[:body]
843
+
844
+ # return_type
845
+ return_type = opts[:return_type] || 'TrialBalanceResponse'
846
+
847
+ # auth_names
848
+ auth_names = opts[:auth_names] || ['OAuth2']
849
+
850
+ new_options = opts.merge(
851
+ :header_params => header_params,
852
+ :query_params => query_params,
853
+ :form_params => form_params,
854
+ :body => post_body,
855
+ :auth_names => auth_names,
856
+ :return_type => return_type
857
+ )
858
+
859
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FinanceApi", new_options)
860
+ if @api_client.config.debugging
861
+ @api_client.config.logger.debug "API called: FinanceApi#get_financial_statement_trial_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
862
+ end
863
+ return data, status_code, headers
864
+ end
865
+ end
866
+ end