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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/Gemfile +1 -1
  4. data/README.md +11 -4
  5. data/dear-inventory-ruby.gemspec +1 -1
  6. data/docs/Account.md +15 -15
  7. data/docs/Accounts.md +3 -3
  8. data/docs/Address.md +9 -9
  9. data/docs/Contact.md +13 -9
  10. data/docs/Customer.md +33 -31
  11. data/docs/Customers.md +3 -3
  12. data/docs/DimensionsUnit.md +16 -0
  13. data/docs/Error.md +2 -2
  14. data/docs/InventoryApi.md +108 -0
  15. data/docs/Me.md +29 -0
  16. data/docs/PaymentTerm.md +6 -6
  17. data/docs/PaymentTerms.md +3 -3
  18. data/docs/PriceTier.md +19 -0
  19. data/docs/PriceTiers.md +17 -0
  20. data/docs/Success.md +1 -1
  21. data/docs/Tax.md +9 -9
  22. data/docs/TaxComponent.md +4 -4
  23. data/docs/Taxes.md +3 -3
  24. data/docs/WeightUnit.md +16 -0
  25. data/lib/dear-inventory-ruby.rb +6 -1
  26. data/lib/dear-inventory-ruby/api/inventory_api.rb +109 -1
  27. data/lib/dear-inventory-ruby/api_client.rb +8 -6
  28. data/lib/dear-inventory-ruby/api_error.rb +1 -1
  29. data/lib/dear-inventory-ruby/configuration.rb +1 -1
  30. data/lib/dear-inventory-ruby/models/account.rb +1 -1
  31. data/lib/dear-inventory-ruby/models/accounts.rb +1 -1
  32. data/lib/dear-inventory-ruby/models/address.rb +1 -35
  33. data/lib/dear-inventory-ruby/models/contact.rb +22 -2
  34. data/lib/dear-inventory-ruby/models/currency_code.rb +1 -1
  35. data/lib/dear-inventory-ruby/models/customer.rb +19 -7
  36. data/lib/dear-inventory-ruby/models/customers.rb +1 -1
  37. data/lib/dear-inventory-ruby/models/dimensions_unit.rb +42 -0
  38. data/lib/dear-inventory-ruby/models/error.rb +1 -1
  39. data/lib/dear-inventory-ruby/models/me.rb +264 -0
  40. data/lib/dear-inventory-ruby/models/payment_term.rb +1 -1
  41. data/lib/dear-inventory-ruby/models/payment_terms.rb +1 -1
  42. data/lib/dear-inventory-ruby/models/price_tier.rb +217 -0
  43. data/lib/dear-inventory-ruby/models/price_tiers.rb +209 -0
  44. data/lib/dear-inventory-ruby/models/success.rb +1 -1
  45. data/lib/dear-inventory-ruby/models/tax.rb +1 -1
  46. data/lib/dear-inventory-ruby/models/tax_component.rb +1 -1
  47. data/lib/dear-inventory-ruby/models/taxes.rb +1 -1
  48. data/lib/dear-inventory-ruby/models/weight_unit.rb +39 -0
  49. data/lib/dear-inventory-ruby/version.rb +2 -2
  50. data/pkg/dear-inventory-ruby-0.1.13.gem +0 -0
  51. data/spec/api/inventory_api_spec.rb +21 -1
  52. data/spec/api_client_spec.rb +2 -2
  53. data/spec/configuration_spec.rb +1 -1
  54. data/spec/models/account_spec.rb +1 -1
  55. data/spec/models/accounts_spec.rb +1 -1
  56. data/spec/models/address_spec.rb +1 -5
  57. data/spec/models/contact_spec.rb +13 -1
  58. data/spec/models/currency_code_spec.rb +1 -1
  59. data/spec/models/customer_spec.rb +7 -1
  60. data/spec/models/customers_spec.rb +1 -1
  61. data/spec/models/dimensions_unit_spec.rb +35 -0
  62. data/spec/models/error_spec.rb +1 -1
  63. data/spec/models/me_spec.rb +77 -0
  64. data/spec/models/payment_term_spec.rb +1 -1
  65. data/spec/models/payment_terms_spec.rb +1 -1
  66. data/spec/models/price_tier_spec.rb +47 -0
  67. data/spec/models/price_tiers_spec.rb +41 -0
  68. data/spec/models/success_spec.rb +1 -1
  69. data/spec/models/tax_component_spec.rb +1 -1
  70. data/spec/models/tax_spec.rb +1 -1
  71. data/spec/models/taxes_spec.rb +1 -1
  72. data/spec/models/weight_unit_spec.rb +35 -0
  73. data/spec/spec_helper.rb +1 -1
  74. metadata +36 -15
@@ -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
+
@@ -16,12 +16,12 @@ Name | Type | Description | Notes
16
16
  ```ruby
17
17
  require 'DearInventoryRuby'
18
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)
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
 
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
13
13
  ```ruby
14
14
  require 'DearInventoryRuby'
15
15
 
16
- instance = DearInventoryRuby::PaymentTerms.new(total: null,
17
- page: null,
18
- payment_term_list: null)
16
+ instance = DearInventoryRuby::PaymentTerms.new(total: nil,
17
+ page: nil,
18
+ payment_term_list: nil)
19
19
  ```
20
20
 
21
21
 
@@ -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
+
@@ -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
+
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
11
11
  ```ruby
12
12
  require 'DearInventoryRuby'
13
13
 
14
- instance = DearInventoryRuby::Success.new(success: null)
14
+ instance = DearInventoryRuby::Success.new(success: nil)
15
15
  ```
16
16
 
17
17
 
@@ -19,15 +19,15 @@ Name | Type | Description | Notes
19
19
  ```ruby
20
20
  require 'DearInventoryRuby'
21
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)
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
 
@@ -14,10 +14,10 @@ Name | Type | Description | Notes
14
14
  ```ruby
15
15
  require 'DearInventoryRuby'
16
16
 
17
- instance = DearInventoryRuby::TaxComponent.new(name: null,
18
- percent: null,
19
- account_code: null,
20
- component_order: null)
17
+ instance = DearInventoryRuby::TaxComponent.new(name: nil,
18
+ percent: nil,
19
+ account_code: nil,
20
+ component_order: nil)
21
21
  ```
22
22
 
23
23
 
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
13
13
  ```ruby
14
14
  require 'DearInventoryRuby'
15
15
 
16
- instance = DearInventoryRuby::Taxes.new(total: null,
17
- page: null,
18
- tax_rule_list: null)
16
+ instance = DearInventoryRuby::Taxes.new(total: nil,
17
+ page: nil,
18
+ tax_rule_list: nil)
19
19
  ```
20
20
 
21
21
 
@@ -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
+
@@ -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.2.3
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.2.3
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.2.3
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
- tempfile.close if tempfile
291
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
292
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
293
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
294
- "explicitly with `tempfile.delete`"
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.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -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.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -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.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -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.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -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.2.3
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)