dear-inventory-ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b4dc8e1a681123c408ac8e5d6ae9294680e33c560b21b59c8a18701d97df1b03
4
+ data.tar.gz: e8acb9bb27c89448f1c6f753934cf228e8f441b1e25ab073cf115154d7bea59a
5
+ SHA512:
6
+ metadata.gz: 9ce4e3b10fc0d2b7ced53f9088fb389bf7658b81f00bec402163a81f2bdf0993833e26bebea5aed6806b61a9487035d9dd40a3b560a531b3370f0e0c55b1a5a3
7
+ data.tar.gz: 4052318834c97171717b689b9e09b6f58371d61c5e2dd360df2105fa4fedc6ba3a68435f0c94ee6fa37c10da4cb8684f663ad413e721161fde1e032b42d68634
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nathan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # dear-inventory-ruby
2
+
3
+ DearInventoryRuby - the Ruby gem for the DEAR Inventory API
4
+
5
+ This specifing endpoints for DEAR Inventory API
6
+
7
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
+
9
+ - API version: 2.0.0
10
+ - Package version: 0.1.0
11
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
+ For more information, please visit [https://www.nnhan.me](https://www.nnhan.me)
13
+
14
+ ## Installation
15
+
16
+ ### Build a gem
17
+
18
+ To build the Ruby code into a gem:
19
+
20
+ ```shell
21
+ gem build dear-inventory-ruby.gemspec
22
+ ```
23
+
24
+ Then either install the gem locally:
25
+
26
+ ```shell
27
+ gem install ./dear-inventory-ruby-0.1.0.gem
28
+ ```
29
+
30
+ (for development, run `gem install --dev ./dear-inventory-ruby-0.1.0.gem` to install the development dependencies)
31
+
32
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
+
34
+ Finally add this to the Gemfile:
35
+
36
+ gem 'dear-inventory-ruby', '~> 0.1.0'
37
+
38
+ ### Install from Git
39
+
40
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
41
+
42
+ gem 'dear-inventory-ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
43
+
44
+ ### Include the Ruby code directly
45
+
46
+ Include the Ruby code directly using `-I` as follows:
47
+
48
+ ```shell
49
+ ruby -Ilib script.rb
50
+ ```
51
+
52
+ ## Getting Started
53
+
54
+ Please follow the [installation](#installation) procedure and then run the following code:
55
+
56
+ ```ruby
57
+ # Load the gem
58
+ require 'dear-inventory-ruby'
59
+
60
+ # Setup authorization
61
+ DearInventoryRuby.configure do |config|
62
+ # Configure API key authorization: accountID
63
+ config.api_key['api_auth_accountid'] = 'YOUR API KEY'
64
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
65
+ #config.api_key_prefix['api_auth_accountid'] = 'Bearer'
66
+
67
+ # Configure API key authorization: appKey
68
+ config.api_key['api_auth_applicationkey'] = 'YOUR API KEY'
69
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
70
+ #config.api_key_prefix['api_auth_applicationkey'] = 'Bearer'
71
+ end
72
+
73
+ api_instance = DearInventoryRuby::CustomerApi.new
74
+ opts = {
75
+ page: '1', # String | Default is 1
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
81
+ }
82
+
83
+ begin
84
+ #Allows you to retrieve the customers
85
+ result = api_instance.get_customers(opts)
86
+ p result
87
+ rescue DearInventoryRuby::ApiError => e
88
+ puts "Exception when calling CustomerApi->get_customers: #{e}"
89
+ end
90
+
91
+ ```
92
+
93
+ ## Documentation for API Endpoints
94
+
95
+ All URIs are relative to *https://inventory.dearsystems.com/ExternalApi/v2*
96
+
97
+ Class | Method | HTTP request | Description
98
+ ------------ | ------------- | ------------- | -------------
99
+ *DearInventoryRuby::CustomerApi* | [**get_customers**](docs/CustomerApi.md#get_customers) | **GET** /customer | Allows you to retrieve the customers
100
+
101
+
102
+ ## Documentation for Models
103
+
104
+ - [DearInventoryRuby::Address](docs/Address.md)
105
+ - [DearInventoryRuby::Contact](docs/Contact.md)
106
+ - [DearInventoryRuby::CurrencyCode](docs/CurrencyCode.md)
107
+ - [DearInventoryRuby::Customer](docs/Customer.md)
108
+ - [DearInventoryRuby::Customers](docs/Customers.md)
109
+ - [DearInventoryRuby::Error](docs/Error.md)
110
+
111
+
112
+ ## Documentation for Authorization
113
+
114
+
115
+ ### accountID
116
+
117
+
118
+ - **Type**: API key
119
+ - **API key parameter name**: api_auth_accountid
120
+ - **Location**: HTTP header
121
+
122
+ ### appKey
123
+
124
+
125
+ - **Type**: API key
126
+ - **API key parameter name**: api_auth_applicationkey
127
+ - **Location**: HTTP header
128
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,39 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #DEAR Inventory API
5
+
6
+ #This specifing endpoints for DEAR Inventory API
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: nnhansg@gmail.com
10
+ Generated by: https://openapi-generator.tech
11
+ OpenAPI Generator version: 4.2.3
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "dear-inventory-ruby/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "dear-inventory-ruby"
20
+ s.version = DearInventoryRuby::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["Nhan Nguyen"]
23
+ s.email = ["nnhansg@gmail.com"]
24
+ s.homepage = "https://inventory.dearsystems.com"
25
+ s.summary = "DEAR Inventory Ruby SDK generated from DEAR-OpenAPI Spec 3.0 for https://inventory.dearsystems.com"
26
+ s.description = "DEAR Inventory Ruby SDK generated from DEAR-OpenAPI Spec 3.0 for https://inventory.dearsystems.com"
27
+ s.license = 'MIT'
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'faraday', '>= 0.14.0'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+
35
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
36
+ s.test_files = `find spec/*`.split("\n")
37
+ s.executables = []
38
+ s.require_paths = ["lib"]
39
+ end
data/docs/Address.md ADDED
@@ -0,0 +1,33 @@
1
+ # DearInventoryRuby::Address
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | If passed in PUT method, entry will be searched by id, found entry will be updated, otherwise created | [optional]
8
+ **line1** | **String** | Address Line 1 | [optional]
9
+ **line2** | **String** | Address Line 2 | [optional]
10
+ **city** | **String** | City / Suburb | [optional]
11
+ **state** | **String** | State / Province | [optional]
12
+ **post_code** | **String** | Zip / PostCode | [optional]
13
+ **country** | **String** | Country name | [optional]
14
+ **type** | **String** | Address Type. Should be one of the following values: `Billing`, `Business` or `Shipping`. | [optional]
15
+ **default_for_type** | **Boolean** | Points that Address is used as default for chosen Type. `false` as default. | [optional] [default to false]
16
+
17
+ ## Code Sample
18
+
19
+ ```ruby
20
+ require 'DearInventoryRuby'
21
+
22
+ instance = DearInventoryRuby::Address.new(id: null,
23
+ line1: null,
24
+ line2: null,
25
+ city: null,
26
+ state: null,
27
+ post_code: null,
28
+ country: null,
29
+ type: null,
30
+ default_for_type: null)
31
+ ```
32
+
33
+
data/docs/Contact.md ADDED
@@ -0,0 +1,33 @@
1
+ # DearInventoryRuby::Contact
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | If passed in PUT method, entry will be searched by id, found entry will be updated, otherwise created | [optional]
8
+ **name** | **String** | Name of Contact | [optional]
9
+ **phone** | **String** | Phone | [optional]
10
+ **fax** | **String** | Fax | [optional]
11
+ **email** | **String** | Email | [optional]
12
+ **website** | **String** | Website | [optional]
13
+ **comment** | **String** | Comment | [optional]
14
+ **default** | **Boolean** | Points that Contact is used as default. `false` as default. | [optional] [default to false]
15
+ **include_in_email** | **Boolean** | Points that Contact is included in Email. `false` as default. | [optional] [default to false]
16
+
17
+ ## Code Sample
18
+
19
+ ```ruby
20
+ require 'DearInventoryRuby'
21
+
22
+ instance = DearInventoryRuby::Contact.new(id: null,
23
+ name: null,
24
+ phone: null,
25
+ fax: null,
26
+ email: null,
27
+ website: null,
28
+ comment: null,
29
+ default: null,
30
+ include_in_email: null)
31
+ ```
32
+
33
+
@@ -0,0 +1,16 @@
1
+ # DearInventoryRuby::CurrencyCode
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+
8
+ ## Code Sample
9
+
10
+ ```ruby
11
+ require 'DearInventoryRuby'
12
+
13
+ instance = DearInventoryRuby::CurrencyCode.new()
14
+ ```
15
+
16
+
data/docs/Customer.md ADDED
@@ -0,0 +1,77 @@
1
+ # DearInventoryRuby::Customer
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | Unique Customer ID | [optional]
8
+ **name** | **String** | Name of Customer | [optional]
9
+ **status** | **String** | Points that Customer is Active. Available values are Active and Deprecated. Required for POST | [optional]
10
+ **currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional]
11
+ **payment_term** | **String** | Payment term | [optional]
12
+ **account_receivable** | **String** | Account receivable code of Customer | [optional]
13
+ **revenue_account** | **String** | Sale account code of Customer | [optional]
14
+ **tax_rule** | **String** | Tax rule name | [optional]
15
+ **price_tier** | **String** | Price tier | [optional]
16
+ **carrier** | **String** | Carrier name | [optional]
17
+ **sales_representative** | **String** | Sales representative | [optional]
18
+ **location** | **String** | Location | [optional]
19
+ **discount** | **Float** | Discount must be between 0% and 100% | [optional]
20
+ **comments** | **String** | Comments | [optional]
21
+ **tax_number** | **String** | Tax number | [optional]
22
+ **credit_limit** | **Float** | Credit limit | [optional]
23
+ **tags** | **String** | Tags string | [optional]
24
+ **attribute_set** | **String** | AttributeSet name | [optional]
25
+ **additional_attribute1** | **String** | Additional attribute 1 value | [optional]
26
+ **additional_attribute2** | **String** | Additional attribute 2 value | [optional]
27
+ **additional_attribute3** | **String** | Additional attribute 3 value | [optional]
28
+ **additional_attribute4** | **String** | Additional attribute 4 value | [optional]
29
+ **additional_attribute5** | **String** | Additional attribute 5 value | [optional]
30
+ **additional_attribute6** | **String** | Additional attribute 6 value | [optional]
31
+ **additional_attribute7** | **String** | Additional attribute 7 value | [optional]
32
+ **additional_attribute8** | **String** | Additional attribute 8 value | [optional]
33
+ **additional_attribute9** | **String** | Additional attribute 9 value | [optional]
34
+ **additional_attribute10** | **String** | Additional attribute 10 value | [optional]
35
+ **last_modified_on** | **String** | Date of last modification | [optional]
36
+ **addresses** | [**Array<Address>**](Address.md) | List of addresses | [optional]
37
+ **contacts** | [**Array<Contact>**](Contact.md) | List of contacts | [optional]
38
+
39
+ ## Code Sample
40
+
41
+ ```ruby
42
+ require 'DearInventoryRuby'
43
+
44
+ instance = DearInventoryRuby::Customer.new(id: null,
45
+ name: null,
46
+ status: null,
47
+ currency: null,
48
+ payment_term: null,
49
+ account_receivable: null,
50
+ revenue_account: null,
51
+ tax_rule: null,
52
+ price_tier: null,
53
+ carrier: null,
54
+ sales_representative: null,
55
+ location: null,
56
+ discount: null,
57
+ comments: null,
58
+ tax_number: null,
59
+ credit_limit: null,
60
+ tags: null,
61
+ attribute_set: null,
62
+ additional_attribute1: null,
63
+ additional_attribute2: null,
64
+ additional_attribute3: null,
65
+ additional_attribute4: null,
66
+ additional_attribute5: null,
67
+ additional_attribute6: null,
68
+ additional_attribute7: null,
69
+ additional_attribute8: null,
70
+ additional_attribute9: null,
71
+ additional_attribute10: null,
72
+ last_modified_on: null,
73
+ addresses: null,
74
+ contacts: null)
75
+ ```
76
+
77
+
@@ -0,0 +1,78 @@
1
+ # DearInventoryRuby::CustomerApi
2
+
3
+ All URIs are relative to *https://inventory.dearsystems.com/ExternalApi/v2*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_customers**](CustomerApi.md#get_customers) | **GET** /customer | Allows you to retrieve the customers
8
+
9
+
10
+
11
+ ## get_customers
12
+
13
+ > Customers get_customers(opts)
14
+
15
+ Allows you to retrieve the customers
16
+
17
+ ### Example
18
+
19
+ ```ruby
20
+ # load the gem
21
+ require 'dear-inventory-ruby'
22
+ # setup authorization
23
+ DearInventoryRuby.configure do |config|
24
+ # Configure API key authorization: accountID
25
+ config.api_key['api_auth_accountid'] = 'YOUR API KEY'
26
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
27
+ #config.api_key_prefix['api_auth_accountid'] = 'Bearer'
28
+
29
+ # Configure API key authorization: appKey
30
+ config.api_key['api_auth_applicationkey'] = 'YOUR API KEY'
31
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
32
+ #config.api_key_prefix['api_auth_applicationkey'] = 'Bearer'
33
+ end
34
+
35
+ api_instance = DearInventoryRuby::CustomerApi.new
36
+ opts = {
37
+ page: '1', # String | Default is 1
38
+ limit: '100', # String | Default is 100
39
+ id: 'id_example', # String | Default is null
40
+ name: 'name_example', # String | Default is null
41
+ modified_since: 'modified_since_example', # String | Default is null
42
+ include_deprecated: 'false' # String | Default is false
43
+ }
44
+
45
+ begin
46
+ #Allows you to retrieve the customers
47
+ result = api_instance.get_customers(opts)
48
+ p result
49
+ rescue DearInventoryRuby::ApiError => e
50
+ puts "Exception when calling CustomerApi->get_customers: #{e}"
51
+ end
52
+ ```
53
+
54
+ ### Parameters
55
+
56
+
57
+ Name | Type | Description | Notes
58
+ ------------- | ------------- | ------------- | -------------
59
+ **page** | **String**| Default is 1 | [optional] [default to '1']
60
+ **limit** | **String**| Default is 100 | [optional] [default to '100']
61
+ **id** | **String**| Default is null | [optional]
62
+ **name** | **String**| Default is null | [optional]
63
+ **modified_since** | **String**| Default is null | [optional]
64
+ **include_deprecated** | **String**| Default is false | [optional] [default to 'false']
65
+
66
+ ### Return type
67
+
68
+ [**Customers**](Customers.md)
69
+
70
+ ### Authorization
71
+
72
+ [accountID](../README.md#accountID), [appKey](../README.md#appKey)
73
+
74
+ ### HTTP request headers
75
+
76
+ - **Content-Type**: Not defined
77
+ - **Accept**: application/json
78
+