dear-inventory-ruby 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -9
- data/docs/Account.md +43 -0
- data/docs/Accounts.md +21 -0
- data/docs/Address.md +2 -2
- data/docs/Contact.md +1 -1
- data/docs/Customer.md +7 -7
- data/docs/InventoryApi.md +731 -25
- data/docs/PaymentTerm.md +27 -0
- data/docs/PaymentTerms.md +21 -0
- data/docs/Success.md +17 -0
- data/docs/Tax.md +33 -0
- data/docs/TaxComponent.md +23 -0
- data/docs/Taxes.md +21 -0
- data/lib/dear-inventory-ruby.rb +8 -0
- data/lib/dear-inventory-ruby/api/inventory_api.rb +740 -14
- data/lib/dear-inventory-ruby/models/account.rb +477 -0
- data/lib/dear-inventory-ruby/models/accounts.rb +229 -0
- data/lib/dear-inventory-ruby/models/address.rb +10 -0
- data/lib/dear-inventory-ruby/models/contact.rb +12 -3
- data/lib/dear-inventory-ruby/models/customer.rb +42 -3
- data/lib/dear-inventory-ruby/models/payment_term.rb +319 -0
- data/lib/dear-inventory-ruby/models/payment_terms.rb +229 -0
- data/lib/dear-inventory-ruby/models/success.rb +207 -0
- data/lib/dear-inventory-ruby/models/tax.rb +360 -0
- data/lib/dear-inventory-ruby/models/tax_component.rb +306 -0
- data/lib/dear-inventory-ruby/models/taxes.rb +229 -0
- data/lib/dear-inventory-ruby/version.rb +1 -1
- data/spec/api/inventory_api_spec.rb +148 -4
- data/spec/models/account_spec.rb +131 -0
- data/spec/models/accounts_spec.rb +53 -0
- data/spec/models/payment_term_spec.rb +75 -0
- data/spec/models/payment_terms_spec.rb +53 -0
- data/spec/models/success_spec.rb +41 -0
- data/spec/models/tax_component_spec.rb +59 -0
- data/spec/models/tax_spec.rb +89 -0
- data/spec/models/taxes_spec.rb +53 -0
- metadata +34 -2
data/docs/PaymentTerm.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# DearInventoryRuby::PaymentTerm
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique Payment Term ID | [optional]
|
8
|
+
**name** | **String** | Name of Payment Term |
|
9
|
+
**duration** | **String** | Minimum Payment Term duration in days | [optional]
|
10
|
+
**method** | **String** | Method of Payment Term. Should be one of the following values: `number of days`, `day of next month`, `last day of next month`, `days since the end of the month` | [optional]
|
11
|
+
**is_active** | **Boolean** | Points that Payment Term is Active. `True` as default for POST. | [optional] [default to true]
|
12
|
+
**is_default** | **Boolean** | Points that Payment Term is Default. `False` as default for POST. | [optional] [default to false]
|
13
|
+
|
14
|
+
## Code Sample
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'DearInventoryRuby'
|
18
|
+
|
19
|
+
instance = DearInventoryRuby::PaymentTerm.new(id: null,
|
20
|
+
name: null,
|
21
|
+
duration: null,
|
22
|
+
method: null,
|
23
|
+
is_active: null,
|
24
|
+
is_default: null)
|
25
|
+
```
|
26
|
+
|
27
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# DearInventoryRuby::PaymentTerms
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**total** | **String** | Total | [optional]
|
8
|
+
**page** | **String** | Page | [optional]
|
9
|
+
**payment_term_list** | [**Array<PaymentTerm>**](PaymentTerm.md) | Array of PaymentTerms | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'DearInventoryRuby'
|
15
|
+
|
16
|
+
instance = DearInventoryRuby::PaymentTerms.new(total: null,
|
17
|
+
page: null,
|
18
|
+
payment_term_list: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
data/docs/Success.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# DearInventoryRuby::Success
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**success** | **Boolean** | Success | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'DearInventoryRuby'
|
13
|
+
|
14
|
+
instance = DearInventoryRuby::Success.new(success: null)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/docs/Tax.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# DearInventoryRuby::Tax
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique ID | [optional]
|
8
|
+
**name** | **String** | Tax Name |
|
9
|
+
**account** | **String** | ChartOfAccount Code with Class == `LIABILITY` && Status == `ACTIVE` |
|
10
|
+
**is_active** | **Boolean** | Points that tax is Active | [default to true]
|
11
|
+
**tax_inclusive** | **Boolean** | Points that tax is Inclusive | [default to true]
|
12
|
+
**tax_percent** | **Float** | Tax percentage, should be between 0 and 100. Read-only | [optional]
|
13
|
+
**is_tax_for_sale** | **Boolean** | Points that tax is used for Sale | [optional] [default to true]
|
14
|
+
**is_tax_for_purchase** | **Boolean** | Points that tax is used for Purchase | [optional] [default to true]
|
15
|
+
**components** | [**Array<TaxComponent>**](TaxComponent.md) | List of Tax Components | [optional]
|
16
|
+
|
17
|
+
## Code Sample
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'DearInventoryRuby'
|
21
|
+
|
22
|
+
instance = DearInventoryRuby::Tax.new(id: null,
|
23
|
+
name: null,
|
24
|
+
account: null,
|
25
|
+
is_active: null,
|
26
|
+
tax_inclusive: null,
|
27
|
+
tax_percent: null,
|
28
|
+
is_tax_for_sale: null,
|
29
|
+
is_tax_for_purchase: null,
|
30
|
+
components: null)
|
31
|
+
```
|
32
|
+
|
33
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# DearInventoryRuby::TaxComponent
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**name** | **String** | Name of product. Read-only. |
|
8
|
+
**percent** | **Float** | Cost. Required if product type is `Service`. Default value = 0. | [default to 0]
|
9
|
+
**account_code** | **String** | ChartOfAccount Code with Class == `LIABILITY` && Status == `ACTIVE` |
|
10
|
+
**component_order** | **Integer** | The order of sequence taxes components. |
|
11
|
+
|
12
|
+
## Code Sample
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'DearInventoryRuby'
|
16
|
+
|
17
|
+
instance = DearInventoryRuby::TaxComponent.new(name: null,
|
18
|
+
percent: null,
|
19
|
+
account_code: null,
|
20
|
+
component_order: null)
|
21
|
+
```
|
22
|
+
|
23
|
+
|
data/docs/Taxes.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# DearInventoryRuby::Taxes
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**total** | **String** | Total | [optional]
|
8
|
+
**page** | **String** | Page | [optional]
|
9
|
+
**tax_rule_list** | [**Array<Tax>**](Tax.md) | Array of Taxes | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'DearInventoryRuby'
|
15
|
+
|
16
|
+
instance = DearInventoryRuby::Taxes.new(total: null,
|
17
|
+
page: null,
|
18
|
+
tax_rule_list: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
data/lib/dear-inventory-ruby.rb
CHANGED
@@ -17,12 +17,20 @@ require 'dear-inventory-ruby/version'
|
|
17
17
|
require 'dear-inventory-ruby/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
+
require 'dear-inventory-ruby/models/account'
|
21
|
+
require 'dear-inventory-ruby/models/accounts'
|
20
22
|
require 'dear-inventory-ruby/models/address'
|
21
23
|
require 'dear-inventory-ruby/models/contact'
|
22
24
|
require 'dear-inventory-ruby/models/currency_code'
|
23
25
|
require 'dear-inventory-ruby/models/customer'
|
24
26
|
require 'dear-inventory-ruby/models/customers'
|
25
27
|
require 'dear-inventory-ruby/models/error'
|
28
|
+
require 'dear-inventory-ruby/models/payment_term'
|
29
|
+
require 'dear-inventory-ruby/models/payment_terms'
|
30
|
+
require 'dear-inventory-ruby/models/success'
|
31
|
+
require 'dear-inventory-ruby/models/tax'
|
32
|
+
require 'dear-inventory-ruby/models/tax_component'
|
33
|
+
require 'dear-inventory-ruby/models/taxes'
|
26
34
|
|
27
35
|
# APIs
|
28
36
|
require 'dear-inventory-ruby/api/inventory_api'
|
@@ -19,10 +19,75 @@ module DearInventoryRuby
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Allows you to create an Account
|
23
|
+
# @param account [Account] an Account object with properties to create
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
26
|
+
# @return [Accounts]
|
27
|
+
def create_account(account, opts = {})
|
28
|
+
data, _status_code, _headers = create_account_with_http_info(account, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Allows you to create an Account
|
33
|
+
# @param account [Account] an Account object with properties to create
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
36
|
+
# @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
|
37
|
+
def create_account_with_http_info(account, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.create_account ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'account' is set
|
42
|
+
if @api_client.config.client_side_validation && account.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'account' when calling InventoryApi.create_account"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/ref/account'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = opts[:header_params] || {}
|
54
|
+
# HTTP header 'Accept' (if needed)
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
|
+
# HTTP header 'Content-Type'
|
57
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
58
|
+
|
59
|
+
# form parameters
|
60
|
+
form_params = opts[:form_params] || {}
|
61
|
+
|
62
|
+
# http body (model)
|
63
|
+
post_body = opts[:body] || @api_client.object_to_http_body(account)
|
64
|
+
|
65
|
+
# return_type
|
66
|
+
return_type = opts[:return_type] || 'Accounts'
|
67
|
+
|
68
|
+
# auth_names
|
69
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
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(:POST, local_var_path, new_options)
|
81
|
+
if @api_client.config.debugging
|
82
|
+
@api_client.config.logger.debug "API called: InventoryApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
|
+
end
|
84
|
+
return data, status_code, headers
|
85
|
+
end
|
86
|
+
|
22
87
|
# Allows you to create a customer
|
23
|
-
# @param customer [Customer] a
|
88
|
+
# @param customer [Customer] a customer object with properties to create
|
24
89
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created
|
90
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
26
91
|
# @return [Customers]
|
27
92
|
def create_customer(customer, opts = {})
|
28
93
|
data, _status_code, _headers = create_customer_with_http_info(customer, opts)
|
@@ -30,9 +95,9 @@ module DearInventoryRuby
|
|
30
95
|
end
|
31
96
|
|
32
97
|
# Allows you to create a customer
|
33
|
-
# @param customer [Customer] a
|
98
|
+
# @param customer [Customer] a customer object with properties to create
|
34
99
|
# @param [Hash] opts the optional parameters
|
35
|
-
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created
|
100
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
36
101
|
# @return [Array<(Customers, Integer, Hash)>] Customers data, response status code and response headers
|
37
102
|
def create_customer_with_http_info(customer, opts = {})
|
38
103
|
if @api_client.config.debugging
|
@@ -53,17 +118,330 @@ module DearInventoryRuby
|
|
53
118
|
header_params = opts[:header_params] || {}
|
54
119
|
# HTTP header 'Accept' (if needed)
|
55
120
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
|
-
# HTTP header 'Content-Type'
|
57
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
121
|
+
# HTTP header 'Content-Type'
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
123
|
+
|
124
|
+
# form parameters
|
125
|
+
form_params = opts[:form_params] || {}
|
126
|
+
|
127
|
+
# http body (model)
|
128
|
+
post_body = opts[:body] || @api_client.object_to_http_body(customer)
|
129
|
+
|
130
|
+
# return_type
|
131
|
+
return_type = opts[:return_type] || 'Customers'
|
132
|
+
|
133
|
+
# auth_names
|
134
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
135
|
+
|
136
|
+
new_options = opts.merge(
|
137
|
+
:header_params => header_params,
|
138
|
+
:query_params => query_params,
|
139
|
+
:form_params => form_params,
|
140
|
+
:body => post_body,
|
141
|
+
:auth_names => auth_names,
|
142
|
+
:return_type => return_type
|
143
|
+
)
|
144
|
+
|
145
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
146
|
+
if @api_client.config.debugging
|
147
|
+
@api_client.config.logger.debug "API called: InventoryApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
148
|
+
end
|
149
|
+
return data, status_code, headers
|
150
|
+
end
|
151
|
+
|
152
|
+
# Allows you to create a payment term
|
153
|
+
# @param payment_term [PaymentTerm] a payment term object with properties to create
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
156
|
+
# @return [PaymentTerms]
|
157
|
+
def create_payment_term(payment_term, opts = {})
|
158
|
+
data, _status_code, _headers = create_payment_term_with_http_info(payment_term, opts)
|
159
|
+
data
|
160
|
+
end
|
161
|
+
|
162
|
+
# Allows you to create a payment term
|
163
|
+
# @param payment_term [PaymentTerm] a payment term object with properties to create
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
166
|
+
# @return [Array<(PaymentTerms, Integer, Hash)>] PaymentTerms data, response status code and response headers
|
167
|
+
def create_payment_term_with_http_info(payment_term, opts = {})
|
168
|
+
if @api_client.config.debugging
|
169
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.create_payment_term ...'
|
170
|
+
end
|
171
|
+
# verify the required parameter 'payment_term' is set
|
172
|
+
if @api_client.config.client_side_validation && payment_term.nil?
|
173
|
+
fail ArgumentError, "Missing the required parameter 'payment_term' when calling InventoryApi.create_payment_term"
|
174
|
+
end
|
175
|
+
# resource path
|
176
|
+
local_var_path = '/ref/paymentterm'
|
177
|
+
|
178
|
+
# query parameters
|
179
|
+
query_params = opts[:query_params] || {}
|
180
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
181
|
+
|
182
|
+
# header parameters
|
183
|
+
header_params = opts[:header_params] || {}
|
184
|
+
# HTTP header 'Accept' (if needed)
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
186
|
+
# HTTP header 'Content-Type'
|
187
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
188
|
+
|
189
|
+
# form parameters
|
190
|
+
form_params = opts[:form_params] || {}
|
191
|
+
|
192
|
+
# http body (model)
|
193
|
+
post_body = opts[:body] || @api_client.object_to_http_body(payment_term)
|
194
|
+
|
195
|
+
# return_type
|
196
|
+
return_type = opts[:return_type] || 'PaymentTerms'
|
197
|
+
|
198
|
+
# auth_names
|
199
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
200
|
+
|
201
|
+
new_options = opts.merge(
|
202
|
+
:header_params => header_params,
|
203
|
+
:query_params => query_params,
|
204
|
+
:form_params => form_params,
|
205
|
+
:body => post_body,
|
206
|
+
:auth_names => auth_names,
|
207
|
+
:return_type => return_type
|
208
|
+
)
|
209
|
+
|
210
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug "API called: InventoryApi#create_payment_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
213
|
+
end
|
214
|
+
return data, status_code, headers
|
215
|
+
end
|
216
|
+
|
217
|
+
# Allows you to create a tax
|
218
|
+
# @param tax [Tax] a tax object with properties to create
|
219
|
+
# @param [Hash] opts the optional parameters
|
220
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
221
|
+
# @return [Taxes]
|
222
|
+
def create_tax(tax, opts = {})
|
223
|
+
data, _status_code, _headers = create_tax_with_http_info(tax, opts)
|
224
|
+
data
|
225
|
+
end
|
226
|
+
|
227
|
+
# Allows you to create a tax
|
228
|
+
# @param tax [Tax] a tax object with properties to create
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
231
|
+
# @return [Array<(Taxes, Integer, Hash)>] Taxes data, response status code and response headers
|
232
|
+
def create_tax_with_http_info(tax, opts = {})
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.create_tax ...'
|
235
|
+
end
|
236
|
+
# verify the required parameter 'tax' is set
|
237
|
+
if @api_client.config.client_side_validation && tax.nil?
|
238
|
+
fail ArgumentError, "Missing the required parameter 'tax' when calling InventoryApi.create_tax"
|
239
|
+
end
|
240
|
+
# resource path
|
241
|
+
local_var_path = '/ref/tax'
|
242
|
+
|
243
|
+
# query parameters
|
244
|
+
query_params = opts[:query_params] || {}
|
245
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
246
|
+
|
247
|
+
# header parameters
|
248
|
+
header_params = opts[:header_params] || {}
|
249
|
+
# HTTP header 'Accept' (if needed)
|
250
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
251
|
+
# HTTP header 'Content-Type'
|
252
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
253
|
+
|
254
|
+
# form parameters
|
255
|
+
form_params = opts[:form_params] || {}
|
256
|
+
|
257
|
+
# http body (model)
|
258
|
+
post_body = opts[:body] || @api_client.object_to_http_body(tax)
|
259
|
+
|
260
|
+
# return_type
|
261
|
+
return_type = opts[:return_type] || 'Taxes'
|
262
|
+
|
263
|
+
# auth_names
|
264
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
265
|
+
|
266
|
+
new_options = opts.merge(
|
267
|
+
:header_params => header_params,
|
268
|
+
:query_params => query_params,
|
269
|
+
:form_params => form_params,
|
270
|
+
:body => post_body,
|
271
|
+
:auth_names => auth_names,
|
272
|
+
:return_type => return_type
|
273
|
+
)
|
274
|
+
|
275
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
276
|
+
if @api_client.config.debugging
|
277
|
+
@api_client.config.logger.debug "API called: InventoryApi#create_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
278
|
+
end
|
279
|
+
return data, status_code, headers
|
280
|
+
end
|
281
|
+
|
282
|
+
# Allows you to delete an Account
|
283
|
+
# @param [Hash] opts the optional parameters
|
284
|
+
# @option opts [String] :code Code
|
285
|
+
# @return [Success]
|
286
|
+
def delete_account(opts = {})
|
287
|
+
data, _status_code, _headers = delete_account_with_http_info(opts)
|
288
|
+
data
|
289
|
+
end
|
290
|
+
|
291
|
+
# Allows you to delete an Account
|
292
|
+
# @param [Hash] opts the optional parameters
|
293
|
+
# @option opts [String] :code Code
|
294
|
+
# @return [Array<(Success, Integer, Hash)>] Success data, response status code and response headers
|
295
|
+
def delete_account_with_http_info(opts = {})
|
296
|
+
if @api_client.config.debugging
|
297
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.delete_account ...'
|
298
|
+
end
|
299
|
+
# resource path
|
300
|
+
local_var_path = '/ref/account'
|
301
|
+
|
302
|
+
# query parameters
|
303
|
+
query_params = opts[:query_params] || {}
|
304
|
+
query_params[:'Code'] = opts[:'code'] if !opts[:'code'].nil?
|
305
|
+
|
306
|
+
# header parameters
|
307
|
+
header_params = opts[:header_params] || {}
|
308
|
+
# HTTP header 'Accept' (if needed)
|
309
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
310
|
+
|
311
|
+
# form parameters
|
312
|
+
form_params = opts[:form_params] || {}
|
313
|
+
|
314
|
+
# http body (model)
|
315
|
+
post_body = opts[:body]
|
316
|
+
|
317
|
+
# return_type
|
318
|
+
return_type = opts[:return_type] || 'Success'
|
319
|
+
|
320
|
+
# auth_names
|
321
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
322
|
+
|
323
|
+
new_options = opts.merge(
|
324
|
+
:header_params => header_params,
|
325
|
+
:query_params => query_params,
|
326
|
+
:form_params => form_params,
|
327
|
+
:body => post_body,
|
328
|
+
:auth_names => auth_names,
|
329
|
+
:return_type => return_type
|
330
|
+
)
|
331
|
+
|
332
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
333
|
+
if @api_client.config.debugging
|
334
|
+
@api_client.config.logger.debug "API called: InventoryApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
335
|
+
end
|
336
|
+
return data, status_code, headers
|
337
|
+
end
|
338
|
+
|
339
|
+
# Allows you to delete a payment term
|
340
|
+
# @param [Hash] opts the optional parameters
|
341
|
+
# @option opts [String] :id Default is nil
|
342
|
+
# @return [Success]
|
343
|
+
def delete_payment_term(opts = {})
|
344
|
+
data, _status_code, _headers = delete_payment_term_with_http_info(opts)
|
345
|
+
data
|
346
|
+
end
|
347
|
+
|
348
|
+
# Allows you to delete a payment term
|
349
|
+
# @param [Hash] opts the optional parameters
|
350
|
+
# @option opts [String] :id Default is nil
|
351
|
+
# @return [Array<(Success, Integer, Hash)>] Success data, response status code and response headers
|
352
|
+
def delete_payment_term_with_http_info(opts = {})
|
353
|
+
if @api_client.config.debugging
|
354
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.delete_payment_term ...'
|
355
|
+
end
|
356
|
+
# resource path
|
357
|
+
local_var_path = '/ref/paymentterm'
|
358
|
+
|
359
|
+
# query parameters
|
360
|
+
query_params = opts[:query_params] || {}
|
361
|
+
query_params[:'ID'] = opts[:'id'] if !opts[:'id'].nil?
|
362
|
+
|
363
|
+
# header parameters
|
364
|
+
header_params = opts[:header_params] || {}
|
365
|
+
# HTTP header 'Accept' (if needed)
|
366
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
367
|
+
|
368
|
+
# form parameters
|
369
|
+
form_params = opts[:form_params] || {}
|
370
|
+
|
371
|
+
# http body (model)
|
372
|
+
post_body = opts[:body]
|
373
|
+
|
374
|
+
# return_type
|
375
|
+
return_type = opts[:return_type] || 'Success'
|
376
|
+
|
377
|
+
# auth_names
|
378
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
379
|
+
|
380
|
+
new_options = opts.merge(
|
381
|
+
:header_params => header_params,
|
382
|
+
:query_params => query_params,
|
383
|
+
:form_params => form_params,
|
384
|
+
:body => post_body,
|
385
|
+
:auth_names => auth_names,
|
386
|
+
:return_type => return_type
|
387
|
+
)
|
388
|
+
|
389
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
390
|
+
if @api_client.config.debugging
|
391
|
+
@api_client.config.logger.debug "API called: InventoryApi#delete_payment_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
392
|
+
end
|
393
|
+
return data, status_code, headers
|
394
|
+
end
|
395
|
+
|
396
|
+
# Allows you to retrieve the Chart of Accounts
|
397
|
+
# @param [Hash] opts the optional parameters
|
398
|
+
# @option opts [String] :page Default is 1 (default to '1')
|
399
|
+
# @option opts [String] :limit Default is 100 (default to '100')
|
400
|
+
# @option opts [String] :id Default is nil
|
401
|
+
# @option opts [String] :name Default is nil
|
402
|
+
# @option opts [String] :bank Default is nil
|
403
|
+
# @return [Accounts]
|
404
|
+
def get_accounts(opts = {})
|
405
|
+
data, _status_code, _headers = get_accounts_with_http_info(opts)
|
406
|
+
data
|
407
|
+
end
|
408
|
+
|
409
|
+
# Allows you to retrieve the Chart of Accounts
|
410
|
+
# @param [Hash] opts the optional parameters
|
411
|
+
# @option opts [String] :page Default is 1
|
412
|
+
# @option opts [String] :limit Default is 100
|
413
|
+
# @option opts [String] :id Default is nil
|
414
|
+
# @option opts [String] :name Default is nil
|
415
|
+
# @option opts [String] :bank Default is nil
|
416
|
+
# @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
|
417
|
+
def get_accounts_with_http_info(opts = {})
|
418
|
+
if @api_client.config.debugging
|
419
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.get_accounts ...'
|
420
|
+
end
|
421
|
+
# resource path
|
422
|
+
local_var_path = '/ref/account'
|
423
|
+
|
424
|
+
# query parameters
|
425
|
+
query_params = opts[:query_params] || {}
|
426
|
+
query_params[:'Page'] = opts[:'page'] if !opts[:'page'].nil?
|
427
|
+
query_params[:'Limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
428
|
+
query_params[:'ID'] = opts[:'id'] if !opts[:'id'].nil?
|
429
|
+
query_params[:'Name'] = opts[:'name'] if !opts[:'name'].nil?
|
430
|
+
query_params[:'Bank'] = opts[:'bank'] if !opts[:'bank'].nil?
|
431
|
+
|
432
|
+
# header parameters
|
433
|
+
header_params = opts[:header_params] || {}
|
434
|
+
# HTTP header 'Accept' (if needed)
|
435
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
58
436
|
|
59
437
|
# form parameters
|
60
438
|
form_params = opts[:form_params] || {}
|
61
439
|
|
62
440
|
# http body (model)
|
63
|
-
post_body = opts[:body]
|
441
|
+
post_body = opts[:body]
|
64
442
|
|
65
443
|
# return_type
|
66
|
-
return_type = opts[:return_type] || '
|
444
|
+
return_type = opts[:return_type] || 'Accounts'
|
67
445
|
|
68
446
|
# auth_names
|
69
447
|
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
@@ -77,9 +455,9 @@ module DearInventoryRuby
|
|
77
455
|
:return_type => return_type
|
78
456
|
)
|
79
457
|
|
80
|
-
data, status_code, headers = @api_client.call_api(:
|
458
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
81
459
|
if @api_client.config.debugging
|
82
|
-
@api_client.config.logger.debug "API called: InventoryApi#
|
460
|
+
@api_client.config.logger.debug "API called: InventoryApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
461
|
end
|
84
462
|
return data, status_code, headers
|
85
463
|
end
|
@@ -156,10 +534,228 @@ module DearInventoryRuby
|
|
156
534
|
return data, status_code, headers
|
157
535
|
end
|
158
536
|
|
537
|
+
# Allows you to retrieve the payment terms
|
538
|
+
# @param [Hash] opts the optional parameters
|
539
|
+
# @option opts [String] :page Default is 1 (default to '1')
|
540
|
+
# @option opts [String] :limit Default is 100 (default to '100')
|
541
|
+
# @option opts [String] :id Default is nil
|
542
|
+
# @option opts [String] :name Default is nil
|
543
|
+
# @option opts [String] :method Default is nil
|
544
|
+
# @option opts [Boolean] :is_active Default is nil
|
545
|
+
# @option opts [Boolean] :is_default Default is nil
|
546
|
+
# @return [PaymentTerms]
|
547
|
+
def get_payment_terms(opts = {})
|
548
|
+
data, _status_code, _headers = get_payment_terms_with_http_info(opts)
|
549
|
+
data
|
550
|
+
end
|
551
|
+
|
552
|
+
# Allows you to retrieve the payment terms
|
553
|
+
# @param [Hash] opts the optional parameters
|
554
|
+
# @option opts [String] :page Default is 1
|
555
|
+
# @option opts [String] :limit Default is 100
|
556
|
+
# @option opts [String] :id Default is nil
|
557
|
+
# @option opts [String] :name Default is nil
|
558
|
+
# @option opts [String] :method Default is nil
|
559
|
+
# @option opts [Boolean] :is_active Default is nil
|
560
|
+
# @option opts [Boolean] :is_default Default is nil
|
561
|
+
# @return [Array<(PaymentTerms, Integer, Hash)>] PaymentTerms data, response status code and response headers
|
562
|
+
def get_payment_terms_with_http_info(opts = {})
|
563
|
+
if @api_client.config.debugging
|
564
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.get_payment_terms ...'
|
565
|
+
end
|
566
|
+
# resource path
|
567
|
+
local_var_path = '/ref/paymentterm'
|
568
|
+
|
569
|
+
# query parameters
|
570
|
+
query_params = opts[:query_params] || {}
|
571
|
+
query_params[:'Page'] = opts[:'page'] if !opts[:'page'].nil?
|
572
|
+
query_params[:'Limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
573
|
+
query_params[:'ID'] = opts[:'id'] if !opts[:'id'].nil?
|
574
|
+
query_params[:'Name'] = opts[:'name'] if !opts[:'name'].nil?
|
575
|
+
query_params[:'Method'] = opts[:'method'] if !opts[:'method'].nil?
|
576
|
+
query_params[:'IsActive'] = opts[:'is_active'] if !opts[:'is_active'].nil?
|
577
|
+
query_params[:'IsDefault'] = opts[:'is_default'] if !opts[:'is_default'].nil?
|
578
|
+
|
579
|
+
# header parameters
|
580
|
+
header_params = opts[:header_params] || {}
|
581
|
+
# HTTP header 'Accept' (if needed)
|
582
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
583
|
+
|
584
|
+
# form parameters
|
585
|
+
form_params = opts[:form_params] || {}
|
586
|
+
|
587
|
+
# http body (model)
|
588
|
+
post_body = opts[:body]
|
589
|
+
|
590
|
+
# return_type
|
591
|
+
return_type = opts[:return_type] || 'PaymentTerms'
|
592
|
+
|
593
|
+
# auth_names
|
594
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
595
|
+
|
596
|
+
new_options = opts.merge(
|
597
|
+
:header_params => header_params,
|
598
|
+
:query_params => query_params,
|
599
|
+
:form_params => form_params,
|
600
|
+
:body => post_body,
|
601
|
+
:auth_names => auth_names,
|
602
|
+
:return_type => return_type
|
603
|
+
)
|
604
|
+
|
605
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
606
|
+
if @api_client.config.debugging
|
607
|
+
@api_client.config.logger.debug "API called: InventoryApi#get_payment_terms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
608
|
+
end
|
609
|
+
return data, status_code, headers
|
610
|
+
end
|
611
|
+
|
612
|
+
# Allows you to retrieve the taxes
|
613
|
+
# @param [Hash] opts the optional parameters
|
614
|
+
# @option opts [String] :page Default is 1 (default to '1')
|
615
|
+
# @option opts [String] :limit Default is 100 (default to '100')
|
616
|
+
# @option opts [String] :id Default is nil
|
617
|
+
# @option opts [String] :name Default is nil
|
618
|
+
# @option opts [Boolean] :is_active Default is nil
|
619
|
+
# @option opts [Boolean] :is_tax_for_sale Default is nil
|
620
|
+
# @option opts [Boolean] :is_tax_for_purchase Default is nil
|
621
|
+
# @option opts [String] :account Default is nil
|
622
|
+
# @return [Taxes]
|
623
|
+
def get_taxes(opts = {})
|
624
|
+
data, _status_code, _headers = get_taxes_with_http_info(opts)
|
625
|
+
data
|
626
|
+
end
|
627
|
+
|
628
|
+
# Allows you to retrieve the taxes
|
629
|
+
# @param [Hash] opts the optional parameters
|
630
|
+
# @option opts [String] :page Default is 1
|
631
|
+
# @option opts [String] :limit Default is 100
|
632
|
+
# @option opts [String] :id Default is nil
|
633
|
+
# @option opts [String] :name Default is nil
|
634
|
+
# @option opts [Boolean] :is_active Default is nil
|
635
|
+
# @option opts [Boolean] :is_tax_for_sale Default is nil
|
636
|
+
# @option opts [Boolean] :is_tax_for_purchase Default is nil
|
637
|
+
# @option opts [String] :account Default is nil
|
638
|
+
# @return [Array<(Taxes, Integer, Hash)>] Taxes data, response status code and response headers
|
639
|
+
def get_taxes_with_http_info(opts = {})
|
640
|
+
if @api_client.config.debugging
|
641
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.get_taxes ...'
|
642
|
+
end
|
643
|
+
# resource path
|
644
|
+
local_var_path = '/ref/tax'
|
645
|
+
|
646
|
+
# query parameters
|
647
|
+
query_params = opts[:query_params] || {}
|
648
|
+
query_params[:'Page'] = opts[:'page'] if !opts[:'page'].nil?
|
649
|
+
query_params[:'Limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
650
|
+
query_params[:'ID'] = opts[:'id'] if !opts[:'id'].nil?
|
651
|
+
query_params[:'Name'] = opts[:'name'] if !opts[:'name'].nil?
|
652
|
+
query_params[:'IsActive'] = opts[:'is_active'] if !opts[:'is_active'].nil?
|
653
|
+
query_params[:'IsTaxForSale'] = opts[:'is_tax_for_sale'] if !opts[:'is_tax_for_sale'].nil?
|
654
|
+
query_params[:'IsTaxForPurchase'] = opts[:'is_tax_for_purchase'] if !opts[:'is_tax_for_purchase'].nil?
|
655
|
+
query_params[:'Account'] = opts[:'account'] if !opts[:'account'].nil?
|
656
|
+
|
657
|
+
# header parameters
|
658
|
+
header_params = opts[:header_params] || {}
|
659
|
+
# HTTP header 'Accept' (if needed)
|
660
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
661
|
+
|
662
|
+
# form parameters
|
663
|
+
form_params = opts[:form_params] || {}
|
664
|
+
|
665
|
+
# http body (model)
|
666
|
+
post_body = opts[:body]
|
667
|
+
|
668
|
+
# return_type
|
669
|
+
return_type = opts[:return_type] || 'Taxes'
|
670
|
+
|
671
|
+
# auth_names
|
672
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
673
|
+
|
674
|
+
new_options = opts.merge(
|
675
|
+
:header_params => header_params,
|
676
|
+
:query_params => query_params,
|
677
|
+
:form_params => form_params,
|
678
|
+
:body => post_body,
|
679
|
+
:auth_names => auth_names,
|
680
|
+
:return_type => return_type
|
681
|
+
)
|
682
|
+
|
683
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
684
|
+
if @api_client.config.debugging
|
685
|
+
@api_client.config.logger.debug "API called: InventoryApi#get_taxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
686
|
+
end
|
687
|
+
return data, status_code, headers
|
688
|
+
end
|
689
|
+
|
690
|
+
# Allows you to update an Account
|
691
|
+
# @param account [Account] an Account object with properties to update
|
692
|
+
# @param [Hash] opts the optional parameters
|
693
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
694
|
+
# @return [Accounts]
|
695
|
+
def update_account(account, opts = {})
|
696
|
+
data, _status_code, _headers = update_account_with_http_info(account, opts)
|
697
|
+
data
|
698
|
+
end
|
699
|
+
|
700
|
+
# Allows you to update an Account
|
701
|
+
# @param account [Account] an Account object with properties to update
|
702
|
+
# @param [Hash] opts the optional parameters
|
703
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
704
|
+
# @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
|
705
|
+
def update_account_with_http_info(account, opts = {})
|
706
|
+
if @api_client.config.debugging
|
707
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.update_account ...'
|
708
|
+
end
|
709
|
+
# verify the required parameter 'account' is set
|
710
|
+
if @api_client.config.client_side_validation && account.nil?
|
711
|
+
fail ArgumentError, "Missing the required parameter 'account' when calling InventoryApi.update_account"
|
712
|
+
end
|
713
|
+
# resource path
|
714
|
+
local_var_path = '/ref/account'
|
715
|
+
|
716
|
+
# query parameters
|
717
|
+
query_params = opts[:query_params] || {}
|
718
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
719
|
+
|
720
|
+
# header parameters
|
721
|
+
header_params = opts[:header_params] || {}
|
722
|
+
# HTTP header 'Accept' (if needed)
|
723
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
724
|
+
# HTTP header 'Content-Type'
|
725
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
726
|
+
|
727
|
+
# form parameters
|
728
|
+
form_params = opts[:form_params] || {}
|
729
|
+
|
730
|
+
# http body (model)
|
731
|
+
post_body = opts[:body] || @api_client.object_to_http_body(account)
|
732
|
+
|
733
|
+
# return_type
|
734
|
+
return_type = opts[:return_type] || 'Accounts'
|
735
|
+
|
736
|
+
# auth_names
|
737
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
738
|
+
|
739
|
+
new_options = opts.merge(
|
740
|
+
:header_params => header_params,
|
741
|
+
:query_params => query_params,
|
742
|
+
:form_params => form_params,
|
743
|
+
:body => post_body,
|
744
|
+
:auth_names => auth_names,
|
745
|
+
:return_type => return_type
|
746
|
+
)
|
747
|
+
|
748
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
749
|
+
if @api_client.config.debugging
|
750
|
+
@api_client.config.logger.debug "API called: InventoryApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
751
|
+
end
|
752
|
+
return data, status_code, headers
|
753
|
+
end
|
754
|
+
|
159
755
|
# Allows you to update a customer
|
160
|
-
# @param customer [Customer] a
|
756
|
+
# @param customer [Customer] a customer object with properties to update
|
161
757
|
# @param [Hash] opts the optional parameters
|
162
|
-
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created
|
758
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
163
759
|
# @return [Customers]
|
164
760
|
def update_customer(customer, opts = {})
|
165
761
|
data, _status_code, _headers = update_customer_with_http_info(customer, opts)
|
@@ -167,9 +763,9 @@ module DearInventoryRuby
|
|
167
763
|
end
|
168
764
|
|
169
765
|
# Allows you to update a customer
|
170
|
-
# @param customer [Customer] a
|
766
|
+
# @param customer [Customer] a customer object with properties to update
|
171
767
|
# @param [Hash] opts the optional parameters
|
172
|
-
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created
|
768
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
173
769
|
# @return [Array<(Customers, Integer, Hash)>] Customers data, response status code and response headers
|
174
770
|
def update_customer_with_http_info(customer, opts = {})
|
175
771
|
if @api_client.config.debugging
|
@@ -220,5 +816,135 @@ module DearInventoryRuby
|
|
220
816
|
end
|
221
817
|
return data, status_code, headers
|
222
818
|
end
|
819
|
+
|
820
|
+
# Allows you to update a payment term
|
821
|
+
# @param payment_term [PaymentTerm] a payment term object with properties to update
|
822
|
+
# @param [Hash] opts the optional parameters
|
823
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
824
|
+
# @return [PaymentTerms]
|
825
|
+
def update_payment_term(payment_term, opts = {})
|
826
|
+
data, _status_code, _headers = update_payment_term_with_http_info(payment_term, opts)
|
827
|
+
data
|
828
|
+
end
|
829
|
+
|
830
|
+
# Allows you to update a payment term
|
831
|
+
# @param payment_term [PaymentTerm] a payment term object with properties to update
|
832
|
+
# @param [Hash] opts the optional parameters
|
833
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
834
|
+
# @return [Array<(PaymentTerms, Integer, Hash)>] PaymentTerms data, response status code and response headers
|
835
|
+
def update_payment_term_with_http_info(payment_term, opts = {})
|
836
|
+
if @api_client.config.debugging
|
837
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.update_payment_term ...'
|
838
|
+
end
|
839
|
+
# verify the required parameter 'payment_term' is set
|
840
|
+
if @api_client.config.client_side_validation && payment_term.nil?
|
841
|
+
fail ArgumentError, "Missing the required parameter 'payment_term' when calling InventoryApi.update_payment_term"
|
842
|
+
end
|
843
|
+
# resource path
|
844
|
+
local_var_path = '/ref/paymentterm'
|
845
|
+
|
846
|
+
# query parameters
|
847
|
+
query_params = opts[:query_params] || {}
|
848
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
849
|
+
|
850
|
+
# header parameters
|
851
|
+
header_params = opts[:header_params] || {}
|
852
|
+
# HTTP header 'Accept' (if needed)
|
853
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
854
|
+
# HTTP header 'Content-Type'
|
855
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
856
|
+
|
857
|
+
# form parameters
|
858
|
+
form_params = opts[:form_params] || {}
|
859
|
+
|
860
|
+
# http body (model)
|
861
|
+
post_body = opts[:body] || @api_client.object_to_http_body(payment_term)
|
862
|
+
|
863
|
+
# return_type
|
864
|
+
return_type = opts[:return_type] || 'PaymentTerms'
|
865
|
+
|
866
|
+
# auth_names
|
867
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
868
|
+
|
869
|
+
new_options = opts.merge(
|
870
|
+
:header_params => header_params,
|
871
|
+
:query_params => query_params,
|
872
|
+
:form_params => form_params,
|
873
|
+
:body => post_body,
|
874
|
+
:auth_names => auth_names,
|
875
|
+
:return_type => return_type
|
876
|
+
)
|
877
|
+
|
878
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
879
|
+
if @api_client.config.debugging
|
880
|
+
@api_client.config.logger.debug "API called: InventoryApi#update_payment_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
881
|
+
end
|
882
|
+
return data, status_code, headers
|
883
|
+
end
|
884
|
+
|
885
|
+
# Allows you to update a tax
|
886
|
+
# @param tax [Tax] a tax object with properties to update
|
887
|
+
# @param [Hash] opts the optional parameters
|
888
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
|
889
|
+
# @return [Taxes]
|
890
|
+
def update_tax(tax, opts = {})
|
891
|
+
data, _status_code, _headers = update_tax_with_http_info(tax, opts)
|
892
|
+
data
|
893
|
+
end
|
894
|
+
|
895
|
+
# Allows you to update a tax
|
896
|
+
# @param tax [Tax] a tax object with properties to update
|
897
|
+
# @param [Hash] opts the optional parameters
|
898
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
|
899
|
+
# @return [Array<(Taxes, Integer, Hash)>] Taxes data, response status code and response headers
|
900
|
+
def update_tax_with_http_info(tax, opts = {})
|
901
|
+
if @api_client.config.debugging
|
902
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.update_tax ...'
|
903
|
+
end
|
904
|
+
# verify the required parameter 'tax' is set
|
905
|
+
if @api_client.config.client_side_validation && tax.nil?
|
906
|
+
fail ArgumentError, "Missing the required parameter 'tax' when calling InventoryApi.update_tax"
|
907
|
+
end
|
908
|
+
# resource path
|
909
|
+
local_var_path = '/ref/tax'
|
910
|
+
|
911
|
+
# query parameters
|
912
|
+
query_params = opts[:query_params] || {}
|
913
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
914
|
+
|
915
|
+
# header parameters
|
916
|
+
header_params = opts[:header_params] || {}
|
917
|
+
# HTTP header 'Accept' (if needed)
|
918
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
919
|
+
# HTTP header 'Content-Type'
|
920
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
921
|
+
|
922
|
+
# form parameters
|
923
|
+
form_params = opts[:form_params] || {}
|
924
|
+
|
925
|
+
# http body (model)
|
926
|
+
post_body = opts[:body] || @api_client.object_to_http_body(tax)
|
927
|
+
|
928
|
+
# return_type
|
929
|
+
return_type = opts[:return_type] || 'Taxes'
|
930
|
+
|
931
|
+
# auth_names
|
932
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
933
|
+
|
934
|
+
new_options = opts.merge(
|
935
|
+
:header_params => header_params,
|
936
|
+
:query_params => query_params,
|
937
|
+
:form_params => form_params,
|
938
|
+
:body => post_body,
|
939
|
+
:auth_names => auth_names,
|
940
|
+
:return_type => return_type
|
941
|
+
)
|
942
|
+
|
943
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
944
|
+
if @api_client.config.debugging
|
945
|
+
@api_client.config.logger.debug "API called: InventoryApi#update_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
946
|
+
end
|
947
|
+
return data, status_code, headers
|
948
|
+
end
|
223
949
|
end
|
224
950
|
end
|