xero-ruby 3.1.4 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +257 -222
- data/lib/xero-ruby/api/accounting_api.rb +11 -2
- data/lib/xero-ruby/api/app_store_api.rb +87 -0
- data/lib/xero-ruby/api/payroll_au_api.rb +14 -14
- data/lib/xero-ruby/api/payroll_nz_api.rb +18 -12
- data/lib/xero-ruby/api/payroll_uk_api.rb +14 -2
- data/lib/xero-ruby/api_client.rb +35 -6
- data/lib/xero-ruby/configuration.rb +2 -0
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +35 -1
- data/lib/xero-ruby/models/accounting/budget_balance.rb +2 -2
- data/lib/xero-ruby/models/accounting/payment.rb +11 -1
- data/lib/xero-ruby/models/accounting/time_zone.rb +1 -0
- data/lib/xero-ruby/models/app_store/plan.rb +310 -0
- data/lib/xero-ruby/models/app_store/price.rb +257 -0
- data/lib/xero-ruby/models/app_store/problem_details.rb +272 -0
- data/lib/xero-ruby/models/app_store/product.rb +288 -0
- data/lib/xero-ruby/models/app_store/subscription.rb +324 -0
- data/lib/xero-ruby/models/app_store/subscription_item.rb +292 -0
- data/lib/xero-ruby/models/payroll_au/earnings_type.rb +2 -0
- data/lib/xero-ruby/models/payroll_au/employee.rb +30 -1
- data/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +1 -0
- data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +11 -1
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +4 -4
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +7 -0
- data/spec/api_client_spec.rb +25 -2
- data/spec/app_store/api/app_store_api_spec.rb +45 -0
- data/spec/app_store/models/plan_spec.rb +62 -0
- data/spec/app_store/models/price_spec.rb +52 -0
- data/spec/app_store/models/problem_details_spec.rb +70 -0
- data/spec/app_store/models/product_spec.rb +56 -0
- data/spec/app_store/models/subscription_item_spec.rb +70 -0
- data/spec/app_store/models/subscription_spec.rb +82 -0
- metadata +24 -3
@@ -7018,20 +7018,24 @@ module XeroRuby
|
|
7018
7018
|
return data, status_code, headers
|
7019
7019
|
end
|
7020
7020
|
|
7021
|
-
# Retrieves a specific
|
7021
|
+
# Retrieves a specific budget, which includes budget lines
|
7022
7022
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
7023
7023
|
# @param budget_id [String] Unique identifier for Budgets
|
7024
7024
|
# @param [Hash] opts the optional parameters
|
7025
|
+
# @option opts [Date] :date_to Filter by start date
|
7026
|
+
# @option opts [Date] :date_from Filter by end date
|
7025
7027
|
# @return [Budgets]
|
7026
7028
|
def get_budget(xero_tenant_id, budget_id, opts = {})
|
7027
7029
|
data, _status_code, _headers = get_budget_with_http_info(xero_tenant_id, budget_id, opts)
|
7028
7030
|
data
|
7029
7031
|
end
|
7030
7032
|
|
7031
|
-
# Retrieves a specific
|
7033
|
+
# Retrieves a specific budget, which includes budget lines
|
7032
7034
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
7033
7035
|
# @param budget_id [String] Unique identifier for Budgets
|
7034
7036
|
# @param [Hash] opts the optional parameters
|
7037
|
+
# @option opts [Date] :date_to Filter by start date
|
7038
|
+
# @option opts [Date] :date_from Filter by end date
|
7035
7039
|
# @return [Array<(Budgets, Integer, Hash)>] Budgets data, response status code and response headers
|
7036
7040
|
def get_budget_with_http_info(xero_tenant_id, budget_id, options = {})
|
7037
7041
|
opts = options.dup
|
@@ -7054,6 +7058,8 @@ module XeroRuby
|
|
7054
7058
|
|
7055
7059
|
# query parameters
|
7056
7060
|
query_params = opts[:query_params] || {}
|
7061
|
+
query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
|
7062
|
+
query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
|
7057
7063
|
|
7058
7064
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
7059
7065
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
@@ -7882,6 +7888,7 @@ module XeroRuby
|
|
7882
7888
|
# @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call.
|
7883
7889
|
# @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
|
7884
7890
|
# @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (default to false)
|
7891
|
+
# @option opts [String] :search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields.
|
7885
7892
|
# @return [Contacts]
|
7886
7893
|
def get_contacts(xero_tenant_id, opts = {})
|
7887
7894
|
data, _status_code, _headers = get_contacts_with_http_info(xero_tenant_id, opts)
|
@@ -7898,6 +7905,7 @@ module XeroRuby
|
|
7898
7905
|
# @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call.
|
7899
7906
|
# @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
|
7900
7907
|
# @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
|
7908
|
+
# @option opts [String] :search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields.
|
7901
7909
|
# @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
|
7902
7910
|
def get_contacts_with_http_info(xero_tenant_id, options = {})
|
7903
7911
|
opts = options.dup
|
@@ -7922,6 +7930,7 @@ module XeroRuby
|
|
7922
7930
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
7923
7931
|
query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
|
7924
7932
|
query_params[:'summaryOnly'] = opts[:'summary_only'] if !opts[:'summary_only'].nil?
|
7933
|
+
query_params[:'searchTerm'] = opts[:'search_term'] if !opts[:'search_term'].nil?
|
7925
7934
|
|
7926
7935
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
7927
7936
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
@@ -0,0 +1,87 @@
|
|
1
|
+
=begin
|
2
|
+
#Xero AppStore API
|
3
|
+
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
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 AppStoreApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.new)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Retrieves a subscription for a given subscriptionId
|
20
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
21
|
+
# @param [Hash] opts the optional parameters
|
22
|
+
# @return [Subscription]
|
23
|
+
def get_subscription(subscription_id, opts = {})
|
24
|
+
data, _status_code, _headers = get_subscription_with_http_info(subscription_id, opts)
|
25
|
+
data
|
26
|
+
end
|
27
|
+
|
28
|
+
# Retrieves a subscription for a given subscriptionId
|
29
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @return [Array<(Subscription, Integer, Hash)>] Subscription data, response status code and response headers
|
32
|
+
def get_subscription_with_http_info(subscription_id, options = {})
|
33
|
+
opts = options.dup
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: AppStoreApi.get_subscription ...'
|
36
|
+
end
|
37
|
+
# verify the required parameter 'subscription_id' is set
|
38
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
39
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.get_subscription"
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/subscriptions/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)
|
43
|
+
|
44
|
+
# camelize keys of incoming `where` opts
|
45
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
46
|
+
|
47
|
+
# query parameters
|
48
|
+
query_params = opts[:query_params] || {}
|
49
|
+
|
50
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
51
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
52
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
53
|
+
|
54
|
+
# header parameters
|
55
|
+
header_params = opts[:header_params] || {}
|
56
|
+
# HTTP header 'Accept' (if needed)
|
57
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
58
|
+
|
59
|
+
# form parameters
|
60
|
+
form_params = opts[:form_params] || {}
|
61
|
+
|
62
|
+
# http body (model)
|
63
|
+
post_body = opts[:body]
|
64
|
+
|
65
|
+
# return_type
|
66
|
+
return_type = opts[:return_type] || 'Subscription'
|
67
|
+
|
68
|
+
# auth_names
|
69
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
70
|
+
|
71
|
+
new_options = opts.merge(
|
72
|
+
:header_params => header_params,
|
73
|
+
:query_params => query_params,
|
74
|
+
:form_params => form_params,
|
75
|
+
:body => post_body,
|
76
|
+
:auth_names => auth_names,
|
77
|
+
:return_type => return_type
|
78
|
+
)
|
79
|
+
|
80
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AppStoreApi", new_options)
|
81
|
+
if @api_client.config.debugging
|
82
|
+
@api_client.config.logger.debug "API called: AppStoreApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
|
+
end
|
84
|
+
return data, status_code, headers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -633,7 +633,7 @@ module XeroRuby
|
|
633
633
|
# Searches payroll employees
|
634
634
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
635
635
|
# @param [Hash] opts the optional parameters
|
636
|
-
# @option opts [
|
636
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
637
637
|
# @option opts [String] :where Filter by an any element
|
638
638
|
# @option opts [String] :order Order by an any element
|
639
639
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 employees will be returned in a single API call
|
@@ -646,7 +646,7 @@ module XeroRuby
|
|
646
646
|
# Searches payroll employees
|
647
647
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
648
648
|
# @param [Hash] opts the optional parameters
|
649
|
-
# @option opts [
|
649
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
650
650
|
# @option opts [String] :where Filter by an any element
|
651
651
|
# @option opts [String] :order Order by an any element
|
652
652
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 employees will be returned in a single API call
|
@@ -789,7 +789,7 @@ module XeroRuby
|
|
789
789
|
# Retrieves leave applications
|
790
790
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
791
791
|
# @param [Hash] opts the optional parameters
|
792
|
-
# @option opts [
|
792
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
793
793
|
# @option opts [String] :where Filter by an any element
|
794
794
|
# @option opts [String] :order Order by an any element
|
795
795
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -802,7 +802,7 @@ module XeroRuby
|
|
802
802
|
# Retrieves leave applications
|
803
803
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
804
804
|
# @param [Hash] opts the optional parameters
|
805
|
-
# @option opts [
|
805
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
806
806
|
# @option opts [String] :where Filter by an any element
|
807
807
|
# @option opts [String] :order Order by an any element
|
808
808
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -870,7 +870,7 @@ module XeroRuby
|
|
870
870
|
# Retrieves pay items
|
871
871
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
872
872
|
# @param [Hash] opts the optional parameters
|
873
|
-
# @option opts [
|
873
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
874
874
|
# @option opts [String] :where Filter by an any element
|
875
875
|
# @option opts [String] :order Order by an any element
|
876
876
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -883,7 +883,7 @@ module XeroRuby
|
|
883
883
|
# Retrieves pay items
|
884
884
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
885
885
|
# @param [Hash] opts the optional parameters
|
886
|
-
# @option opts [
|
886
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
887
887
|
# @option opts [String] :where Filter by an any element
|
888
888
|
# @option opts [String] :order Order by an any element
|
889
889
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -1026,7 +1026,7 @@ module XeroRuby
|
|
1026
1026
|
# Retrieves pay runs
|
1027
1027
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1028
1028
|
# @param [Hash] opts the optional parameters
|
1029
|
-
# @option opts [
|
1029
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1030
1030
|
# @option opts [String] :where Filter by an any element
|
1031
1031
|
# @option opts [String] :order Order by an any element
|
1032
1032
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call
|
@@ -1039,7 +1039,7 @@ module XeroRuby
|
|
1039
1039
|
# Retrieves pay runs
|
1040
1040
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1041
1041
|
# @param [Hash] opts the optional parameters
|
1042
|
-
# @option opts [
|
1042
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1043
1043
|
# @option opts [String] :where Filter by an any element
|
1044
1044
|
# @option opts [String] :order Order by an any element
|
1045
1045
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call
|
@@ -1182,7 +1182,7 @@ module XeroRuby
|
|
1182
1182
|
# Retrieves payroll calendars
|
1183
1183
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1184
1184
|
# @param [Hash] opts the optional parameters
|
1185
|
-
# @option opts [
|
1185
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1186
1186
|
# @option opts [String] :where Filter by an any element
|
1187
1187
|
# @option opts [String] :order Order by an any element
|
1188
1188
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -1195,7 +1195,7 @@ module XeroRuby
|
|
1195
1195
|
# Retrieves payroll calendars
|
1196
1196
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1197
1197
|
# @param [Hash] opts the optional parameters
|
1198
|
-
# @option opts [
|
1198
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1199
1199
|
# @option opts [String] :where Filter by an any element
|
1200
1200
|
# @option opts [String] :order Order by an any element
|
1201
1201
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call
|
@@ -1557,7 +1557,7 @@ module XeroRuby
|
|
1557
1557
|
# Retrieves superfunds
|
1558
1558
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1559
1559
|
# @param [Hash] opts the optional parameters
|
1560
|
-
# @option opts [
|
1560
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1561
1561
|
# @option opts [String] :where Filter by an any element
|
1562
1562
|
# @option opts [String] :order Order by an any element
|
1563
1563
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call
|
@@ -1570,7 +1570,7 @@ module XeroRuby
|
|
1570
1570
|
# Retrieves superfunds
|
1571
1571
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1572
1572
|
# @param [Hash] opts the optional parameters
|
1573
|
-
# @option opts [
|
1573
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1574
1574
|
# @option opts [String] :where Filter by an any element
|
1575
1575
|
# @option opts [String] :order Order by an any element
|
1576
1576
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call
|
@@ -1713,7 +1713,7 @@ module XeroRuby
|
|
1713
1713
|
# Retrieves timesheets
|
1714
1714
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1715
1715
|
# @param [Hash] opts the optional parameters
|
1716
|
-
# @option opts [
|
1716
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1717
1717
|
# @option opts [String] :where Filter by an any element
|
1718
1718
|
# @option opts [String] :order Order by an any element
|
1719
1719
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 timesheets will be returned in a single API call
|
@@ -1726,7 +1726,7 @@ module XeroRuby
|
|
1726
1726
|
# Retrieves timesheets
|
1727
1727
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1728
1728
|
# @param [Hash] opts the optional parameters
|
1729
|
-
# @option opts [
|
1729
|
+
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
1730
1730
|
# @option opts [String] :where Filter by an any element
|
1731
1731
|
# @option opts [String] :order Order by an any element
|
1732
1732
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 timesheets will be returned in a single API call
|
@@ -3150,8 +3150,7 @@ module XeroRuby
|
|
3150
3150
|
# Retrieves employees
|
3151
3151
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
3152
3152
|
# @param [Hash] opts the optional parameters
|
3153
|
-
# @option opts [String] :
|
3154
|
-
# @option opts [String] :last_name Filter by last name
|
3153
|
+
# @option opts [String] :filter Filter by first name and/or lastname
|
3155
3154
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
3156
3155
|
# @return [Employees]
|
3157
3156
|
def get_employees(xero_tenant_id, opts = {})
|
@@ -3162,8 +3161,7 @@ module XeroRuby
|
|
3162
3161
|
# Retrieves employees
|
3163
3162
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
3164
3163
|
# @param [Hash] opts the optional parameters
|
3165
|
-
# @option opts [String] :
|
3166
|
-
# @option opts [String] :last_name Filter by last name
|
3164
|
+
# @option opts [String] :filter Filter by first name and/or lastname
|
3167
3165
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
3168
3166
|
# @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers
|
3169
3167
|
def get_employees_with_http_info(xero_tenant_id, options = {})
|
@@ -3183,8 +3181,7 @@ module XeroRuby
|
|
3183
3181
|
|
3184
3182
|
# query parameters
|
3185
3183
|
query_params = opts[:query_params] || {}
|
3186
|
-
query_params[:'
|
3187
|
-
query_params[:'lastName'] = opts[:'last_name'] if !opts[:'last_name'].nil?
|
3184
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
3188
3185
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
3189
3186
|
|
3190
3187
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
@@ -4419,8 +4416,11 @@ module XeroRuby
|
|
4419
4416
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
4420
4417
|
# @param [Hash] opts the optional parameters
|
4421
4418
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
4422
|
-
# @option opts [String] :
|
4423
|
-
# @option opts [String] :
|
4419
|
+
# @option opts [String] :filter Filter by employeeId and/or payrollCalendarId
|
4420
|
+
# @option opts [String] :status filter results by any timesheets with a matching timesheet status
|
4421
|
+
# @option opts [String] :start_date filter results by any timesheets with a startDate on or after the provided date
|
4422
|
+
# @option opts [String] :end_date filter results by any timesheets with a endDate on or before the provided date
|
4423
|
+
# @option opts [String] :sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest.
|
4424
4424
|
# @return [Timesheets]
|
4425
4425
|
def get_timesheets(xero_tenant_id, opts = {})
|
4426
4426
|
data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts)
|
@@ -4431,8 +4431,11 @@ module XeroRuby
|
|
4431
4431
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
4432
4432
|
# @param [Hash] opts the optional parameters
|
4433
4433
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
4434
|
-
# @option opts [String] :
|
4435
|
-
# @option opts [String] :
|
4434
|
+
# @option opts [String] :filter Filter by employeeId and/or payrollCalendarId
|
4435
|
+
# @option opts [String] :status filter results by any timesheets with a matching timesheet status
|
4436
|
+
# @option opts [String] :start_date filter results by any timesheets with a startDate on or after the provided date
|
4437
|
+
# @option opts [String] :end_date filter results by any timesheets with a endDate on or before the provided date
|
4438
|
+
# @option opts [String] :sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest.
|
4436
4439
|
# @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers
|
4437
4440
|
def get_timesheets_with_http_info(xero_tenant_id, options = {})
|
4438
4441
|
opts = options.dup
|
@@ -4452,8 +4455,11 @@ module XeroRuby
|
|
4452
4455
|
# query parameters
|
4453
4456
|
query_params = opts[:query_params] || {}
|
4454
4457
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
4455
|
-
query_params[:'
|
4456
|
-
query_params[:'
|
4458
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
4459
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
4460
|
+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
4461
|
+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
4462
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
4457
4463
|
|
4458
4464
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
4459
4465
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
@@ -4644,7 +4644,11 @@ module XeroRuby
|
|
4644
4644
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
4645
4645
|
# @param [Hash] opts the optional parameters
|
4646
4646
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
4647
|
-
# @option opts [String] :filter Filter by
|
4647
|
+
# @option opts [String] :filter Filter by employeeId and/or payrollCalendarId
|
4648
|
+
# @option opts [String] :status filter results by any timesheets with a matching timesheet status
|
4649
|
+
# @option opts [String] :start_date filter results by any timesheets with a startDate on or after the provided date
|
4650
|
+
# @option opts [String] :end_date filter results by any timesheets with a endDate on or before the provided date
|
4651
|
+
# @option opts [String] :sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest.
|
4648
4652
|
# @return [Timesheets]
|
4649
4653
|
def get_timesheets(xero_tenant_id, opts = {})
|
4650
4654
|
data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts)
|
@@ -4655,7 +4659,11 @@ module XeroRuby
|
|
4655
4659
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
4656
4660
|
# @param [Hash] opts the optional parameters
|
4657
4661
|
# @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
|
4658
|
-
# @option opts [String] :filter Filter by
|
4662
|
+
# @option opts [String] :filter Filter by employeeId and/or payrollCalendarId
|
4663
|
+
# @option opts [String] :status filter results by any timesheets with a matching timesheet status
|
4664
|
+
# @option opts [String] :start_date filter results by any timesheets with a startDate on or after the provided date
|
4665
|
+
# @option opts [String] :end_date filter results by any timesheets with a endDate on or before the provided date
|
4666
|
+
# @option opts [String] :sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest.
|
4659
4667
|
# @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers
|
4660
4668
|
def get_timesheets_with_http_info(xero_tenant_id, options = {})
|
4661
4669
|
opts = options.dup
|
@@ -4676,6 +4684,10 @@ module XeroRuby
|
|
4676
4684
|
query_params = opts[:query_params] || {}
|
4677
4685
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
4678
4686
|
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
4687
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
4688
|
+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
4689
|
+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
4690
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
4679
4691
|
|
4680
4692
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
4681
4693
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
data/lib/xero-ruby/api_client.rb
CHANGED
@@ -29,7 +29,7 @@ module XeroRuby
|
|
29
29
|
# Defines the headers to be used in HTTP requests of all API calls by default.
|
30
30
|
#
|
31
31
|
# @return [Hash]
|
32
|
-
attr_accessor :default_headers
|
32
|
+
attr_accessor :default_headers, :grant_type
|
33
33
|
|
34
34
|
# Initializes the ApiClient
|
35
35
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
@@ -37,6 +37,7 @@ module XeroRuby
|
|
37
37
|
@client_id = credentials[:client_id]
|
38
38
|
@client_secret = credentials[:client_secret]
|
39
39
|
@redirect_uri = credentials[:redirect_uri]
|
40
|
+
@grant_type = credentials[:grant_type] || 'authorization_code'
|
40
41
|
@scopes = credentials[:scopes]
|
41
42
|
@state = credentials[:state]
|
42
43
|
default_config = Configuration.default.clone
|
@@ -56,9 +57,17 @@ module XeroRuby
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def authorization_url
|
59
|
-
url =
|
60
|
-
url
|
61
|
-
|
60
|
+
url = URI.parse(@config.login_url)
|
61
|
+
url.query = URI.encode_www_form(
|
62
|
+
{
|
63
|
+
response_type: 'code',
|
64
|
+
client_id: @client_id,
|
65
|
+
redirect_uri: @redirect_uri,
|
66
|
+
scope: @scopes,
|
67
|
+
state: @state
|
68
|
+
}.compact
|
69
|
+
)
|
70
|
+
url.to_s
|
62
71
|
end
|
63
72
|
|
64
73
|
def accounting_api
|
@@ -96,6 +105,11 @@ module XeroRuby
|
|
96
105
|
XeroRuby::PayrollUkApi.new(self)
|
97
106
|
end
|
98
107
|
|
108
|
+
def app_store_api
|
109
|
+
@config.base_url = @config.app_store_url
|
110
|
+
XeroRuby::AppStoreApi.new(self)
|
111
|
+
end
|
112
|
+
|
99
113
|
# Token Helpers
|
100
114
|
def token_set
|
101
115
|
@config.token_set
|
@@ -135,9 +149,18 @@ module XeroRuby
|
|
135
149
|
@config.id_token = id_token
|
136
150
|
end
|
137
151
|
|
152
|
+
def get_client_credentials_token
|
153
|
+
data = {
|
154
|
+
grant_type: @grant_type
|
155
|
+
}
|
156
|
+
token_set = token_request(data, '/token')
|
157
|
+
|
158
|
+
return token_set
|
159
|
+
end
|
160
|
+
|
138
161
|
def get_token_set_from_callback(params)
|
139
162
|
data = {
|
140
|
-
grant_type:
|
163
|
+
grant_type: @grant_type,
|
141
164
|
code: params['code'],
|
142
165
|
redirect_uri: @redirect_uri
|
143
166
|
}
|
@@ -222,6 +245,10 @@ module XeroRuby
|
|
222
245
|
response[0]
|
223
246
|
end
|
224
247
|
|
248
|
+
def last_connection
|
249
|
+
connections.sort { |a,b| DateTime.parse(a['updatedDateUtc']) <=> DateTime.parse(b['updatedDateUtc'])}.first
|
250
|
+
end
|
251
|
+
|
225
252
|
def disconnect(connection_id)
|
226
253
|
@config.base_url = 'https://api.xero.com'
|
227
254
|
opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
|
@@ -262,7 +289,7 @@ module XeroRuby
|
|
262
289
|
end
|
263
290
|
|
264
291
|
connection = Faraday.new(:url => method_base_url, :ssl => ssl_options) do |conn|
|
265
|
-
conn.basic_auth
|
292
|
+
conn.request(:basic_auth, config.username, config.password)
|
266
293
|
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
267
294
|
conn.request :multipart
|
268
295
|
conn.request :url_encoded
|
@@ -479,6 +506,8 @@ module XeroRuby
|
|
479
506
|
XeroRuby::PayrollNz.const_get(return_type).build_from_hash(data)
|
480
507
|
when 'PayrollUkApi'
|
481
508
|
XeroRuby::PayrollUk.const_get(return_type).build_from_hash(data)
|
509
|
+
when 'AppStoreApi'
|
510
|
+
XeroRuby::AppStore.const_get(return_type).build_from_hash(data)
|
482
511
|
else
|
483
512
|
XeroRuby::Accounting.const_get(return_type).build_from_hash(data)
|
484
513
|
end
|
@@ -33,6 +33,7 @@ module XeroRuby
|
|
33
33
|
attr_accessor :payroll_au_url
|
34
34
|
attr_accessor :payroll_nz_url
|
35
35
|
attr_accessor :payroll_uk_url
|
36
|
+
attr_accessor :app_store_url
|
36
37
|
|
37
38
|
# Defines API keys used with API Key authentications.
|
38
39
|
#
|
@@ -149,6 +150,7 @@ module XeroRuby
|
|
149
150
|
@payroll_au_url = 'https://api.xero.com/payroll.xro/1.0/'
|
150
151
|
@payroll_nz_url = 'https://api.xero.com/payroll.xro/2.0/'
|
151
152
|
@payroll_uk_url = 'https://api.xero.com/payroll.xro/2.0/'
|
153
|
+
@app_store_url = 'https://api.xero.com/appstore/2.0/'
|
152
154
|
@access_token = nil
|
153
155
|
@id_token = nil
|
154
156
|
@api_key = {}
|
@@ -40,6 +40,15 @@ module XeroRuby::Accounting
|
|
40
40
|
# The Bank Transaction ID for the destination account
|
41
41
|
attr_accessor :to_bank_transaction_id
|
42
42
|
|
43
|
+
# The Bank Transaction boolean to show if it is reconciled for the source account
|
44
|
+
attr_accessor :from_is_reconciled
|
45
|
+
|
46
|
+
# The Bank Transaction boolean to show if it is reconciled for the destination account
|
47
|
+
attr_accessor :to_is_reconciled
|
48
|
+
|
49
|
+
# Reference for the transactions.
|
50
|
+
attr_accessor :reference
|
51
|
+
|
43
52
|
# Boolean to indicate if a Bank Transfer has an attachment
|
44
53
|
attr_accessor :has_attachments
|
45
54
|
|
@@ -60,6 +69,9 @@ module XeroRuby::Accounting
|
|
60
69
|
:'currency_rate' => :'CurrencyRate',
|
61
70
|
:'from_bank_transaction_id' => :'FromBankTransactionID',
|
62
71
|
:'to_bank_transaction_id' => :'ToBankTransactionID',
|
72
|
+
:'from_is_reconciled' => :'FromIsReconciled',
|
73
|
+
:'to_is_reconciled' => :'ToIsReconciled',
|
74
|
+
:'reference' => :'Reference',
|
63
75
|
:'has_attachments' => :'HasAttachments',
|
64
76
|
:'created_date_utc' => :'CreatedDateUTC',
|
65
77
|
:'validation_errors' => :'ValidationErrors'
|
@@ -77,6 +89,9 @@ module XeroRuby::Accounting
|
|
77
89
|
:'currency_rate' => :'BigDecimal',
|
78
90
|
:'from_bank_transaction_id' => :'String',
|
79
91
|
:'to_bank_transaction_id' => :'String',
|
92
|
+
:'from_is_reconciled' => :'Boolean',
|
93
|
+
:'to_is_reconciled' => :'Boolean',
|
94
|
+
:'reference' => :'String',
|
80
95
|
:'has_attachments' => :'Boolean',
|
81
96
|
:'created_date_utc' => :'DateTime',
|
82
97
|
:'validation_errors' => :'Array<ValidationError>'
|
@@ -130,6 +145,22 @@ module XeroRuby::Accounting
|
|
130
145
|
self.to_bank_transaction_id = attributes[:'to_bank_transaction_id']
|
131
146
|
end
|
132
147
|
|
148
|
+
if attributes.key?(:'from_is_reconciled')
|
149
|
+
self.from_is_reconciled = attributes[:'from_is_reconciled']
|
150
|
+
else
|
151
|
+
self.from_is_reconciled = false
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'to_is_reconciled')
|
155
|
+
self.to_is_reconciled = attributes[:'to_is_reconciled']
|
156
|
+
else
|
157
|
+
self.to_is_reconciled = false
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'reference')
|
161
|
+
self.reference = attributes[:'reference']
|
162
|
+
end
|
163
|
+
|
133
164
|
if attributes.key?(:'has_attachments')
|
134
165
|
self.has_attachments = attributes[:'has_attachments']
|
135
166
|
else
|
@@ -188,6 +219,9 @@ module XeroRuby::Accounting
|
|
188
219
|
currency_rate == o.currency_rate &&
|
189
220
|
from_bank_transaction_id == o.from_bank_transaction_id &&
|
190
221
|
to_bank_transaction_id == o.to_bank_transaction_id &&
|
222
|
+
from_is_reconciled == o.from_is_reconciled &&
|
223
|
+
to_is_reconciled == o.to_is_reconciled &&
|
224
|
+
reference == o.reference &&
|
191
225
|
has_attachments == o.has_attachments &&
|
192
226
|
created_date_utc == o.created_date_utc &&
|
193
227
|
validation_errors == o.validation_errors
|
@@ -202,7 +236,7 @@ module XeroRuby::Accounting
|
|
202
236
|
# Calculates hash code according to all attributes.
|
203
237
|
# @return [Integer] Hash code
|
204
238
|
def hash
|
205
|
-
[from_bank_account, to_bank_account, amount, date, bank_transfer_id, currency_rate, from_bank_transaction_id, to_bank_transaction_id, has_attachments, created_date_utc, validation_errors].hash
|
239
|
+
[from_bank_account, to_bank_account, amount, date, bank_transfer_id, currency_rate, from_bank_transaction_id, to_bank_transaction_id, from_is_reconciled, to_is_reconciled, reference, has_attachments, created_date_utc, validation_errors].hash
|
206
240
|
end
|
207
241
|
|
208
242
|
# Builds the object from hash
|
@@ -49,6 +49,9 @@ module XeroRuby::Accounting
|
|
49
49
|
# The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00
|
50
50
|
attr_accessor :amount
|
51
51
|
|
52
|
+
# The amount of the payment in the currency of the bank account.
|
53
|
+
attr_accessor :bank_amount
|
54
|
+
|
52
55
|
# An optional description for the payment e.g. Direct Debit
|
53
56
|
attr_accessor :reference
|
54
57
|
|
@@ -137,6 +140,7 @@ module XeroRuby::Accounting
|
|
137
140
|
:'date' => :'Date',
|
138
141
|
:'currency_rate' => :'CurrencyRate',
|
139
142
|
:'amount' => :'Amount',
|
143
|
+
:'bank_amount' => :'BankAmount',
|
140
144
|
:'reference' => :'Reference',
|
141
145
|
:'is_reconciled' => :'IsReconciled',
|
142
146
|
:'status' => :'Status',
|
@@ -168,6 +172,7 @@ module XeroRuby::Accounting
|
|
168
172
|
:'date' => :'Date',
|
169
173
|
:'currency_rate' => :'BigDecimal',
|
170
174
|
:'amount' => :'BigDecimal',
|
175
|
+
:'bank_amount' => :'BigDecimal',
|
171
176
|
:'reference' => :'String',
|
172
177
|
:'is_reconciled' => :'Boolean',
|
173
178
|
:'status' => :'String',
|
@@ -244,6 +249,10 @@ module XeroRuby::Accounting
|
|
244
249
|
self.amount = attributes[:'amount']
|
245
250
|
end
|
246
251
|
|
252
|
+
if attributes.key?(:'bank_amount')
|
253
|
+
self.bank_amount = attributes[:'bank_amount']
|
254
|
+
end
|
255
|
+
|
247
256
|
if attributes.key?(:'reference')
|
248
257
|
self.reference = attributes[:'reference']
|
249
258
|
end
|
@@ -360,6 +369,7 @@ module XeroRuby::Accounting
|
|
360
369
|
date == o.date &&
|
361
370
|
currency_rate == o.currency_rate &&
|
362
371
|
amount == o.amount &&
|
372
|
+
bank_amount == o.bank_amount &&
|
363
373
|
reference == o.reference &&
|
364
374
|
is_reconciled == o.is_reconciled &&
|
365
375
|
status == o.status &&
|
@@ -385,7 +395,7 @@ module XeroRuby::Accounting
|
|
385
395
|
# Calculates hash code according to all attributes.
|
386
396
|
# @return [Integer] Hash code
|
387
397
|
def hash
|
388
|
-
[invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, account, code, date, currency_rate, 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].hash
|
398
|
+
[invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, 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].hash
|
389
399
|
end
|
390
400
|
|
391
401
|
# Builds the object from hash
|
@@ -122,6 +122,7 @@ module XeroRuby::Accounting
|
|
122
122
|
HAWAIIANSTANDARDTIME = "HAWAIIANSTANDARDTIME".freeze
|
123
123
|
UTC11 = "UTC11".freeze
|
124
124
|
DATELINESTANDARDTIME = "DATELINESTANDARDTIME".freeze
|
125
|
+
EASTERISLANDSTANDARDTIME = "EASTERISLANDSTANDARDTIME".freeze
|
125
126
|
|
126
127
|
# Builds the enum from string
|
127
128
|
# @param [String] The enum value in the form of the string
|