merge_accounting_client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -5
  3. data/docs/Account.md +3 -1
  4. data/docs/AccountingAttachment.md +3 -1
  5. data/docs/BalanceSheet.md +3 -1
  6. data/docs/CashFlowStatement.md +3 -1
  7. data/docs/CompanyInfo.md +3 -1
  8. data/docs/Contact.md +3 -1
  9. data/docs/CreditNote.md +3 -1
  10. data/docs/Expense.md +3 -1
  11. data/docs/ForceResyncApi.md +4 -4
  12. data/docs/IncomeStatement.md +3 -1
  13. data/docs/Invoice.md +3 -1
  14. data/docs/InvoiceLineItem.md +3 -1
  15. data/docs/InvoiceLineItemRequest.md +3 -1
  16. data/docs/Item.md +3 -1
  17. data/docs/JournalEntry.md +7 -3
  18. data/docs/JournalEntryRequest.md +3 -1
  19. data/docs/JournalLine.md +2 -0
  20. data/docs/JournalLineRequest.md +2 -0
  21. data/docs/LinkedAccountsApi.md +14 -14
  22. data/docs/PaginatedVendorCreditList.md +22 -0
  23. data/docs/Payment.md +3 -1
  24. data/docs/PurchaseOrder.md +3 -1
  25. data/docs/TaxRate.md +3 -1
  26. data/docs/TrackingCategory.md +3 -1
  27. data/docs/VendorCredit.md +36 -0
  28. data/docs/VendorCreditLine.md +26 -0
  29. data/docs/VendorCreditsApi.md +181 -0
  30. data/docs/WebhookReceiversApi.md +14 -16
  31. data/lib/merge_accounting_client/api/force_resync_api.rb +3 -3
  32. data/lib/merge_accounting_client/api/linked_accounts_api.rb +15 -15
  33. data/lib/merge_accounting_client/api/vendor_credits_api.rb +196 -0
  34. data/lib/merge_accounting_client/api/webhook_receivers_api.rb +23 -15
  35. data/lib/merge_accounting_client/models/account.rb +15 -5
  36. data/lib/merge_accounting_client/models/account_details_and_actions_status_enum.rb +0 -2
  37. data/lib/merge_accounting_client/models/account_status_enum.rb +0 -2
  38. data/lib/merge_accounting_client/models/accounting_attachment.rb +15 -5
  39. data/lib/merge_accounting_client/models/address_type_enum.rb +0 -2
  40. data/lib/merge_accounting_client/models/balance_sheet.rb +15 -5
  41. data/lib/merge_accounting_client/models/cash_flow_statement.rb +15 -5
  42. data/lib/merge_accounting_client/models/categories_enum.rb +1 -2
  43. data/lib/merge_accounting_client/models/category_enum.rb +1 -2
  44. data/lib/merge_accounting_client/models/classification_enum.rb +0 -2
  45. data/lib/merge_accounting_client/models/company_info.rb +14 -4
  46. data/lib/merge_accounting_client/models/contact.rb +14 -4
  47. data/lib/merge_accounting_client/models/country_enum.rb +0 -2
  48. data/lib/merge_accounting_client/models/credit_note.rb +14 -4
  49. data/lib/merge_accounting_client/models/credit_note_status_enum.rb +0 -2
  50. data/lib/merge_accounting_client/models/currency_enum.rb +0 -2
  51. data/lib/merge_accounting_client/models/encoding_enum.rb +0 -2
  52. data/lib/merge_accounting_client/models/expense.rb +14 -4
  53. data/lib/merge_accounting_client/models/income_statement.rb +15 -5
  54. data/lib/merge_accounting_client/models/invoice.rb +13 -4
  55. data/lib/merge_accounting_client/models/invoice_line_item.rb +15 -5
  56. data/lib/merge_accounting_client/models/invoice_line_item_request.rb +15 -5
  57. data/lib/merge_accounting_client/models/invoice_type_enum.rb +0 -2
  58. data/lib/merge_accounting_client/models/issue_status_enum.rb +0 -2
  59. data/lib/merge_accounting_client/models/item.rb +15 -5
  60. data/lib/merge_accounting_client/models/journal_entry.rb +30 -10
  61. data/lib/merge_accounting_client/models/journal_entry_request.rb +17 -6
  62. data/lib/merge_accounting_client/models/journal_line.rb +11 -1
  63. data/lib/merge_accounting_client/models/journal_line_request.rb +11 -1
  64. data/lib/merge_accounting_client/models/method_enum.rb +0 -2
  65. data/lib/merge_accounting_client/models/{paginated_webhook_receiver_list.rb → paginated_vendor_credit_list.rb} +4 -4
  66. data/lib/merge_accounting_client/models/payment.rb +15 -5
  67. data/lib/merge_accounting_client/models/purchase_order.rb +15 -5
  68. data/lib/merge_accounting_client/models/purchase_order_status_enum.rb +0 -2
  69. data/lib/merge_accounting_client/models/request_format_enum.rb +0 -2
  70. data/lib/merge_accounting_client/models/state_enum.rb +0 -2
  71. data/lib/merge_accounting_client/models/status7d1_enum.rb +0 -2
  72. data/lib/merge_accounting_client/models/sync_status_status_enum.rb +0 -2
  73. data/lib/merge_accounting_client/models/tax_rate.rb +15 -5
  74. data/lib/merge_accounting_client/models/tracking_category.rb +15 -5
  75. data/lib/merge_accounting_client/models/vendor_credit.rb +317 -0
  76. data/lib/merge_accounting_client/models/vendor_credit_line.rb +265 -0
  77. data/lib/merge_accounting_client/version.rb +1 -1
  78. data/lib/merge_accounting_client.rb +4 -1
  79. data/spec/api/force_resync_api_spec.rb +1 -1
  80. data/spec/api/linked_accounts_api_spec.rb +7 -7
  81. data/spec/api/vendor_credits_api_spec.rb +70 -0
  82. data/spec/api/webhook_receivers_api_spec.rb +3 -3
  83. data/spec/models/account_spec.rb +6 -0
  84. data/spec/models/accounting_attachment_spec.rb +6 -0
  85. data/spec/models/balance_sheet_spec.rb +6 -0
  86. data/spec/models/cash_flow_statement_spec.rb +6 -0
  87. data/spec/models/company_info_spec.rb +6 -0
  88. data/spec/models/contact_spec.rb +6 -0
  89. data/spec/models/credit_note_spec.rb +6 -0
  90. data/spec/models/expense_spec.rb +6 -0
  91. data/spec/models/income_statement_spec.rb +6 -0
  92. data/spec/models/invoice_line_item_request_spec.rb +6 -0
  93. data/spec/models/invoice_line_item_spec.rb +6 -0
  94. data/spec/models/invoice_spec.rb +6 -0
  95. data/spec/models/item_spec.rb +6 -0
  96. data/spec/models/journal_entry_request_spec.rb +6 -0
  97. data/spec/models/journal_entry_spec.rb +13 -1
  98. data/spec/models/journal_line_request_spec.rb +6 -0
  99. data/spec/models/journal_line_spec.rb +6 -0
  100. data/spec/models/{paginated_webhook_receiver_list_spec.rb → paginated_vendor_credit_list_spec.rb} +6 -6
  101. data/spec/models/payment_spec.rb +6 -0
  102. data/spec/models/purchase_order_spec.rb +6 -0
  103. data/spec/models/tax_rate_spec.rb +6 -0
  104. data/spec/models/tracking_category_spec.rb +6 -0
  105. data/spec/models/vendor_credit_line_spec.rb +58 -0
  106. data/spec/models/vendor_credit_spec.rb +88 -0
  107. metadata +118 -106
  108. data/docs/PaginatedWebhookReceiverList.md +0 -22
@@ -0,0 +1,181 @@
1
+ # MergeAccountingClient::VendorCreditsApi
2
+
3
+ All URIs are relative to *https://api.merge.dev/api/accounting/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**vendor_credits_list**](VendorCreditsApi.md#vendor_credits_list) | **GET** /vendor-credits | |
8
+ | [**vendor_credits_retrieve**](VendorCreditsApi.md#vendor_credits_retrieve) | **GET** /vendor-credits/{id} | |
9
+
10
+
11
+ ## vendor_credits_list
12
+
13
+ > <PaginatedVendorCreditList> vendor_credits_list(x_account_token, opts)
14
+
15
+
16
+
17
+ Returns a list of `VendorCredit` objects.
18
+
19
+ ### Examples
20
+
21
+ ```ruby
22
+ require 'time'
23
+ require 'merge_accounting_client'
24
+ # setup authorization
25
+ MergeAccountingClient.configure do |config|
26
+ # Configure API key authorization: tokenAuth
27
+ config.api_key['tokenAuth'] = 'YOUR API KEY'
28
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
29
+ # config.api_key_prefix['tokenAuth'] = 'Bearer'
30
+ end
31
+
32
+ api_instance = MergeAccountingClient::VendorCreditsApi.new
33
+ x_account_token = 'x_account_token_example' # String | Token identifying the end user.
34
+ opts = {
35
+ created_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created after this datetime.
36
+ created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created before this datetime.
37
+ cursor: 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', # String | The pagination cursor value.
38
+ expand: 'lines', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
39
+ include_deleted_data: true, # Boolean | Whether to include data that was deleted in the third-party service.
40
+ include_remote_data: true, # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
41
+ modified_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects modified after this datetime.
42
+ modified_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects modified before this datetime.
43
+ page_size: 56, # Integer | Number of results to return per page.
44
+ remote_id: 'remote_id_example' # String | The API provider's ID for the given object.
45
+ }
46
+
47
+ begin
48
+
49
+ result = api_instance.vendor_credits_list(x_account_token, opts)
50
+ p result
51
+ rescue MergeAccountingClient::ApiError => e
52
+ puts "Error when calling VendorCreditsApi->vendor_credits_list: #{e}"
53
+ end
54
+ ```
55
+
56
+ #### Using the vendor_credits_list_with_http_info variant
57
+
58
+ This returns an Array which contains the response data, status code and headers.
59
+
60
+ > <Array(<PaginatedVendorCreditList>, Integer, Hash)> vendor_credits_list_with_http_info(x_account_token, opts)
61
+
62
+ ```ruby
63
+ begin
64
+
65
+ data, status_code, headers = api_instance.vendor_credits_list_with_http_info(x_account_token, opts)
66
+ p status_code # => 2xx
67
+ p headers # => { ... }
68
+ p data # => <PaginatedVendorCreditList>
69
+ rescue MergeAccountingClient::ApiError => e
70
+ puts "Error when calling VendorCreditsApi->vendor_credits_list_with_http_info: #{e}"
71
+ end
72
+ ```
73
+
74
+ ### Parameters
75
+
76
+ | Name | Type | Description | Notes |
77
+ | ---- | ---- | ----------- | ----- |
78
+ | **x_account_token** | **String** | Token identifying the end user. | |
79
+ | **created_after** | **Time** | If provided, will only return objects created after this datetime. | [optional] |
80
+ | **created_before** | **Time** | If provided, will only return objects created before this datetime. | [optional] |
81
+ | **cursor** | **String** | The pagination cursor value. | [optional] |
82
+ | **expand** | **String** | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. | [optional] |
83
+ | **include_deleted_data** | **Boolean** | Whether to include data that was deleted in the third-party service. | [optional] |
84
+ | **include_remote_data** | **Boolean** | Whether to include the original data Merge fetched from the third-party to produce these models. | [optional] |
85
+ | **modified_after** | **Time** | If provided, will only return objects modified after this datetime. | [optional] |
86
+ | **modified_before** | **Time** | If provided, will only return objects modified before this datetime. | [optional] |
87
+ | **page_size** | **Integer** | Number of results to return per page. | [optional] |
88
+ | **remote_id** | **String** | The API provider&#39;s ID for the given object. | [optional] |
89
+
90
+ ### Return type
91
+
92
+ [**PaginatedVendorCreditList**](PaginatedVendorCreditList.md)
93
+
94
+ ### Authorization
95
+
96
+ [tokenAuth](../README.md#tokenAuth)
97
+
98
+ ### HTTP request headers
99
+
100
+ - **Content-Type**: Not defined
101
+ - **Accept**: application/json
102
+
103
+
104
+ ## vendor_credits_retrieve
105
+
106
+ > <VendorCredit> vendor_credits_retrieve(x_account_token, id, opts)
107
+
108
+
109
+
110
+ Returns a `VendorCredit` object with the given `id`.
111
+
112
+ ### Examples
113
+
114
+ ```ruby
115
+ require 'time'
116
+ require 'merge_accounting_client'
117
+ # setup authorization
118
+ MergeAccountingClient.configure do |config|
119
+ # Configure API key authorization: tokenAuth
120
+ config.api_key['tokenAuth'] = 'YOUR API KEY'
121
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
122
+ # config.api_key_prefix['tokenAuth'] = 'Bearer'
123
+ end
124
+
125
+ api_instance = MergeAccountingClient::VendorCreditsApi.new
126
+ x_account_token = 'x_account_token_example' # String | Token identifying the end user.
127
+ id = TODO # String |
128
+ opts = {
129
+ expand: 'lines', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
130
+ include_remote_data: true # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
131
+ }
132
+
133
+ begin
134
+
135
+ result = api_instance.vendor_credits_retrieve(x_account_token, id, opts)
136
+ p result
137
+ rescue MergeAccountingClient::ApiError => e
138
+ puts "Error when calling VendorCreditsApi->vendor_credits_retrieve: #{e}"
139
+ end
140
+ ```
141
+
142
+ #### Using the vendor_credits_retrieve_with_http_info variant
143
+
144
+ This returns an Array which contains the response data, status code and headers.
145
+
146
+ > <Array(<VendorCredit>, Integer, Hash)> vendor_credits_retrieve_with_http_info(x_account_token, id, opts)
147
+
148
+ ```ruby
149
+ begin
150
+
151
+ data, status_code, headers = api_instance.vendor_credits_retrieve_with_http_info(x_account_token, id, opts)
152
+ p status_code # => 2xx
153
+ p headers # => { ... }
154
+ p data # => <VendorCredit>
155
+ rescue MergeAccountingClient::ApiError => e
156
+ puts "Error when calling VendorCreditsApi->vendor_credits_retrieve_with_http_info: #{e}"
157
+ end
158
+ ```
159
+
160
+ ### Parameters
161
+
162
+ | Name | Type | Description | Notes |
163
+ | ---- | ---- | ----------- | ----- |
164
+ | **x_account_token** | **String** | Token identifying the end user. | |
165
+ | **id** | [**String**](.md) | | |
166
+ | **expand** | **String** | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. | [optional] |
167
+ | **include_remote_data** | **Boolean** | Whether to include the original data Merge fetched from the third-party to produce these models. | [optional] |
168
+
169
+ ### Return type
170
+
171
+ [**VendorCredit**](VendorCredit.md)
172
+
173
+ ### Authorization
174
+
175
+ [tokenAuth](../README.md#tokenAuth)
176
+
177
+ ### HTTP request headers
178
+
179
+ - **Content-Type**: Not defined
180
+ - **Accept**: application/json
181
+
@@ -10,7 +10,7 @@ All URIs are relative to *https://api.merge.dev/api/accounting/v1*
10
10
 
11
11
  ## webhook_receivers_create
12
12
 
13
- > <WebhookReceiver> webhook_receivers_create(webhook_receiver_request)
13
+ > <WebhookReceiver> webhook_receivers_create(x_account_token, webhook_receiver_request)
14
14
 
15
15
 
16
16
 
@@ -30,11 +30,12 @@ MergeAccountingClient.configure do |config|
30
30
  end
31
31
 
32
32
  api_instance = MergeAccountingClient::WebhookReceiversApi.new
33
+ x_account_token = 'x_account_token_example' # String | Token identifying the end user.
33
34
  webhook_receiver_request = MergeAccountingClient::WebhookReceiverRequest.new({event: 'event_example', is_active: false}) # WebhookReceiverRequest |
34
35
 
35
36
  begin
36
37
 
37
- result = api_instance.webhook_receivers_create(webhook_receiver_request)
38
+ result = api_instance.webhook_receivers_create(x_account_token, webhook_receiver_request)
38
39
  p result
39
40
  rescue MergeAccountingClient::ApiError => e
40
41
  puts "Error when calling WebhookReceiversApi->webhook_receivers_create: #{e}"
@@ -45,12 +46,12 @@ end
45
46
 
46
47
  This returns an Array which contains the response data, status code and headers.
47
48
 
48
- > <Array(<WebhookReceiver>, Integer, Hash)> webhook_receivers_create_with_http_info(webhook_receiver_request)
49
+ > <Array(<WebhookReceiver>, Integer, Hash)> webhook_receivers_create_with_http_info(x_account_token, webhook_receiver_request)
49
50
 
50
51
  ```ruby
51
52
  begin
52
53
 
53
- data, status_code, headers = api_instance.webhook_receivers_create_with_http_info(webhook_receiver_request)
54
+ data, status_code, headers = api_instance.webhook_receivers_create_with_http_info(x_account_token, webhook_receiver_request)
54
55
  p status_code # => 2xx
55
56
  p headers # => { ... }
56
57
  p data # => <WebhookReceiver>
@@ -63,6 +64,7 @@ end
63
64
 
64
65
  | Name | Type | Description | Notes |
65
66
  | ---- | ---- | ----------- | ----- |
67
+ | **x_account_token** | **String** | Token identifying the end user. | |
66
68
  | **webhook_receiver_request** | [**WebhookReceiverRequest**](WebhookReceiverRequest.md) | | |
67
69
 
68
70
  ### Return type
@@ -81,7 +83,7 @@ end
81
83
 
82
84
  ## webhook_receivers_list
83
85
 
84
- > <PaginatedWebhookReceiverList> webhook_receivers_list(opts)
86
+ > <Array<WebhookReceiver>> webhook_receivers_list(x_account_token)
85
87
 
86
88
 
87
89
 
@@ -101,14 +103,11 @@ MergeAccountingClient.configure do |config|
101
103
  end
102
104
 
103
105
  api_instance = MergeAccountingClient::WebhookReceiversApi.new
104
- opts = {
105
- cursor: 56, # Integer | The pagination cursor value.
106
- page_size: 56 # Integer | Number of results to return per page.
107
- }
106
+ x_account_token = 'x_account_token_example' # String | Token identifying the end user.
108
107
 
109
108
  begin
110
109
 
111
- result = api_instance.webhook_receivers_list(opts)
110
+ result = api_instance.webhook_receivers_list(x_account_token)
112
111
  p result
113
112
  rescue MergeAccountingClient::ApiError => e
114
113
  puts "Error when calling WebhookReceiversApi->webhook_receivers_list: #{e}"
@@ -119,15 +118,15 @@ end
119
118
 
120
119
  This returns an Array which contains the response data, status code and headers.
121
120
 
122
- > <Array(<PaginatedWebhookReceiverList>, Integer, Hash)> webhook_receivers_list_with_http_info(opts)
121
+ > <Array(<Array<WebhookReceiver>>, Integer, Hash)> webhook_receivers_list_with_http_info(x_account_token)
123
122
 
124
123
  ```ruby
125
124
  begin
126
125
 
127
- data, status_code, headers = api_instance.webhook_receivers_list_with_http_info(opts)
126
+ data, status_code, headers = api_instance.webhook_receivers_list_with_http_info(x_account_token)
128
127
  p status_code # => 2xx
129
128
  p headers # => { ... }
130
- p data # => <PaginatedWebhookReceiverList>
129
+ p data # => <Array<WebhookReceiver>>
131
130
  rescue MergeAccountingClient::ApiError => e
132
131
  puts "Error when calling WebhookReceiversApi->webhook_receivers_list_with_http_info: #{e}"
133
132
  end
@@ -137,12 +136,11 @@ end
137
136
 
138
137
  | Name | Type | Description | Notes |
139
138
  | ---- | ---- | ----------- | ----- |
140
- | **cursor** | **Integer** | The pagination cursor value. | [optional] |
141
- | **page_size** | **Integer** | Number of results to return per page. | [optional] |
139
+ | **x_account_token** | **String** | Token identifying the end user. | |
142
140
 
143
141
  ### Return type
144
142
 
145
- [**PaginatedWebhookReceiverList**](PaginatedWebhookReceiverList.md)
143
+ [**Array&lt;WebhookReceiver&gt;**](WebhookReceiver.md)
146
144
 
147
145
  ### Authorization
148
146
 
@@ -22,7 +22,7 @@ module MergeAccountingClient
22
22
  # Force re-sync of all models. This is only available for organizations on Merge's Grow and Expand plans.
23
23
  # @param x_account_token [String] Token identifying the end user.
24
24
  # @param [Hash] opts the optional parameters
25
- # @return [SyncStatus]
25
+ # @return [Array<SyncStatus>]
26
26
  def sync_status_resync_create(x_account_token, opts = {})
27
27
  data, _status_code, _headers = sync_status_resync_create_with_http_info(x_account_token, opts)
28
28
  data
@@ -31,7 +31,7 @@ module MergeAccountingClient
31
31
  # Force re-sync of all models. This is only available for organizations on Merge&#39;s Grow and Expand plans.
32
32
  # @param x_account_token [String] Token identifying the end user.
33
33
  # @param [Hash] opts the optional parameters
34
- # @return [Array<(SyncStatus, Integer, Hash)>] SyncStatus data, response status code and response headers
34
+ # @return [Array<(Array<SyncStatus>, Integer, Hash)>] Array<SyncStatus> data, response status code and response headers
35
35
  def sync_status_resync_create_with_http_info(x_account_token, opts = {})
36
36
  if @api_client.config.debugging
37
37
  @api_client.config.logger.debug 'Calling API: ForceResyncApi.sync_status_resync_create ...'
@@ -59,7 +59,7 @@ module MergeAccountingClient
59
59
  post_body = opts[:debug_body]
60
60
 
61
61
  # return_type
62
- return_type = opts[:debug_return_type] || 'SyncStatus'
62
+ return_type = opts[:debug_return_type] || 'Array<SyncStatus>'
63
63
 
64
64
  # auth_names
65
65
  auth_names = opts[:debug_auth_names] || ['tokenAuth']
@@ -23,14 +23,14 @@ module MergeAccountingClient
23
23
  # @param [Hash] opts the optional parameters
24
24
  # @option opts [String] :category
25
25
  # @option opts [String] :cursor The pagination cursor value.
26
- # @option opts [String] :end_user_email_address
27
- # @option opts [String] :end_user_organization_name
28
- # @option opts [String] :end_user_origin_id
29
- # @option opts [String] :end_user_origin_ids Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once
26
+ # @option opts [String] :end_user_email_address If provided, will only return linked accounts associated with the given email address.
27
+ # @option opts [String] :end_user_organization_name If provided, will only return linked accounts associated with the given organization name.
28
+ # @option opts [String] :end_user_origin_id If provided, will only return linked accounts associated with the given origin ID.
29
+ # @option opts [String] :end_user_origin_ids Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.
30
30
  # @option opts [String] :id
31
- # @option opts [String] :ids Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once
32
- # @option opts [String] :integration_name
33
- # @option opts [String] :is_test_account If included, will only include test linked accounts. If not included, will only include non-test linked accounts
31
+ # @option opts [String] :ids Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.
32
+ # @option opts [String] :integration_name If provided, will only return linked accounts associated with the given integration name.
33
+ # @option opts [String] :is_test_account If included, will only include test linked accounts. If not included, will only include non-test linked accounts.
34
34
  # @option opts [Integer] :page_size Number of results to return per page.
35
35
  # @option opts [String] :status Filter by status. Options: &#x60;COMPLETE&#x60;, &#x60;INCOMPLETE&#x60;, &#x60;RELINK_NEEDED&#x60;
36
36
  # @return [PaginatedAccountDetailsAndActionsList]
@@ -43,14 +43,14 @@ module MergeAccountingClient
43
43
  # @param [Hash] opts the optional parameters
44
44
  # @option opts [String] :category
45
45
  # @option opts [String] :cursor The pagination cursor value.
46
- # @option opts [String] :end_user_email_address
47
- # @option opts [String] :end_user_organization_name
48
- # @option opts [String] :end_user_origin_id
49
- # @option opts [String] :end_user_origin_ids Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once
46
+ # @option opts [String] :end_user_email_address If provided, will only return linked accounts associated with the given email address.
47
+ # @option opts [String] :end_user_organization_name If provided, will only return linked accounts associated with the given organization name.
48
+ # @option opts [String] :end_user_origin_id If provided, will only return linked accounts associated with the given origin ID.
49
+ # @option opts [String] :end_user_origin_ids Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.
50
50
  # @option opts [String] :id
51
- # @option opts [String] :ids Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once
52
- # @option opts [String] :integration_name
53
- # @option opts [String] :is_test_account If included, will only include test linked accounts. If not included, will only include non-test linked accounts
51
+ # @option opts [String] :ids Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.
52
+ # @option opts [String] :integration_name If provided, will only return linked accounts associated with the given integration name.
53
+ # @option opts [String] :is_test_account If included, will only include test linked accounts. If not included, will only include non-test linked accounts.
54
54
  # @option opts [Integer] :page_size Number of results to return per page.
55
55
  # @option opts [String] :status Filter by status. Options: &#x60;COMPLETE&#x60;, &#x60;INCOMPLETE&#x60;, &#x60;RELINK_NEEDED&#x60;
56
56
  # @return [Array<(PaginatedAccountDetailsAndActionsList, Integer, Hash)>] PaginatedAccountDetailsAndActionsList data, response status code and response headers
@@ -58,7 +58,7 @@ module MergeAccountingClient
58
58
  if @api_client.config.debugging
59
59
  @api_client.config.logger.debug 'Calling API: LinkedAccountsApi.linked_accounts_list ...'
60
60
  end
61
- allowable_values = ["accounting", "ats", "hris", "ticketing"]
61
+ allowable_values = ["accounting", "ats", "crm", "hris", "ticketing"]
62
62
  if @api_client.config.client_side_validation && opts[:'category'] && !allowable_values.include?(opts[:'category'])
63
63
  fail ArgumentError, "invalid value for \"category\", must be one of #{allowable_values}"
64
64
  end
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #Merge Accounting API
3
+
4
+ #The unified API for building rich integrations with multiple Accounting & Finance platforms.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: hello@merge.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MergeAccountingClient
16
+ class VendorCreditsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Returns a list of `VendorCredit` objects.
23
+ # @param x_account_token [String] Token identifying the end user.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
26
+ # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
27
+ # @option opts [String] :cursor The pagination cursor value.
28
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
29
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was deleted in the third-party service.
30
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
31
+ # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
32
+ # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
33
+ # @option opts [Integer] :page_size Number of results to return per page.
34
+ # @option opts [String] :remote_id The API provider&#39;s ID for the given object.
35
+ # @return [PaginatedVendorCreditList]
36
+ def vendor_credits_list(x_account_token, opts = {})
37
+ data, _status_code, _headers = vendor_credits_list_with_http_info(x_account_token, opts)
38
+ data
39
+ end
40
+
41
+ # Returns a list of &#x60;VendorCredit&#x60; objects.
42
+ # @param x_account_token [String] Token identifying the end user.
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
45
+ # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
46
+ # @option opts [String] :cursor The pagination cursor value.
47
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
48
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was deleted in the third-party service.
49
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
50
+ # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
51
+ # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
52
+ # @option opts [Integer] :page_size Number of results to return per page.
53
+ # @option opts [String] :remote_id The API provider&#39;s ID for the given object.
54
+ # @return [Array<(PaginatedVendorCreditList, Integer, Hash)>] PaginatedVendorCreditList data, response status code and response headers
55
+ def vendor_credits_list_with_http_info(x_account_token, opts = {})
56
+ if @api_client.config.debugging
57
+ @api_client.config.logger.debug 'Calling API: VendorCreditsApi.vendor_credits_list ...'
58
+ end
59
+ # verify the required parameter 'x_account_token' is set
60
+ if @api_client.config.client_side_validation && x_account_token.nil?
61
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling VendorCreditsApi.vendor_credits_list"
62
+ end
63
+ allowable_values = ["lines", "lines,vendor", "vendor"]
64
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
65
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
66
+ end
67
+ # resource path
68
+ local_var_path = '/vendor-credits'
69
+
70
+ # query parameters
71
+ query_params = opts[:query_params] || {}
72
+ query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
73
+ query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
74
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
75
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
76
+ query_params[:'include_deleted_data'] = opts[:'include_deleted_data'] if !opts[:'include_deleted_data'].nil?
77
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
78
+ query_params[:'modified_after'] = opts[:'modified_after'] if !opts[:'modified_after'].nil?
79
+ query_params[:'modified_before'] = opts[:'modified_before'] if !opts[:'modified_before'].nil?
80
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
81
+ query_params[:'remote_id'] = opts[:'remote_id'] if !opts[:'remote_id'].nil?
82
+
83
+ # header parameters
84
+ header_params = opts[:header_params] || {}
85
+ # HTTP header 'Accept' (if needed)
86
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
87
+ header_params[:'X-Account-Token'] = x_account_token
88
+
89
+ # form parameters
90
+ form_params = opts[:form_params] || {}
91
+
92
+ # http body (model)
93
+ post_body = opts[:debug_body]
94
+
95
+ # return_type
96
+ return_type = opts[:debug_return_type] || 'PaginatedVendorCreditList'
97
+
98
+ # auth_names
99
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
100
+
101
+ new_options = opts.merge(
102
+ :operation => :"VendorCreditsApi.vendor_credits_list",
103
+ :header_params => header_params,
104
+ :query_params => query_params,
105
+ :form_params => form_params,
106
+ :body => post_body,
107
+ :auth_names => auth_names,
108
+ :return_type => return_type
109
+ )
110
+
111
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called: VendorCreditsApi#vendor_credits_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
114
+ end
115
+ return data, status_code, headers
116
+ end
117
+
118
+ # Returns a `VendorCredit` object with the given `id`.
119
+ # @param x_account_token [String] Token identifying the end user.
120
+ # @param id [String]
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
123
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
124
+ # @return [VendorCredit]
125
+ def vendor_credits_retrieve(x_account_token, id, opts = {})
126
+ data, _status_code, _headers = vendor_credits_retrieve_with_http_info(x_account_token, id, opts)
127
+ data
128
+ end
129
+
130
+ # Returns a &#x60;VendorCredit&#x60; object with the given &#x60;id&#x60;.
131
+ # @param x_account_token [String] Token identifying the end user.
132
+ # @param id [String]
133
+ # @param [Hash] opts the optional parameters
134
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
135
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
136
+ # @return [Array<(VendorCredit, Integer, Hash)>] VendorCredit data, response status code and response headers
137
+ def vendor_credits_retrieve_with_http_info(x_account_token, id, opts = {})
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug 'Calling API: VendorCreditsApi.vendor_credits_retrieve ...'
140
+ end
141
+ # verify the required parameter 'x_account_token' is set
142
+ if @api_client.config.client_side_validation && x_account_token.nil?
143
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling VendorCreditsApi.vendor_credits_retrieve"
144
+ end
145
+ # verify the required parameter 'id' is set
146
+ if @api_client.config.client_side_validation && id.nil?
147
+ fail ArgumentError, "Missing the required parameter 'id' when calling VendorCreditsApi.vendor_credits_retrieve"
148
+ end
149
+ allowable_values = ["lines", "lines,vendor", "vendor"]
150
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
151
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
152
+ end
153
+ # resource path
154
+ local_var_path = '/vendor-credits/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
159
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
160
+
161
+ # header parameters
162
+ header_params = opts[:header_params] || {}
163
+ # HTTP header 'Accept' (if needed)
164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
165
+ header_params[:'X-Account-Token'] = x_account_token
166
+
167
+ # form parameters
168
+ form_params = opts[:form_params] || {}
169
+
170
+ # http body (model)
171
+ post_body = opts[:debug_body]
172
+
173
+ # return_type
174
+ return_type = opts[:debug_return_type] || 'VendorCredit'
175
+
176
+ # auth_names
177
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
178
+
179
+ new_options = opts.merge(
180
+ :operation => :"VendorCreditsApi.vendor_credits_retrieve",
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => return_type
187
+ )
188
+
189
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: VendorCreditsApi#vendor_credits_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ return data, status_code, headers
194
+ end
195
+ end
196
+ end
@@ -20,22 +20,28 @@ module MergeAccountingClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Creates a `WebhookReceiver` object with the given values.
23
+ # @param x_account_token [String] Token identifying the end user.
23
24
  # @param webhook_receiver_request [WebhookReceiverRequest]
24
25
  # @param [Hash] opts the optional parameters
25
26
  # @return [WebhookReceiver]
26
- def webhook_receivers_create(webhook_receiver_request, opts = {})
27
- data, _status_code, _headers = webhook_receivers_create_with_http_info(webhook_receiver_request, opts)
27
+ def webhook_receivers_create(x_account_token, webhook_receiver_request, opts = {})
28
+ data, _status_code, _headers = webhook_receivers_create_with_http_info(x_account_token, webhook_receiver_request, opts)
28
29
  data
29
30
  end
30
31
 
31
32
  # Creates a &#x60;WebhookReceiver&#x60; object with the given values.
33
+ # @param x_account_token [String] Token identifying the end user.
32
34
  # @param webhook_receiver_request [WebhookReceiverRequest]
33
35
  # @param [Hash] opts the optional parameters
34
36
  # @return [Array<(WebhookReceiver, Integer, Hash)>] WebhookReceiver data, response status code and response headers
35
- def webhook_receivers_create_with_http_info(webhook_receiver_request, opts = {})
37
+ def webhook_receivers_create_with_http_info(x_account_token, webhook_receiver_request, opts = {})
36
38
  if @api_client.config.debugging
37
39
  @api_client.config.logger.debug 'Calling API: WebhookReceiversApi.webhook_receivers_create ...'
38
40
  end
41
+ # verify the required parameter 'x_account_token' is set
42
+ if @api_client.config.client_side_validation && x_account_token.nil?
43
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling WebhookReceiversApi.webhook_receivers_create"
44
+ end
39
45
  # verify the required parameter 'webhook_receiver_request' is set
40
46
  if @api_client.config.client_side_validation && webhook_receiver_request.nil?
41
47
  fail ArgumentError, "Missing the required parameter 'webhook_receiver_request' when calling WebhookReceiversApi.webhook_receivers_create"
@@ -52,6 +58,7 @@ module MergeAccountingClient
52
58
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
59
  # HTTP header 'Content-Type'
54
60
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
61
+ header_params[:'X-Account-Token'] = x_account_token
55
62
 
56
63
  # form parameters
57
64
  form_params = opts[:form_params] || {}
@@ -83,36 +90,37 @@ module MergeAccountingClient
83
90
  end
84
91
 
85
92
  # Returns a list of `WebhookReceiver` objects.
93
+ # @param x_account_token [String] Token identifying the end user.
86
94
  # @param [Hash] opts the optional parameters
87
- # @option opts [Integer] :cursor The pagination cursor value.
88
- # @option opts [Integer] :page_size Number of results to return per page.
89
- # @return [PaginatedWebhookReceiverList]
90
- def webhook_receivers_list(opts = {})
91
- data, _status_code, _headers = webhook_receivers_list_with_http_info(opts)
95
+ # @return [Array<WebhookReceiver>]
96
+ def webhook_receivers_list(x_account_token, opts = {})
97
+ data, _status_code, _headers = webhook_receivers_list_with_http_info(x_account_token, opts)
92
98
  data
93
99
  end
94
100
 
95
101
  # Returns a list of &#x60;WebhookReceiver&#x60; objects.
102
+ # @param x_account_token [String] Token identifying the end user.
96
103
  # @param [Hash] opts the optional parameters
97
- # @option opts [Integer] :cursor The pagination cursor value.
98
- # @option opts [Integer] :page_size Number of results to return per page.
99
- # @return [Array<(PaginatedWebhookReceiverList, Integer, Hash)>] PaginatedWebhookReceiverList data, response status code and response headers
100
- def webhook_receivers_list_with_http_info(opts = {})
104
+ # @return [Array<(Array<WebhookReceiver>, Integer, Hash)>] Array<WebhookReceiver> data, response status code and response headers
105
+ def webhook_receivers_list_with_http_info(x_account_token, opts = {})
101
106
  if @api_client.config.debugging
102
107
  @api_client.config.logger.debug 'Calling API: WebhookReceiversApi.webhook_receivers_list ...'
103
108
  end
109
+ # verify the required parameter 'x_account_token' is set
110
+ if @api_client.config.client_side_validation && x_account_token.nil?
111
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling WebhookReceiversApi.webhook_receivers_list"
112
+ end
104
113
  # resource path
105
114
  local_var_path = '/webhook-receivers'
106
115
 
107
116
  # query parameters
108
117
  query_params = opts[:query_params] || {}
109
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
110
- query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
111
118
 
112
119
  # header parameters
113
120
  header_params = opts[:header_params] || {}
114
121
  # HTTP header 'Accept' (if needed)
115
122
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
123
+ header_params[:'X-Account-Token'] = x_account_token
116
124
 
117
125
  # form parameters
118
126
  form_params = opts[:form_params] || {}
@@ -121,7 +129,7 @@ module MergeAccountingClient
121
129
  post_body = opts[:debug_body]
122
130
 
123
131
  # return_type
124
- return_type = opts[:debug_return_type] || 'PaginatedWebhookReceiverList'
132
+ return_type = opts[:debug_return_type] || 'Array<WebhookReceiver>'
125
133
 
126
134
  # auth_names
127
135
  auth_names = opts[:debug_auth_names] || ['tokenAuth']