dear-inventory-ruby 0.2.7 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +5 -4
- data/docs/AttachmentLine.md +25 -0
- data/docs/Sale.md +3 -1
- data/lib/dear-inventory-ruby/models/attachment_line.rb +247 -0
- data/lib/dear-inventory-ruby/models/sale.rb +16 -4
- data/lib/dear-inventory-ruby/models/tax.rb +0 -43
- data/lib/dear-inventory-ruby/version.rb +1 -1
- data/lib/dear-inventory-ruby.rb +1 -0
- data/spec/.DS_Store +0 -0
- data/spec/models/attachment_line_spec.rb +65 -0
- data/spec/models/sale_spec.rb +6 -0
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a7bf68cac78ec398af03a348361976a1b36a5f47540a55c04ed6233321664c
|
4
|
+
data.tar.gz: ba84070b6d81230ee401e84f773741d2e25d00fad208893cf05dd3604892e640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 264b8ecf72a6f6e0b1a2cac41894fa66d1a819896b2da8e0764df4b311b318360bfb1240b12bb467252f67b8ea8e28fe5406937353a014aec59199a521daa435
|
7
|
+
data.tar.gz: 39bdca1e9f50d91d201a6f445620585d46eb814e5bea255fa7d02a079aa81a0357f77b9e7290c71f6349fb4aba249f92e0e4be7911322042c13bd94ac4b34bca
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.2.9] - 2023-05-30
|
6
|
+
|
7
|
+
- Add `Attachments` property to responses of the endpoint GET `/sale`
|
8
|
+
|
9
|
+
## [0.2.8] - 2022-12-15
|
10
|
+
|
11
|
+
- Remove some validations of `Tax`
|
12
|
+
|
5
13
|
## [0.2.7] - 2022-08-17
|
6
14
|
|
7
15
|
- Support parameter `ContactFilter` and `IncludeProductPrices` for the endpoint GET `/customer`
|
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.2.
|
10
|
+
- Package version: 0.2.9
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [https://www.nhansg.com](https://www.nhansg.com)
|
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.2.
|
27
|
+
gem install ./dear-inventory-ruby-0.2.9.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./dear-inventory-ruby-0.2.
|
30
|
+
(for development, run `gem install --dev ./dear-inventory-ruby-0.2.9.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.2.
|
36
|
+
gem 'dear-inventory-ruby', '~> 0.2.9'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
|
|
132
132
|
- [DearInventoryRuby::Account](docs/Account.md)
|
133
133
|
- [DearInventoryRuby::Accounts](docs/Accounts.md)
|
134
134
|
- [DearInventoryRuby::Address](docs/Address.md)
|
135
|
+
- [DearInventoryRuby::AttachmentLine](docs/AttachmentLine.md)
|
135
136
|
- [DearInventoryRuby::AuthorizationType](docs/AuthorizationType.md)
|
136
137
|
- [DearInventoryRuby::Contact](docs/Contact.md)
|
137
138
|
- [DearInventoryRuby::Customer](docs/Customer.md)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# DearInventoryRuby::AttachmentLine
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Attached file ID | [optional]
|
8
|
+
**content_type** | **String** | Attached file content type | [optional]
|
9
|
+
**is_default** | **Boolean** | Is this attachment will be used as default product image. Is visible only for product Attachment Endpoint. | [optional]
|
10
|
+
**file_name** | **String** | Attached file name | [optional]
|
11
|
+
**download_url** | **String** | Url to download attached File | [optional]
|
12
|
+
|
13
|
+
## Code Sample
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'DearInventoryRuby'
|
17
|
+
|
18
|
+
instance = DearInventoryRuby::AttachmentLine.new(id: nil,
|
19
|
+
content_type: nil,
|
20
|
+
is_default: nil,
|
21
|
+
file_name: nil,
|
22
|
+
download_url: nil)
|
23
|
+
```
|
24
|
+
|
25
|
+
|
data/docs/Sale.md
CHANGED
@@ -46,6 +46,7 @@ Name | Type | Description | Notes
|
|
46
46
|
**quote** | [**SaleQuote**](SaleQuote.md) | | [optional]
|
47
47
|
**order** | [**SaleOrder**](SaleOrder.md) | | [optional]
|
48
48
|
**invoices** | [**Array<SaleInvoice>**](SaleInvoice.md) | Sale Invoices | [optional]
|
49
|
+
**attachments** | [**Array<AttachmentLine>**](AttachmentLine.md) | Sale Attachments | [optional]
|
49
50
|
|
50
51
|
## Code Sample
|
51
52
|
|
@@ -93,7 +94,8 @@ instance = DearInventoryRuby::Sale.new(id: nil,
|
|
93
94
|
service_only: nil,
|
94
95
|
quote: nil,
|
95
96
|
order: nil,
|
96
|
-
invoices: nil
|
97
|
+
invoices: nil,
|
98
|
+
attachments: nil)
|
97
99
|
```
|
98
100
|
|
99
101
|
|
@@ -0,0 +1,247 @@
|
|
1
|
+
=begin
|
2
|
+
#DEAR Inventory API
|
3
|
+
|
4
|
+
#This specifing endpoints for DEAR Inventory API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: nnhansg@gmail.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DearInventoryRuby
|
16
|
+
class AttachmentLine
|
17
|
+
# Attached file ID
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# Attached file content type
|
21
|
+
attr_accessor :content_type
|
22
|
+
|
23
|
+
# Is this attachment will be used as default product image. Is visible only for product Attachment Endpoint.
|
24
|
+
attr_accessor :is_default
|
25
|
+
|
26
|
+
# Attached file name
|
27
|
+
attr_accessor :file_name
|
28
|
+
|
29
|
+
# Url to download attached File
|
30
|
+
attr_accessor :download_url
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'id' => :'ID',
|
36
|
+
:'content_type' => :'ContentType',
|
37
|
+
:'is_default' => :'IsDefault',
|
38
|
+
:'file_name' => :'FileName',
|
39
|
+
:'download_url' => :'DownloadUrl'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.openapi_types
|
45
|
+
{
|
46
|
+
:'id' => :'String',
|
47
|
+
:'content_type' => :'String',
|
48
|
+
:'is_default' => :'Boolean',
|
49
|
+
:'file_name' => :'String',
|
50
|
+
:'download_url' => :'String'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# List of attributes with nullable: true
|
55
|
+
def self.openapi_nullable
|
56
|
+
Set.new([
|
57
|
+
])
|
58
|
+
end
|
59
|
+
|
60
|
+
# Initializes the object
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
62
|
+
def initialize(attributes = {})
|
63
|
+
if (!attributes.is_a?(Hash))
|
64
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DearInventoryRuby::AttachmentLine` initialize method"
|
65
|
+
end
|
66
|
+
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DearInventoryRuby::AttachmentLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
71
|
+
end
|
72
|
+
h[k.to_sym] = v
|
73
|
+
}
|
74
|
+
|
75
|
+
if attributes.key?(:'id')
|
76
|
+
self.id = attributes[:'id']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'content_type')
|
80
|
+
self.content_type = attributes[:'content_type']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'is_default')
|
84
|
+
self.is_default = attributes[:'is_default']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'file_name')
|
88
|
+
self.file_name = attributes[:'file_name']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'download_url')
|
92
|
+
self.download_url = attributes[:'download_url']
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
97
|
+
# @return Array for valid properties with the reasons
|
98
|
+
def list_invalid_properties
|
99
|
+
invalid_properties = Array.new
|
100
|
+
invalid_properties
|
101
|
+
end
|
102
|
+
|
103
|
+
# Check to see if the all the properties in the model are valid
|
104
|
+
# @return true if the model is valid
|
105
|
+
def valid?
|
106
|
+
true
|
107
|
+
end
|
108
|
+
|
109
|
+
# Checks equality by comparing each attribute.
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def ==(o)
|
112
|
+
return true if self.equal?(o)
|
113
|
+
self.class == o.class &&
|
114
|
+
id == o.id &&
|
115
|
+
content_type == o.content_type &&
|
116
|
+
is_default == o.is_default &&
|
117
|
+
file_name == o.file_name &&
|
118
|
+
download_url == o.download_url
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(o)
|
124
|
+
self == o
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Integer] Hash code
|
129
|
+
def hash
|
130
|
+
[id, content_type, is_default, file_name, download_url].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def self.build_from_hash(attributes)
|
137
|
+
new.build_from_hash(attributes)
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
self.class.openapi_types.each_pair do |key, type|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :DateTime
|
167
|
+
DateTime.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :Boolean
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
DearInventoryRuby.const_get(type).build_from_hash(value)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the string representation of the object
|
202
|
+
# @return [String] String presentation of the object
|
203
|
+
def to_s
|
204
|
+
to_hash.to_s
|
205
|
+
end
|
206
|
+
|
207
|
+
# to_body is an alias to to_hash (backward compatibility)
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_body
|
210
|
+
to_hash
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns the object in the form of hash
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_hash
|
216
|
+
hash = {}
|
217
|
+
self.class.attribute_map.each_pair do |attr, param|
|
218
|
+
value = self.send(attr)
|
219
|
+
if value.nil?
|
220
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
|
+
end
|
223
|
+
|
224
|
+
hash[param] = _to_hash(value)
|
225
|
+
end
|
226
|
+
hash
|
227
|
+
end
|
228
|
+
|
229
|
+
# Outputs non-array value in the form of hash
|
230
|
+
# For object, use to_hash. Otherwise, just return the value
|
231
|
+
# @param [Object] value Any valid value
|
232
|
+
# @return [Hash] Returns the value in the form of hash
|
233
|
+
def _to_hash(value)
|
234
|
+
if value.is_a?(Array)
|
235
|
+
value.compact.map { |v| _to_hash(v) }
|
236
|
+
elsif value.is_a?(Hash)
|
237
|
+
{}.tap do |hash|
|
238
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
239
|
+
end
|
240
|
+
elsif value.respond_to? :to_hash
|
241
|
+
value.to_hash
|
242
|
+
else
|
243
|
+
value
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
@@ -136,6 +136,9 @@ module DearInventoryRuby
|
|
136
136
|
# Sale Invoices
|
137
137
|
attr_accessor :invoices
|
138
138
|
|
139
|
+
# Sale Attachments
|
140
|
+
attr_accessor :attachments
|
141
|
+
|
139
142
|
# Attribute mapping from ruby-style variable name to JSON key.
|
140
143
|
def self.attribute_map
|
141
144
|
{
|
@@ -180,7 +183,8 @@ module DearInventoryRuby
|
|
180
183
|
:'service_only' => :'ServiceOnly',
|
181
184
|
:'quote' => :'Quote',
|
182
185
|
:'order' => :'Order',
|
183
|
-
:'invoices' => :'Invoices'
|
186
|
+
:'invoices' => :'Invoices',
|
187
|
+
:'attachments' => :'Attachments'
|
184
188
|
}
|
185
189
|
end
|
186
190
|
|
@@ -228,7 +232,8 @@ module DearInventoryRuby
|
|
228
232
|
:'service_only' => :'String',
|
229
233
|
:'quote' => :'SaleQuote',
|
230
234
|
:'order' => :'SaleOrder',
|
231
|
-
:'invoices' => :'Array<SaleInvoice>'
|
235
|
+
:'invoices' => :'Array<SaleInvoice>',
|
236
|
+
:'attachments' => :'Array<AttachmentLine>'
|
232
237
|
}
|
233
238
|
end
|
234
239
|
|
@@ -422,6 +427,12 @@ module DearInventoryRuby
|
|
422
427
|
self.invoices = value
|
423
428
|
end
|
424
429
|
end
|
430
|
+
|
431
|
+
if attributes.key?(:'attachments')
|
432
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
433
|
+
self.attachments = value
|
434
|
+
end
|
435
|
+
end
|
425
436
|
end
|
426
437
|
|
427
438
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -483,7 +494,8 @@ module DearInventoryRuby
|
|
483
494
|
service_only == o.service_only &&
|
484
495
|
quote == o.quote &&
|
485
496
|
order == o.order &&
|
486
|
-
invoices == o.invoices
|
497
|
+
invoices == o.invoices &&
|
498
|
+
attachments == o.attachments
|
487
499
|
end
|
488
500
|
|
489
501
|
# @see the `==` method
|
@@ -495,7 +507,7 @@ module DearInventoryRuby
|
|
495
507
|
# Calculates hash code according to all attributes.
|
496
508
|
# @return [Integer] Hash code
|
497
509
|
def hash
|
498
|
-
[id, customer, customer_id, contact, phone, email, default_account, skip_quote, billing_address, shipping_address, shipping_notes, base_currency, customer_currency, tax_rule, tax_calculation, terms, price_tier, ship_by, location, sale_order_date, last_modified_on, note, customer_reference, cogs_amount, status, combined_picking_status, combined_packing_status, combined_shipping_status, ful_filment_status, combined_invoice_status, combined_payment_status, combined_tracking_numbers, carrier, currency_rate, sales_representative, type, source_channel, external_id, service_only, quote, order, invoices].hash
|
510
|
+
[id, customer, customer_id, contact, phone, email, default_account, skip_quote, billing_address, shipping_address, shipping_notes, base_currency, customer_currency, tax_rule, tax_calculation, terms, price_tier, ship_by, location, sale_order_date, last_modified_on, note, customer_reference, cogs_amount, status, combined_picking_status, combined_packing_status, combined_shipping_status, ful_filment_status, combined_invoice_status, combined_payment_status, combined_tracking_numbers, carrier, currency_rate, sales_representative, type, source_channel, external_id, service_only, quote, order, invoices, attachments].hash
|
499
511
|
end
|
500
512
|
|
501
513
|
# Builds the object from hash
|
@@ -147,10 +147,6 @@ module DearInventoryRuby
|
|
147
147
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
148
148
|
end
|
149
149
|
|
150
|
-
if @name.to_s.length > 50
|
151
|
-
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
|
152
|
-
end
|
153
|
-
|
154
150
|
if @account.nil?
|
155
151
|
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
156
152
|
end
|
@@ -163,14 +159,6 @@ module DearInventoryRuby
|
|
163
159
|
invalid_properties.push('invalid value for "tax_inclusive", tax_inclusive cannot be nil.')
|
164
160
|
end
|
165
161
|
|
166
|
-
if !@tax_percent.nil? && @tax_percent > 100
|
167
|
-
invalid_properties.push('invalid value for "tax_percent", must be smaller than or equal to 100.')
|
168
|
-
end
|
169
|
-
|
170
|
-
if !@tax_percent.nil? && @tax_percent < 0
|
171
|
-
invalid_properties.push('invalid value for "tax_percent", must be greater than or equal to 0.')
|
172
|
-
end
|
173
|
-
|
174
162
|
invalid_properties
|
175
163
|
end
|
176
164
|
|
@@ -178,43 +166,12 @@ module DearInventoryRuby
|
|
178
166
|
# @return true if the model is valid
|
179
167
|
def valid?
|
180
168
|
return false if @name.nil?
|
181
|
-
return false if @name.to_s.length > 50
|
182
169
|
return false if @account.nil?
|
183
170
|
return false if @is_active.nil?
|
184
171
|
return false if @tax_inclusive.nil?
|
185
|
-
return false if !@tax_percent.nil? && @tax_percent > 100
|
186
|
-
return false if !@tax_percent.nil? && @tax_percent < 0
|
187
172
|
true
|
188
173
|
end
|
189
174
|
|
190
|
-
# Custom attribute writer method with validation
|
191
|
-
# @param [Object] name Value to be assigned
|
192
|
-
def name=(name)
|
193
|
-
if name.nil?
|
194
|
-
fail ArgumentError, 'name cannot be nil'
|
195
|
-
end
|
196
|
-
|
197
|
-
if name.to_s.length > 50
|
198
|
-
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
|
199
|
-
end
|
200
|
-
|
201
|
-
@name = name
|
202
|
-
end
|
203
|
-
|
204
|
-
# Custom attribute writer method with validation
|
205
|
-
# @param [Object] tax_percent Value to be assigned
|
206
|
-
def tax_percent=(tax_percent)
|
207
|
-
if !tax_percent.nil? && tax_percent > 100
|
208
|
-
fail ArgumentError, 'invalid value for "tax_percent", must be smaller than or equal to 100.'
|
209
|
-
end
|
210
|
-
|
211
|
-
if !tax_percent.nil? && tax_percent < 0
|
212
|
-
fail ArgumentError, 'invalid value for "tax_percent", must be greater than or equal to 0.'
|
213
|
-
end
|
214
|
-
|
215
|
-
@tax_percent = tax_percent
|
216
|
-
end
|
217
|
-
|
218
175
|
# Checks equality by comparing each attribute.
|
219
176
|
# @param [Object] Object to be compared
|
220
177
|
def ==(o)
|
data/lib/dear-inventory-ruby.rb
CHANGED
@@ -20,6 +20,7 @@ require 'dear-inventory-ruby/configuration'
|
|
20
20
|
require 'dear-inventory-ruby/models/account'
|
21
21
|
require 'dear-inventory-ruby/models/accounts'
|
22
22
|
require 'dear-inventory-ruby/models/address'
|
23
|
+
require 'dear-inventory-ruby/models/attachment_line'
|
23
24
|
require 'dear-inventory-ruby/models/authorization_type'
|
24
25
|
require 'dear-inventory-ruby/models/contact'
|
25
26
|
require 'dear-inventory-ruby/models/customer'
|
data/spec/.DS_Store
CHANGED
Binary file
|
@@ -0,0 +1,65 @@
|
|
1
|
+
=begin
|
2
|
+
#DEAR Inventory API
|
3
|
+
|
4
|
+
#This specifing endpoints for DEAR Inventory API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: nnhansg@gmail.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for DearInventoryRuby::AttachmentLine
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'AttachmentLine' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = DearInventoryRuby::AttachmentLine.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of AttachmentLine' do
|
31
|
+
it 'should create an instance of AttachmentLine' do
|
32
|
+
expect(@instance).to be_instance_of(DearInventoryRuby::AttachmentLine)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "id"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "content_type"' 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
|
+
|
47
|
+
describe 'test attribute "is_default"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'test attribute "file_name"' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'test attribute "download_url"' do
|
60
|
+
it 'should work' do
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
data/spec/models/sale_spec.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nhan Nguyen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- docs/Account.md
|
88
88
|
- docs/Accounts.md
|
89
89
|
- docs/Address.md
|
90
|
+
- docs/AttachmentLine.md
|
90
91
|
- docs/AuthorizationType.md
|
91
92
|
- docs/Contact.md
|
92
93
|
- docs/Customer.md
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- lib/dear-inventory-ruby/models/account.rb
|
135
136
|
- lib/dear-inventory-ruby/models/accounts.rb
|
136
137
|
- lib/dear-inventory-ruby/models/address.rb
|
138
|
+
- lib/dear-inventory-ruby/models/attachment_line.rb
|
137
139
|
- lib/dear-inventory-ruby/models/authorization_type.rb
|
138
140
|
- lib/dear-inventory-ruby/models/contact.rb
|
139
141
|
- lib/dear-inventory-ruby/models/customer.rb
|
@@ -179,6 +181,7 @@ files:
|
|
179
181
|
- spec/models/account_spec.rb
|
180
182
|
- spec/models/accounts_spec.rb
|
181
183
|
- spec/models/address_spec.rb
|
184
|
+
- spec/models/attachment_line_spec.rb
|
182
185
|
- spec/models/authorization_type_spec.rb
|
183
186
|
- spec/models/contact_spec.rb
|
184
187
|
- spec/models/customer_spec.rb
|
@@ -225,7 +228,7 @@ metadata:
|
|
225
228
|
source_code_uri: https://github.com/nnhansg/dear-ruby
|
226
229
|
changelog_uri: https://github.com/nnhansg/dear-ruby/blob/master/CHANGELOG.md
|
227
230
|
bug_tracker_uri: https://github.com/nnhansg/dear-ruby/issues
|
228
|
-
post_install_message:
|
231
|
+
post_install_message:
|
229
232
|
rdoc_options: []
|
230
233
|
require_paths:
|
231
234
|
- lib
|
@@ -240,8 +243,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
243
|
- !ruby/object:Gem::Version
|
241
244
|
version: '0'
|
242
245
|
requirements: []
|
243
|
-
|
244
|
-
|
246
|
+
rubyforge_project:
|
247
|
+
rubygems_version: 2.7.3
|
248
|
+
signing_key:
|
245
249
|
specification_version: 4
|
246
250
|
summary: DEAR Inventory Ruby SDK generated from DEAR-OpenAPI Spec 3.0 for https://inventory.dearsystems.com
|
247
251
|
test_files:
|
@@ -265,6 +269,7 @@ test_files:
|
|
265
269
|
- spec/models/sale_invoice_partial_spec.rb
|
266
270
|
- spec/models/sale_order_line_spec.rb
|
267
271
|
- spec/models/customers_spec.rb
|
272
|
+
- spec/models/attachment_line_spec.rb
|
268
273
|
- spec/models/customer_spec.rb
|
269
274
|
- spec/models/sale_invoice_delete_spec.rb
|
270
275
|
- spec/models/sale_payment_spec.rb
|