dear-inventory-ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +11 -13
- data/docs/CustomerApi.md +130 -6
- data/lib/dear-inventory-ruby/api/customer_api.rb +136 -6
- data/lib/dear-inventory-ruby/version.rb +1 -1
- data/spec/api/customer_api_spec.rb +27 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dff2dd2854dc010573a01fef8850fbed92d849fbf8f24036207cf027f06b5dc
|
4
|
+
data.tar.gz: 74e59f417ce3c62467ba1a4e90399276549367bcad67793caafd3f3a2c717903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 969bbc6cf2a790f27797254df011fe1525be5d79a35603c4ae493983dbdf1b0c69ffc15e3ad6b02e24c7c8a0758292c197f0e86969e7a4ea2bfb4aba47038894
|
7
|
+
data.tar.gz: a22d8e7a5e6103674d1b94412cf287304e40a69b802f4f8b195d082e756a71787ff8dbf161b427d9000defb2967a79200be837276cb230e69f5d06d8b0199ef9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This specifing endpoints for DEAR Inventory API
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 0.1.
|
10
|
+
- Package version: 0.1.3
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [https://www.nnhan.me](https://www.nnhan.me)
|
13
13
|
|
@@ -24,16 +24,16 @@ gem build dear-inventory-ruby.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./dear-inventory-ruby-0.1.
|
27
|
+
gem install ./dear-inventory-ruby-0.1.3.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./dear-inventory-ruby-0.1.
|
30
|
+
(for development, run `gem install --dev ./dear-inventory-ruby-0.1.3.gem` to install the development dependencies)
|
31
31
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
33
|
|
34
34
|
Finally add this to the Gemfile:
|
35
35
|
|
36
|
-
gem 'dear-inventory-ruby', '~> 0.1.
|
36
|
+
gem 'dear-inventory-ruby', '~> 0.1.3'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -71,21 +71,17 @@ DearInventoryRuby.configure do |config|
|
|
71
71
|
end
|
72
72
|
|
73
73
|
api_instance = DearInventoryRuby::CustomerApi.new
|
74
|
+
customer = { "Name": "DIISR - Small Business Services customer", "Currency": "AUD", "PaymentTerm": "30 days", "Discount": 0, "TaxRule": "GST Free Exports", "Carrier": "DEFAULT Carrier", "SalesRepresentative": nil, "Location": "Main Warehouse", "Comments": nil, "AccountReceivable": "610", "RevenueAccount": "200", "PriceTier": "Tier 1", "TaxNumber": nil, "AdditionalAttribute1": nil, "AdditionalAttribute2": nil, "AdditionalAttribute3": nil, "AdditionalAttribute4": nil, "AdditionalAttribute5": nil, "AdditionalAttribute6": nil, "AdditionalAttribute7": nil, "AdditionalAttribute8": nil, "AdditionalAttribute9": nil, "AdditionalAttribute10": nil, "AttributeSet": nil, "Tags": nil, "Status": "Active", "Addresses": [ { "ID": "4bc4e423-d8af-454d-a186-4a827c15bd0b", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Business", "DefaultForType": true }, { "ID": "35cec087-04da-46b5-b3c8-c3a7311f2417", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Billing", "DefaultForType": true } ], "Contacts": [ { "ID": "1d62f59b-657d-423f-ad95-9ad9ec4f29a3", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Name": "Sheree Bond", "JobTitle": nil, "Phone": "0800 4389376", "MobilePhone": nil, "Fax": "03 4389379", "Email": "accounts@diisr.govt", "Website": nil, "Default": true, "Comment": nil, "IncludeInEmail": false } ] } # Customer | a Contact object with properties to create
|
74
75
|
opts = {
|
75
|
-
|
76
|
-
limit: '100', # String | Default is 100
|
77
|
-
id: 'id_example', # String | Default is null
|
78
|
-
name: 'name_example', # String | Default is null
|
79
|
-
modified_since: 'modified_since_example', # String | Default is null
|
80
|
-
include_deprecated: 'false' # String | Default is false
|
76
|
+
summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
81
77
|
}
|
82
78
|
|
83
79
|
begin
|
84
|
-
#Allows you to
|
85
|
-
result = api_instance.
|
80
|
+
#Allows you to create a customer
|
81
|
+
result = api_instance.create_customer(customer, opts)
|
86
82
|
p result
|
87
83
|
rescue DearInventoryRuby::ApiError => e
|
88
|
-
puts "Exception when calling CustomerApi->
|
84
|
+
puts "Exception when calling CustomerApi->create_customer: #{e}"
|
89
85
|
end
|
90
86
|
|
91
87
|
```
|
@@ -96,7 +92,9 @@ All URIs are relative to *https://inventory.dearsystems.com/ExternalApi/v2*
|
|
96
92
|
|
97
93
|
Class | Method | HTTP request | Description
|
98
94
|
------------ | ------------- | ------------- | -------------
|
95
|
+
*DearInventoryRuby::CustomerApi* | [**create_customer**](docs/CustomerApi.md#create_customer) | **POST** /customer | Allows you to create a customer
|
99
96
|
*DearInventoryRuby::CustomerApi* | [**get_customers**](docs/CustomerApi.md#get_customers) | **GET** /customer | Allows you to retrieve the customers
|
97
|
+
*DearInventoryRuby::CustomerApi* | [**update_customer**](docs/CustomerApi.md#update_customer) | **PUT** /customer | Allows you to update a customer
|
100
98
|
|
101
99
|
|
102
100
|
## Documentation for Models
|
data/docs/CustomerApi.md
CHANGED
@@ -4,10 +4,73 @@ All URIs are relative to *https://inventory.dearsystems.com/ExternalApi/v2*
|
|
4
4
|
|
5
5
|
Method | HTTP request | Description
|
6
6
|
------------- | ------------- | -------------
|
7
|
+
[**create_customer**](CustomerApi.md#create_customer) | **POST** /customer | Allows you to create a customer
|
7
8
|
[**get_customers**](CustomerApi.md#get_customers) | **GET** /customer | Allows you to retrieve the customers
|
9
|
+
[**update_customer**](CustomerApi.md#update_customer) | **PUT** /customer | Allows you to update a customer
|
8
10
|
|
9
11
|
|
10
12
|
|
13
|
+
## create_customer
|
14
|
+
|
15
|
+
> Customers create_customer(customer, opts)
|
16
|
+
|
17
|
+
Allows you to create a customer
|
18
|
+
|
19
|
+
### Example
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
# load the gem
|
23
|
+
require 'dear-inventory-ruby'
|
24
|
+
# setup authorization
|
25
|
+
DearInventoryRuby.configure do |config|
|
26
|
+
# Configure API key authorization: accountID
|
27
|
+
config.api_key['api-auth-accountid'] = '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['api-auth-accountid'] = 'Bearer'
|
30
|
+
|
31
|
+
# Configure API key authorization: appKey
|
32
|
+
config.api_key['api-auth-applicationkey'] = 'YOUR API KEY'
|
33
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
34
|
+
#config.api_key_prefix['api-auth-applicationkey'] = 'Bearer'
|
35
|
+
end
|
36
|
+
|
37
|
+
api_instance = DearInventoryRuby::CustomerApi.new
|
38
|
+
customer = { "Name": "DIISR - Small Business Services customer", "Currency": "AUD", "PaymentTerm": "30 days", "Discount": 0, "TaxRule": "GST Free Exports", "Carrier": "DEFAULT Carrier", "SalesRepresentative": nil, "Location": "Main Warehouse", "Comments": nil, "AccountReceivable": "610", "RevenueAccount": "200", "PriceTier": "Tier 1", "TaxNumber": nil, "AdditionalAttribute1": nil, "AdditionalAttribute2": nil, "AdditionalAttribute3": nil, "AdditionalAttribute4": nil, "AdditionalAttribute5": nil, "AdditionalAttribute6": nil, "AdditionalAttribute7": nil, "AdditionalAttribute8": nil, "AdditionalAttribute9": nil, "AdditionalAttribute10": nil, "AttributeSet": nil, "Tags": nil, "Status": "Active", "Addresses": [ { "ID": "4bc4e423-d8af-454d-a186-4a827c15bd0b", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Business", "DefaultForType": true }, { "ID": "35cec087-04da-46b5-b3c8-c3a7311f2417", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Billing", "DefaultForType": true } ], "Contacts": [ { "ID": "1d62f59b-657d-423f-ad95-9ad9ec4f29a3", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Name": "Sheree Bond", "JobTitle": nil, "Phone": "0800 4389376", "MobilePhone": nil, "Fax": "03 4389379", "Email": "accounts@diisr.govt", "Website": nil, "Default": true, "Comment": nil, "IncludeInEmail": false } ] } # Customer | a Contact object with properties to create
|
39
|
+
opts = {
|
40
|
+
summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
41
|
+
}
|
42
|
+
|
43
|
+
begin
|
44
|
+
#Allows you to create a customer
|
45
|
+
result = api_instance.create_customer(customer, opts)
|
46
|
+
p result
|
47
|
+
rescue DearInventoryRuby::ApiError => e
|
48
|
+
puts "Exception when calling CustomerApi->create_customer: #{e}"
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
### Parameters
|
53
|
+
|
54
|
+
|
55
|
+
Name | Type | Description | Notes
|
56
|
+
------------- | ------------- | ------------- | -------------
|
57
|
+
**customer** | [**Customer**](Customer.md)| a Contact object with properties to create |
|
58
|
+
**summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false]
|
59
|
+
|
60
|
+
### Return type
|
61
|
+
|
62
|
+
[**Customers**](Customers.md)
|
63
|
+
|
64
|
+
### Authorization
|
65
|
+
|
66
|
+
[accountID](../README.md#accountID), [appKey](../README.md#appKey)
|
67
|
+
|
68
|
+
### HTTP request headers
|
69
|
+
|
70
|
+
- **Content-Type**: application/json
|
71
|
+
- **Accept**: application/json
|
72
|
+
|
73
|
+
|
11
74
|
## get_customers
|
12
75
|
|
13
76
|
> Customers get_customers(opts)
|
@@ -36,9 +99,9 @@ api_instance = DearInventoryRuby::CustomerApi.new
|
|
36
99
|
opts = {
|
37
100
|
page: '1', # String | Default is 1
|
38
101
|
limit: '100', # String | Default is 100
|
39
|
-
id: 'id_example', # String | Default is
|
40
|
-
name: 'name_example', # String | Default is
|
41
|
-
modified_since: 'modified_since_example', # String | Default is
|
102
|
+
id: 'id_example', # String | Default is nil
|
103
|
+
name: 'name_example', # String | Default is nil
|
104
|
+
modified_since: 'modified_since_example', # String | Default is nil
|
42
105
|
include_deprecated: 'false' # String | Default is false
|
43
106
|
}
|
44
107
|
|
@@ -58,9 +121,9 @@ Name | Type | Description | Notes
|
|
58
121
|
------------- | ------------- | ------------- | -------------
|
59
122
|
**page** | **String**| Default is 1 | [optional] [default to '1']
|
60
123
|
**limit** | **String**| Default is 100 | [optional] [default to '100']
|
61
|
-
**id** | **String**| Default is
|
62
|
-
**name** | **String**| Default is
|
63
|
-
**modified_since** | **String**| Default is
|
124
|
+
**id** | **String**| Default is nil | [optional]
|
125
|
+
**name** | **String**| Default is nil | [optional]
|
126
|
+
**modified_since** | **String**| Default is nil | [optional]
|
64
127
|
**include_deprecated** | **String**| Default is false | [optional] [default to 'false']
|
65
128
|
|
66
129
|
### Return type
|
@@ -76,3 +139,64 @@ Name | Type | Description | Notes
|
|
76
139
|
- **Content-Type**: Not defined
|
77
140
|
- **Accept**: application/json
|
78
141
|
|
142
|
+
|
143
|
+
## update_customer
|
144
|
+
|
145
|
+
> Customers update_customer(customer, opts)
|
146
|
+
|
147
|
+
Allows you to update a customer
|
148
|
+
|
149
|
+
### Example
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
# load the gem
|
153
|
+
require 'dear-inventory-ruby'
|
154
|
+
# setup authorization
|
155
|
+
DearInventoryRuby.configure do |config|
|
156
|
+
# Configure API key authorization: accountID
|
157
|
+
config.api_key['api-auth-accountid'] = 'YOUR API KEY'
|
158
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
159
|
+
#config.api_key_prefix['api-auth-accountid'] = 'Bearer'
|
160
|
+
|
161
|
+
# Configure API key authorization: appKey
|
162
|
+
config.api_key['api-auth-applicationkey'] = 'YOUR API KEY'
|
163
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
164
|
+
#config.api_key_prefix['api-auth-applicationkey'] = 'Bearer'
|
165
|
+
end
|
166
|
+
|
167
|
+
api_instance = DearInventoryRuby::CustomerApi.new
|
168
|
+
customer = { "ID": "7d6b441a-3067-42b1-9b81-2def95df827b", "Name": "DIISR - Small Business Services customer", "Currency": "AUD", "PaymentTerm": "30 days", "Discount": 0, "TaxRule": "GST Free Exports", "Carrier": "DEFAULT Carrier", "SalesRepresentative": nil, "Location": "Main Warehouse", "Comments": nil, "AccountReceivable": "610", "RevenueAccount": "200", "PriceTier": "Tier 1", "TaxNumber": nil, "AdditionalAttribute1": nil, "AdditionalAttribute2": nil, "AdditionalAttribute3": nil, "AdditionalAttribute4": nil, "AdditionalAttribute5": nil, "AdditionalAttribute6": nil, "AdditionalAttribute7": nil, "AdditionalAttribute8": nil, "AdditionalAttribute9": nil, "AdditionalAttribute10": nil, "AttributeSet": nil, "Tags": nil, "Status": "Active", "Addresses": [ { "ID": "4bc4e423-d8af-454d-a186-4a827c15bd0b", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Business", "DefaultForType": true }, { "ID": "35cec087-04da-46b5-b3c8-c3a7311f2417", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Line1": "L3, Southbank House", "Line2": "13 Gallery Ave", "City": "Melbourne", "State": "VIC", "Postcode": "3131", "Country": nil, "Type": "Billing", "DefaultForType": true } ], "Contacts": [ { "ID": "1d62f59b-657d-423f-ad95-9ad9ec4f29a3", "CustomerID": "4978c3ff-4382-4045-819b-2971480ddaf1", "Name": "Sheree Bond", "JobTitle": nil, "Phone": "0800 4389376", "MobilePhone": nil, "Fax": "03 4389379", "Email": "accounts@diisr.govt", "Website": nil, "Default": true, "Comment": nil, "IncludeInEmail": false } ] } # Customer | a Contact object with properties to create
|
169
|
+
opts = {
|
170
|
+
summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
171
|
+
}
|
172
|
+
|
173
|
+
begin
|
174
|
+
#Allows you to update a customer
|
175
|
+
result = api_instance.update_customer(customer, opts)
|
176
|
+
p result
|
177
|
+
rescue DearInventoryRuby::ApiError => e
|
178
|
+
puts "Exception when calling CustomerApi->update_customer: #{e}"
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
182
|
+
### Parameters
|
183
|
+
|
184
|
+
|
185
|
+
Name | Type | Description | Notes
|
186
|
+
------------- | ------------- | ------------- | -------------
|
187
|
+
**customer** | [**Customer**](Customer.md)| a Contact object with properties to create |
|
188
|
+
**summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false]
|
189
|
+
|
190
|
+
### Return type
|
191
|
+
|
192
|
+
[**Customers**](Customers.md)
|
193
|
+
|
194
|
+
### Authorization
|
195
|
+
|
196
|
+
[accountID](../README.md#accountID), [appKey](../README.md#appKey)
|
197
|
+
|
198
|
+
### HTTP request headers
|
199
|
+
|
200
|
+
- **Content-Type**: application/json
|
201
|
+
- **Accept**: application/json
|
202
|
+
|
@@ -19,13 +19,78 @@ module DearInventoryRuby
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Allows you to create a customer
|
23
|
+
# @param customer [Customer] a Contact 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 obejcts and any with validation errors (default to false)
|
26
|
+
# @return [Customers]
|
27
|
+
def create_customer(customer, opts = {})
|
28
|
+
data, _status_code, _headers = create_customer_with_http_info(customer, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Allows you to create a customer
|
33
|
+
# @param customer [Customer] a Contact 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 obejcts and any with validation errors
|
36
|
+
# @return [Array<(Customers, Integer, Hash)>] Customers data, response status code and response headers
|
37
|
+
def create_customer_with_http_info(customer, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.create_customer ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'customer' is set
|
42
|
+
if @api_client.config.client_side_validation && customer.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.create_customer"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/customer'
|
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(customer)
|
64
|
+
|
65
|
+
# return_type
|
66
|
+
return_type = opts[:return_type] || 'Customers'
|
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: CustomerApi#create_customer\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 retrieve the customers
|
23
88
|
# @param [Hash] opts the optional parameters
|
24
89
|
# @option opts [String] :page Default is 1 (default to '1')
|
25
90
|
# @option opts [String] :limit Default is 100 (default to '100')
|
26
|
-
# @option opts [String] :id Default is
|
27
|
-
# @option opts [String] :name Default is
|
28
|
-
# @option opts [String] :modified_since Default is
|
91
|
+
# @option opts [String] :id Default is nil
|
92
|
+
# @option opts [String] :name Default is nil
|
93
|
+
# @option opts [String] :modified_since Default is nil
|
29
94
|
# @option opts [String] :include_deprecated Default is false (default to 'false')
|
30
95
|
# @return [Customers]
|
31
96
|
def get_customers(opts = {})
|
@@ -37,9 +102,9 @@ module DearInventoryRuby
|
|
37
102
|
# @param [Hash] opts the optional parameters
|
38
103
|
# @option opts [String] :page Default is 1
|
39
104
|
# @option opts [String] :limit Default is 100
|
40
|
-
# @option opts [String] :id Default is
|
41
|
-
# @option opts [String] :name Default is
|
42
|
-
# @option opts [String] :modified_since Default is
|
105
|
+
# @option opts [String] :id Default is nil
|
106
|
+
# @option opts [String] :name Default is nil
|
107
|
+
# @option opts [String] :modified_since Default is nil
|
43
108
|
# @option opts [String] :include_deprecated Default is false
|
44
109
|
# @return [Array<(Customers, Integer, Hash)>] Customers data, response status code and response headers
|
45
110
|
def get_customers_with_http_info(opts = {})
|
@@ -90,5 +155,70 @@ module DearInventoryRuby
|
|
90
155
|
end
|
91
156
|
return data, status_code, headers
|
92
157
|
end
|
158
|
+
|
159
|
+
# Allows you to update a customer
|
160
|
+
# @param customer [Customer] a Contact object with properties to create
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
|
163
|
+
# @return [Customers]
|
164
|
+
def update_customer(customer, opts = {})
|
165
|
+
data, _status_code, _headers = update_customer_with_http_info(customer, opts)
|
166
|
+
data
|
167
|
+
end
|
168
|
+
|
169
|
+
# Allows you to update a customer
|
170
|
+
# @param customer [Customer] a Contact object with properties to create
|
171
|
+
# @param [Hash] opts the optional parameters
|
172
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
173
|
+
# @return [Array<(Customers, Integer, Hash)>] Customers data, response status code and response headers
|
174
|
+
def update_customer_with_http_info(customer, opts = {})
|
175
|
+
if @api_client.config.debugging
|
176
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.update_customer ...'
|
177
|
+
end
|
178
|
+
# verify the required parameter 'customer' is set
|
179
|
+
if @api_client.config.client_side_validation && customer.nil?
|
180
|
+
fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.update_customer"
|
181
|
+
end
|
182
|
+
# resource path
|
183
|
+
local_var_path = '/customer'
|
184
|
+
|
185
|
+
# query parameters
|
186
|
+
query_params = opts[:query_params] || {}
|
187
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
188
|
+
|
189
|
+
# header parameters
|
190
|
+
header_params = opts[:header_params] || {}
|
191
|
+
# HTTP header 'Accept' (if needed)
|
192
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
193
|
+
# HTTP header 'Content-Type'
|
194
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
195
|
+
|
196
|
+
# form parameters
|
197
|
+
form_params = opts[:form_params] || {}
|
198
|
+
|
199
|
+
# http body (model)
|
200
|
+
post_body = opts[:body] || @api_client.object_to_http_body(customer)
|
201
|
+
|
202
|
+
# return_type
|
203
|
+
return_type = opts[:return_type] || 'Customers'
|
204
|
+
|
205
|
+
# auth_names
|
206
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
207
|
+
|
208
|
+
new_options = opts.merge(
|
209
|
+
:header_params => header_params,
|
210
|
+
:query_params => query_params,
|
211
|
+
:form_params => form_params,
|
212
|
+
:body => post_body,
|
213
|
+
:auth_names => auth_names,
|
214
|
+
:return_type => return_type
|
215
|
+
)
|
216
|
+
|
217
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
218
|
+
if @api_client.config.debugging
|
219
|
+
@api_client.config.logger.debug "API called: CustomerApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
220
|
+
end
|
221
|
+
return data, status_code, headers
|
222
|
+
end
|
93
223
|
end
|
94
224
|
end
|
@@ -32,14 +32,26 @@ describe 'CustomerApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# unit tests for create_customer
|
36
|
+
# Allows you to create a customer
|
37
|
+
# @param customer a Contact object with properties to create
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
40
|
+
# @return [Customers]
|
41
|
+
describe 'create_customer test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
# unit tests for get_customers
|
36
48
|
# Allows you to retrieve the customers
|
37
49
|
# @param [Hash] opts the optional parameters
|
38
50
|
# @option opts [String] :page Default is 1
|
39
51
|
# @option opts [String] :limit Default is 100
|
40
|
-
# @option opts [String] :id Default is
|
41
|
-
# @option opts [String] :name Default is
|
42
|
-
# @option opts [String] :modified_since Default is
|
52
|
+
# @option opts [String] :id Default is nil
|
53
|
+
# @option opts [String] :name Default is nil
|
54
|
+
# @option opts [String] :modified_since Default is nil
|
43
55
|
# @option opts [String] :include_deprecated Default is false
|
44
56
|
# @return [Customers]
|
45
57
|
describe 'get_customers test' do
|
@@ -48,4 +60,16 @@ describe 'CustomerApi' do
|
|
48
60
|
end
|
49
61
|
end
|
50
62
|
|
63
|
+
# unit tests for update_customer
|
64
|
+
# Allows you to update a customer
|
65
|
+
# @param customer a Contact object with properties to create
|
66
|
+
# @param [Hash] opts the optional parameters
|
67
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
68
|
+
# @return [Customers]
|
69
|
+
describe 'update_customer test' do
|
70
|
+
it 'should work' do
|
71
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
51
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dear-inventory-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nhan Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|