dear-inventory-ruby 0.1.8 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/Gemfile +1 -1
- data/README.md +11 -4
- data/dear-inventory-ruby.gemspec +1 -1
- data/docs/Account.md +15 -15
- data/docs/Accounts.md +3 -3
- data/docs/Address.md +9 -9
- data/docs/Contact.md +13 -9
- data/docs/Customer.md +33 -31
- data/docs/Customers.md +3 -3
- data/docs/DimensionsUnit.md +16 -0
- data/docs/Error.md +2 -2
- data/docs/InventoryApi.md +108 -0
- data/docs/Me.md +29 -0
- data/docs/PaymentTerm.md +6 -6
- data/docs/PaymentTerms.md +3 -3
- data/docs/PriceTier.md +19 -0
- data/docs/PriceTiers.md +17 -0
- data/docs/Success.md +1 -1
- data/docs/Tax.md +9 -9
- data/docs/TaxComponent.md +4 -4
- data/docs/Taxes.md +3 -3
- data/docs/WeightUnit.md +16 -0
- data/lib/dear-inventory-ruby.rb +6 -1
- data/lib/dear-inventory-ruby/api/inventory_api.rb +109 -1
- data/lib/dear-inventory-ruby/api_client.rb +8 -6
- data/lib/dear-inventory-ruby/api_error.rb +1 -1
- data/lib/dear-inventory-ruby/configuration.rb +1 -1
- data/lib/dear-inventory-ruby/models/account.rb +1 -1
- data/lib/dear-inventory-ruby/models/accounts.rb +1 -1
- data/lib/dear-inventory-ruby/models/address.rb +1 -35
- data/lib/dear-inventory-ruby/models/contact.rb +22 -2
- data/lib/dear-inventory-ruby/models/currency_code.rb +1 -1
- data/lib/dear-inventory-ruby/models/customer.rb +19 -7
- data/lib/dear-inventory-ruby/models/customers.rb +1 -1
- data/lib/dear-inventory-ruby/models/dimensions_unit.rb +42 -0
- data/lib/dear-inventory-ruby/models/error.rb +1 -1
- data/lib/dear-inventory-ruby/models/me.rb +264 -0
- data/lib/dear-inventory-ruby/models/payment_term.rb +1 -1
- data/lib/dear-inventory-ruby/models/payment_terms.rb +1 -1
- data/lib/dear-inventory-ruby/models/price_tier.rb +217 -0
- data/lib/dear-inventory-ruby/models/price_tiers.rb +209 -0
- data/lib/dear-inventory-ruby/models/success.rb +1 -1
- data/lib/dear-inventory-ruby/models/tax.rb +1 -1
- data/lib/dear-inventory-ruby/models/tax_component.rb +1 -1
- data/lib/dear-inventory-ruby/models/taxes.rb +1 -1
- data/lib/dear-inventory-ruby/models/weight_unit.rb +39 -0
- data/lib/dear-inventory-ruby/version.rb +2 -2
- data/pkg/dear-inventory-ruby-0.1.13.gem +0 -0
- data/spec/api/inventory_api_spec.rb +21 -1
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/account_spec.rb +1 -1
- data/spec/models/accounts_spec.rb +1 -1
- data/spec/models/address_spec.rb +1 -5
- data/spec/models/contact_spec.rb +13 -1
- data/spec/models/currency_code_spec.rb +1 -1
- data/spec/models/customer_spec.rb +7 -1
- data/spec/models/customers_spec.rb +1 -1
- data/spec/models/dimensions_unit_spec.rb +35 -0
- data/spec/models/error_spec.rb +1 -1
- data/spec/models/me_spec.rb +77 -0
- data/spec/models/payment_term_spec.rb +1 -1
- data/spec/models/payment_terms_spec.rb +1 -1
- data/spec/models/price_tier_spec.rb +47 -0
- data/spec/models/price_tiers_spec.rb +41 -0
- data/spec/models/success_spec.rb +1 -1
- data/spec/models/tax_component_spec.rb +1 -1
- data/spec/models/tax_spec.rb +1 -1
- data/spec/models/taxes_spec.rb +1 -1
- data/spec/models/weight_unit_spec.rb +35 -0
- data/spec/spec_helper.rb +1 -1
- metadata +36 -15
data/docs/Me.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# DearInventoryRuby::Me
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**company** | **String** | Your company name | [optional]
|
8
|
+
**currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional]
|
9
|
+
**time_zone** | **String** | Time Zone where your company located | [optional]
|
10
|
+
**default_weight_units** | [**WeightUnit**](WeightUnit.md) | | [optional]
|
11
|
+
**default_dimensions_units** | [**DimensionsUnit**](DimensionsUnit.md) | | [optional]
|
12
|
+
**lock_date** | **Date** | Financial settings option. Indicates date period start from what you can change transactional data. Formatted in Tenant date format | [optional]
|
13
|
+
**opening_balance_date** | **Date** | Date of opening balances in the system. Formatted in Tenant date format | [optional]
|
14
|
+
|
15
|
+
## Code Sample
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'DearInventoryRuby'
|
19
|
+
|
20
|
+
instance = DearInventoryRuby::Me.new(company: nil,
|
21
|
+
currency: nil,
|
22
|
+
time_zone: nil,
|
23
|
+
default_weight_units: nil,
|
24
|
+
default_dimensions_units: nil,
|
25
|
+
lock_date: nil,
|
26
|
+
opening_balance_date: nil)
|
27
|
+
```
|
28
|
+
|
29
|
+
|
data/docs/PaymentTerm.md
CHANGED
@@ -16,12 +16,12 @@ Name | Type | Description | Notes
|
|
16
16
|
```ruby
|
17
17
|
require 'DearInventoryRuby'
|
18
18
|
|
19
|
-
instance = DearInventoryRuby::PaymentTerm.new(id:
|
20
|
-
name:
|
21
|
-
duration:
|
22
|
-
method:
|
23
|
-
is_active:
|
24
|
-
is_default:
|
19
|
+
instance = DearInventoryRuby::PaymentTerm.new(id: nil,
|
20
|
+
name: nil,
|
21
|
+
duration: nil,
|
22
|
+
method: nil,
|
23
|
+
is_active: nil,
|
24
|
+
is_default: nil)
|
25
25
|
```
|
26
26
|
|
27
27
|
|
data/docs/PaymentTerms.md
CHANGED
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
|
|
13
13
|
```ruby
|
14
14
|
require 'DearInventoryRuby'
|
15
15
|
|
16
|
-
instance = DearInventoryRuby::PaymentTerms.new(total:
|
17
|
-
page:
|
18
|
-
payment_term_list:
|
16
|
+
instance = DearInventoryRuby::PaymentTerms.new(total: nil,
|
17
|
+
page: nil,
|
18
|
+
payment_term_list: nil)
|
19
19
|
```
|
20
20
|
|
21
21
|
|
data/docs/PriceTier.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# DearInventoryRuby::PriceTier
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**code** | **Integer** | Code number of Price Tier | [optional]
|
8
|
+
**name** | **String** | Price Tier name | [optional]
|
9
|
+
|
10
|
+
## Code Sample
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'DearInventoryRuby'
|
14
|
+
|
15
|
+
instance = DearInventoryRuby::PriceTier.new(code: nil,
|
16
|
+
name: nil)
|
17
|
+
```
|
18
|
+
|
19
|
+
|
data/docs/PriceTiers.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# DearInventoryRuby::PriceTiers
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**price_tiers** | [**Array<PriceTier>**](PriceTier.md) | Array of PriceTiers | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'DearInventoryRuby'
|
13
|
+
|
14
|
+
instance = DearInventoryRuby::PriceTiers.new(price_tiers: nil)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/docs/Success.md
CHANGED
data/docs/Tax.md
CHANGED
@@ -19,15 +19,15 @@ Name | Type | Description | Notes
|
|
19
19
|
```ruby
|
20
20
|
require 'DearInventoryRuby'
|
21
21
|
|
22
|
-
instance = DearInventoryRuby::Tax.new(id:
|
23
|
-
name:
|
24
|
-
account:
|
25
|
-
is_active:
|
26
|
-
tax_inclusive:
|
27
|
-
tax_percent:
|
28
|
-
is_tax_for_sale:
|
29
|
-
is_tax_for_purchase:
|
30
|
-
components:
|
22
|
+
instance = DearInventoryRuby::Tax.new(id: nil,
|
23
|
+
name: nil,
|
24
|
+
account: nil,
|
25
|
+
is_active: nil,
|
26
|
+
tax_inclusive: nil,
|
27
|
+
tax_percent: nil,
|
28
|
+
is_tax_for_sale: nil,
|
29
|
+
is_tax_for_purchase: nil,
|
30
|
+
components: nil)
|
31
31
|
```
|
32
32
|
|
33
33
|
|
data/docs/TaxComponent.md
CHANGED
@@ -14,10 +14,10 @@ Name | Type | Description | Notes
|
|
14
14
|
```ruby
|
15
15
|
require 'DearInventoryRuby'
|
16
16
|
|
17
|
-
instance = DearInventoryRuby::TaxComponent.new(name:
|
18
|
-
percent:
|
19
|
-
account_code:
|
20
|
-
component_order:
|
17
|
+
instance = DearInventoryRuby::TaxComponent.new(name: nil,
|
18
|
+
percent: nil,
|
19
|
+
account_code: nil,
|
20
|
+
component_order: nil)
|
21
21
|
```
|
22
22
|
|
23
23
|
|
data/docs/Taxes.md
CHANGED
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
|
|
13
13
|
```ruby
|
14
14
|
require 'DearInventoryRuby'
|
15
15
|
|
16
|
-
instance = DearInventoryRuby::Taxes.new(total:
|
17
|
-
page:
|
18
|
-
tax_rule_list:
|
16
|
+
instance = DearInventoryRuby::Taxes.new(total: nil,
|
17
|
+
page: nil,
|
18
|
+
tax_rule_list: nil)
|
19
19
|
```
|
20
20
|
|
21
21
|
|
data/docs/WeightUnit.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# DearInventoryRuby::WeightUnit
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
|
8
|
+
## Code Sample
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'DearInventoryRuby'
|
12
|
+
|
13
|
+
instance = DearInventoryRuby::WeightUnit.new()
|
14
|
+
```
|
15
|
+
|
16
|
+
|
data/lib/dear-inventory-ruby.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: nnhansg@gmail.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,13 +24,18 @@ require 'dear-inventory-ruby/models/contact'
|
|
24
24
|
require 'dear-inventory-ruby/models/currency_code'
|
25
25
|
require 'dear-inventory-ruby/models/customer'
|
26
26
|
require 'dear-inventory-ruby/models/customers'
|
27
|
+
require 'dear-inventory-ruby/models/dimensions_unit'
|
27
28
|
require 'dear-inventory-ruby/models/error'
|
29
|
+
require 'dear-inventory-ruby/models/me'
|
28
30
|
require 'dear-inventory-ruby/models/payment_term'
|
29
31
|
require 'dear-inventory-ruby/models/payment_terms'
|
32
|
+
require 'dear-inventory-ruby/models/price_tier'
|
33
|
+
require 'dear-inventory-ruby/models/price_tiers'
|
30
34
|
require 'dear-inventory-ruby/models/success'
|
31
35
|
require 'dear-inventory-ruby/models/tax'
|
32
36
|
require 'dear-inventory-ruby/models/tax_component'
|
33
37
|
require 'dear-inventory-ruby/models/taxes'
|
38
|
+
require 'dear-inventory-ruby/models/weight_unit'
|
34
39
|
|
35
40
|
# APIs
|
36
41
|
require 'dear-inventory-ruby/api/inventory_api'
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: nnhansg@gmail.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -537,6 +537,60 @@ module DearInventoryRuby
|
|
537
537
|
return data, status_code, headers
|
538
538
|
end
|
539
539
|
|
540
|
+
# Allows you to retrieve your information
|
541
|
+
# @param [Hash] opts the optional parameters
|
542
|
+
# @return [Me]
|
543
|
+
def get_me(opts = {})
|
544
|
+
data, _status_code, _headers = get_me_with_http_info(opts)
|
545
|
+
data
|
546
|
+
end
|
547
|
+
|
548
|
+
# Allows you to retrieve your information
|
549
|
+
# @param [Hash] opts the optional parameters
|
550
|
+
# @return [Array<(Me, Integer, Hash)>] Me data, response status code and response headers
|
551
|
+
def get_me_with_http_info(opts = {})
|
552
|
+
if @api_client.config.debugging
|
553
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.get_me ...'
|
554
|
+
end
|
555
|
+
# resource path
|
556
|
+
local_var_path = '/me'
|
557
|
+
|
558
|
+
# query parameters
|
559
|
+
query_params = opts[:query_params] || {}
|
560
|
+
|
561
|
+
# header parameters
|
562
|
+
header_params = opts[:header_params] || {}
|
563
|
+
# HTTP header 'Accept' (if needed)
|
564
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
565
|
+
|
566
|
+
# form parameters
|
567
|
+
form_params = opts[:form_params] || {}
|
568
|
+
|
569
|
+
# http body (model)
|
570
|
+
post_body = opts[:body]
|
571
|
+
|
572
|
+
# return_type
|
573
|
+
return_type = opts[:return_type] || 'Me'
|
574
|
+
|
575
|
+
# auth_names
|
576
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
577
|
+
|
578
|
+
new_options = opts.merge(
|
579
|
+
:header_params => header_params,
|
580
|
+
:query_params => query_params,
|
581
|
+
:form_params => form_params,
|
582
|
+
:body => post_body,
|
583
|
+
:auth_names => auth_names,
|
584
|
+
:return_type => return_type
|
585
|
+
)
|
586
|
+
|
587
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
588
|
+
if @api_client.config.debugging
|
589
|
+
@api_client.config.logger.debug "API called: InventoryApi#get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
590
|
+
end
|
591
|
+
return data, status_code, headers
|
592
|
+
end
|
593
|
+
|
540
594
|
# Allows you to retrieve the payment terms
|
541
595
|
# @param [Hash] opts the optional parameters
|
542
596
|
# @option opts [String] :page Default is 1 (default to '1')
|
@@ -612,6 +666,60 @@ module DearInventoryRuby
|
|
612
666
|
return data, status_code, headers
|
613
667
|
end
|
614
668
|
|
669
|
+
# Allows you to retrieve the Price Tiers
|
670
|
+
# @param [Hash] opts the optional parameters
|
671
|
+
# @return [PriceTiers]
|
672
|
+
def get_price_tiers(opts = {})
|
673
|
+
data, _status_code, _headers = get_price_tiers_with_http_info(opts)
|
674
|
+
data
|
675
|
+
end
|
676
|
+
|
677
|
+
# Allows you to retrieve the Price Tiers
|
678
|
+
# @param [Hash] opts the optional parameters
|
679
|
+
# @return [Array<(PriceTiers, Integer, Hash)>] PriceTiers data, response status code and response headers
|
680
|
+
def get_price_tiers_with_http_info(opts = {})
|
681
|
+
if @api_client.config.debugging
|
682
|
+
@api_client.config.logger.debug 'Calling API: InventoryApi.get_price_tiers ...'
|
683
|
+
end
|
684
|
+
# resource path
|
685
|
+
local_var_path = '/ref/priceTier'
|
686
|
+
|
687
|
+
# query parameters
|
688
|
+
query_params = opts[:query_params] || {}
|
689
|
+
|
690
|
+
# header parameters
|
691
|
+
header_params = opts[:header_params] || {}
|
692
|
+
# HTTP header 'Accept' (if needed)
|
693
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
694
|
+
|
695
|
+
# form parameters
|
696
|
+
form_params = opts[:form_params] || {}
|
697
|
+
|
698
|
+
# http body (model)
|
699
|
+
post_body = opts[:body]
|
700
|
+
|
701
|
+
# return_type
|
702
|
+
return_type = opts[:return_type] || 'PriceTiers'
|
703
|
+
|
704
|
+
# auth_names
|
705
|
+
auth_names = opts[:auth_names] || ['accountID', 'appKey']
|
706
|
+
|
707
|
+
new_options = opts.merge(
|
708
|
+
:header_params => header_params,
|
709
|
+
:query_params => query_params,
|
710
|
+
:form_params => form_params,
|
711
|
+
:body => post_body,
|
712
|
+
:auth_names => auth_names,
|
713
|
+
:return_type => return_type
|
714
|
+
)
|
715
|
+
|
716
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
717
|
+
if @api_client.config.debugging
|
718
|
+
@api_client.config.logger.debug "API called: InventoryApi#get_price_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
719
|
+
end
|
720
|
+
return data, status_code, headers
|
721
|
+
end
|
722
|
+
|
615
723
|
# Allows you to retrieve the taxes
|
616
724
|
# @param [Hash] opts the optional parameters
|
617
725
|
# @option opts [String] :page Default is 1 (default to '1')
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: nnhansg@gmail.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -287,11 +287,13 @@ module DearInventoryRuby
|
|
287
287
|
tempfile.write(chunk)
|
288
288
|
end
|
289
289
|
request.on_complete do |response|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
290
|
+
if tempfile
|
291
|
+
tempfile.close
|
292
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
293
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
294
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
295
|
+
"explicitly with `tempfile.delete`"
|
296
|
+
end
|
295
297
|
end
|
296
298
|
end
|
297
299
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: nnhansg@gmail.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -41,28 +41,6 @@ module DearInventoryRuby
|
|
41
41
|
# Points that Address is used as default for chosen Type. `false` as default.
|
42
42
|
attr_accessor :default_for_type
|
43
43
|
|
44
|
-
class EnumAttributeValidator
|
45
|
-
attr_reader :datatype
|
46
|
-
attr_reader :allowable_values
|
47
|
-
|
48
|
-
def initialize(datatype, allowable_values)
|
49
|
-
@allowable_values = allowable_values.map do |value|
|
50
|
-
case datatype.to_s
|
51
|
-
when /Integer/i
|
52
|
-
value.to_i
|
53
|
-
when /Float/i
|
54
|
-
value.to_f
|
55
|
-
else
|
56
|
-
value
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def valid?(value)
|
62
|
-
!value || allowable_values.include?(value)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
67
45
|
def self.attribute_map
|
68
46
|
{
|
@@ -198,8 +176,6 @@ module DearInventoryRuby
|
|
198
176
|
return false if !@post_code.nil? && @post_code.to_s.length > 20
|
199
177
|
return false if @country.nil?
|
200
178
|
return false if @type.nil?
|
201
|
-
type_validator = EnumAttributeValidator.new('String', ["Billing", "Business", "Shipping"])
|
202
|
-
return false unless type_validator.valid?(@type)
|
203
179
|
true
|
204
180
|
end
|
205
181
|
|
@@ -253,16 +229,6 @@ module DearInventoryRuby
|
|
253
229
|
@post_code = post_code
|
254
230
|
end
|
255
231
|
|
256
|
-
# Custom attribute writer method checking allowed values (enum).
|
257
|
-
# @param [Object] type Object to be assigned
|
258
|
-
def type=(type)
|
259
|
-
validator = EnumAttributeValidator.new('String', ["Billing", "Business", "Shipping"])
|
260
|
-
unless validator.valid?(type)
|
261
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
262
|
-
end
|
263
|
-
@type = type
|
264
|
-
end
|
265
|
-
|
266
232
|
# Checks equality by comparing each attribute.
|
267
233
|
# @param [Object] Object to be compared
|
268
234
|
def ==(o)
|