dear-inventory-ruby 0.2.8 → 0.2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55910dcce013a8a19e74b7a2bc2d152e7ed86815c3329b22516286b61c79efbe
4
- data.tar.gz: 7a171b04aa4d7f83431a3ba967cc36a1ca9e8e349726bd1660058d30130df798
3
+ metadata.gz: d77bdd34f343e803604fada055da784f0693b628d3e44987a3eb2b4db5f2b4c4
4
+ data.tar.gz: 65e24829fec2fca131f62d72b3568bd072bf7ece094236cda84d7f29e452f540
5
5
  SHA512:
6
- metadata.gz: 56225a5d84b30c6d337ba8256cab93cb7df36dc945ba31591a9a6704a0838e1a8f44eaa12fa06754fc2dd715a54165c3c22708d9002f86a95fa3a582869cf228
7
- data.tar.gz: c4c81d7d9305a1fc5886e90961a1e3aae39147a9410e36522fdc6c1ab1c6d97a0c1a5278e2cfa6a78f1a2b4a491d2d48731b743a521587264faf3255a6214667
6
+ metadata.gz: 3b843cfc2806503478ccd252f38051d53d5148a400ae041abb7ca1c4a274afc2a71ffcb78e84344b8b7418c339d40ae41acf8ef03cedce2337eba38375a21e14
7
+ data.tar.gz: 5fbbcc7d7bf3a16964bd50a1ccac546aa1ecd068f16a2846c94e0fca3019fe0385e6b880c35374668c3bf20c9546baab50f52614c0888bdc768b50af50af871d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.2.10.1] - 2024-02-06
6
+
7
+ - Update gem version
8
+
9
+ ## [0.2.10] - 2024-02-06
10
+
11
+ - Remove the validations related to `maxlength`
12
+
13
+ ## [0.2.9] - 2023-05-30
14
+
15
+ - Add `Attachments` property to responses of the endpoint GET `/sale`
16
+
5
17
  ## [0.2.8] - 2022-12-15
6
18
 
7
19
  - Remove some validations of `Tax`
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.8
10
+ - Package version: 0.2.10.1
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.8.gem
27
+ gem install ./dear-inventory-ruby-0.2.10.1.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./dear-inventory-ruby-0.2.8.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./dear-inventory-ruby-0.2.10.1.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.8'
36
+ gem 'dear-inventory-ruby', '~> 0.2.10.1'
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
 
@@ -191,34 +191,18 @@ module DearInventoryRuby
191
191
  invalid_properties.push('invalid value for "code", code cannot be nil.')
192
192
  end
193
193
 
194
- if @code.to_s.length > 50
195
- invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 50.')
196
- end
197
-
198
194
  if @name.nil?
199
195
  invalid_properties.push('invalid value for "name", name cannot be nil.')
200
196
  end
201
197
 
202
- if @name.to_s.length > 256
203
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
204
- end
205
-
206
198
  if @type.nil?
207
199
  invalid_properties.push('invalid value for "type", type cannot be nil.')
208
200
  end
209
201
 
210
- if @type.to_s.length > 50
211
- invalid_properties.push('invalid value for "type", the character length must be smaller than or equal to 50.')
212
- end
213
-
214
202
  if @status.nil?
215
203
  invalid_properties.push('invalid value for "status", status cannot be nil.')
216
204
  end
217
205
 
218
- if @status.to_s.length > 50
219
- invalid_properties.push('invalid value for "status", the character length must be smaller than or equal to 50.')
220
- end
221
-
222
206
  invalid_properties
223
207
  end
224
208
 
@@ -226,72 +210,12 @@ module DearInventoryRuby
226
210
  # @return true if the model is valid
227
211
  def valid?
228
212
  return false if @code.nil?
229
- return false if @code.to_s.length > 50
230
213
  return false if @name.nil?
231
- return false if @name.to_s.length > 256
232
214
  return false if @type.nil?
233
- return false if @type.to_s.length > 50
234
215
  return false if @status.nil?
235
- return false if @status.to_s.length > 50
236
216
  true
237
217
  end
238
218
 
239
- # Custom attribute writer method with validation
240
- # @param [Object] code Value to be assigned
241
- def code=(code)
242
- if code.nil?
243
- fail ArgumentError, 'code cannot be nil'
244
- end
245
-
246
- if code.to_s.length > 50
247
- fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 50.'
248
- end
249
-
250
- @code = code
251
- end
252
-
253
- # Custom attribute writer method with validation
254
- # @param [Object] name Value to be assigned
255
- def name=(name)
256
- if name.nil?
257
- fail ArgumentError, 'name cannot be nil'
258
- end
259
-
260
- if name.to_s.length > 256
261
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
262
- end
263
-
264
- @name = name
265
- end
266
-
267
- # Custom attribute writer method with validation
268
- # @param [Object] type Value to be assigned
269
- def type=(type)
270
- if type.nil?
271
- fail ArgumentError, 'type cannot be nil'
272
- end
273
-
274
- if type.to_s.length > 50
275
- fail ArgumentError, 'invalid value for "type", the character length must be smaller than or equal to 50.'
276
- end
277
-
278
- @type = type
279
- end
280
-
281
- # Custom attribute writer method with validation
282
- # @param [Object] status Value to be assigned
283
- def status=(status)
284
- if status.nil?
285
- fail ArgumentError, 'status cannot be nil'
286
- end
287
-
288
- if status.to_s.length > 50
289
- fail ArgumentError, 'invalid value for "status", the character length must be smaller than or equal to 50.'
290
- end
291
-
292
- @status = status
293
- end
294
-
295
219
  # Checks equality by comparing each attribute.
296
220
  # @param [Object] Object to be compared
297
221
  def ==(o)
@@ -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
@@ -159,30 +159,6 @@ module DearInventoryRuby
159
159
  invalid_properties.push('invalid value for "name", name cannot be nil.')
160
160
  end
161
161
 
162
- if @name.to_s.length > 256
163
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
164
- end
165
-
166
- if !@phone.nil? && @phone.to_s.length > 50
167
- invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 50.')
168
- end
169
-
170
- if !@fax.nil? && @fax.to_s.length > 50
171
- invalid_properties.push('invalid value for "fax", the character length must be smaller than or equal to 50.')
172
- end
173
-
174
- if !@email.nil? && @email.to_s.length > 256
175
- invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 256.')
176
- end
177
-
178
- if !@website.nil? && @website.to_s.length > 256
179
- invalid_properties.push('invalid value for "website", the character length must be smaller than or equal to 256.')
180
- end
181
-
182
- if !@comment.nil? && @comment.to_s.length > 256
183
- invalid_properties.push('invalid value for "comment", the character length must be smaller than or equal to 256.')
184
- end
185
-
186
162
  invalid_properties
187
163
  end
188
164
 
@@ -190,79 +166,9 @@ module DearInventoryRuby
190
166
  # @return true if the model is valid
191
167
  def valid?
192
168
  return false if @name.nil?
193
- return false if @name.to_s.length > 256
194
- return false if !@phone.nil? && @phone.to_s.length > 50
195
- return false if !@fax.nil? && @fax.to_s.length > 50
196
- return false if !@email.nil? && @email.to_s.length > 256
197
- return false if !@website.nil? && @website.to_s.length > 256
198
- return false if !@comment.nil? && @comment.to_s.length > 256
199
169
  true
200
170
  end
201
171
 
202
- # Custom attribute writer method with validation
203
- # @param [Object] name Value to be assigned
204
- def name=(name)
205
- if name.nil?
206
- fail ArgumentError, 'name cannot be nil'
207
- end
208
-
209
- if name.to_s.length > 256
210
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
211
- end
212
-
213
- @name = name
214
- end
215
-
216
- # Custom attribute writer method with validation
217
- # @param [Object] phone Value to be assigned
218
- def phone=(phone)
219
- if !phone.nil? && phone.to_s.length > 50
220
- fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 50.'
221
- end
222
-
223
- @phone = phone
224
- end
225
-
226
- # Custom attribute writer method with validation
227
- # @param [Object] fax Value to be assigned
228
- def fax=(fax)
229
- if !fax.nil? && fax.to_s.length > 50
230
- fail ArgumentError, 'invalid value for "fax", the character length must be smaller than or equal to 50.'
231
- end
232
-
233
- @fax = fax
234
- end
235
-
236
- # Custom attribute writer method with validation
237
- # @param [Object] email Value to be assigned
238
- def email=(email)
239
- if !email.nil? && email.to_s.length > 256
240
- fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 256.'
241
- end
242
-
243
- @email = email
244
- end
245
-
246
- # Custom attribute writer method with validation
247
- # @param [Object] website Value to be assigned
248
- def website=(website)
249
- if !website.nil? && website.to_s.length > 256
250
- fail ArgumentError, 'invalid value for "website", the character length must be smaller than or equal to 256.'
251
- end
252
-
253
- @website = website
254
- end
255
-
256
- # Custom attribute writer method with validation
257
- # @param [Object] comment Value to be assigned
258
- def comment=(comment)
259
- if !comment.nil? && comment.to_s.length > 256
260
- fail ArgumentError, 'invalid value for "comment", the character length must be smaller than or equal to 256.'
261
- end
262
-
263
- @comment = comment
264
- end
265
-
266
172
  # Checks equality by comparing each attribute.
267
173
  # @param [Object] Object to be compared
268
174
  def ==(o)
@@ -350,10 +350,6 @@ module DearInventoryRuby
350
350
  invalid_properties.push('invalid value for "name", name cannot be nil.')
351
351
  end
352
352
 
353
- if @name.to_s.length > 256
354
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
355
- end
356
-
357
353
  if @status.nil?
358
354
  invalid_properties.push('invalid value for "status", status cannot be nil.')
359
355
  end
@@ -378,10 +374,6 @@ module DearInventoryRuby
378
374
  invalid_properties.push('invalid value for "tax_rule", tax_rule cannot be nil.')
379
375
  end
380
376
 
381
- if !@comments.nil? && @comments.to_s.length > 2000
382
- invalid_properties.push('invalid value for "comments", the character length must be smaller than or equal to 2000.')
383
- end
384
-
385
377
  invalid_properties
386
378
  end
387
379
 
@@ -389,41 +381,15 @@ module DearInventoryRuby
389
381
  # @return true if the model is valid
390
382
  def valid?
391
383
  return false if @name.nil?
392
- return false if @name.to_s.length > 256
393
384
  return false if @status.nil?
394
385
  return false if @currency.nil?
395
386
  return false if @payment_term.nil?
396
387
  return false if @account_receivable.nil?
397
388
  return false if @revenue_account.nil?
398
389
  return false if @tax_rule.nil?
399
- return false if !@comments.nil? && @comments.to_s.length > 2000
400
390
  true
401
391
  end
402
392
 
403
- # Custom attribute writer method with validation
404
- # @param [Object] name Value to be assigned
405
- def name=(name)
406
- if name.nil?
407
- fail ArgumentError, 'name cannot be nil'
408
- end
409
-
410
- if name.to_s.length > 256
411
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
412
- end
413
-
414
- @name = name
415
- end
416
-
417
- # Custom attribute writer method with validation
418
- # @param [Object] comments Value to be assigned
419
- def comments=(comments)
420
- if !comments.nil? && comments.to_s.length > 2000
421
- fail ArgumentError, 'invalid value for "comments", the character length must be smaller than or equal to 2000.'
422
- end
423
-
424
- @comments = comments
425
- end
426
-
427
393
  # Checks equality by comparing each attribute.
428
394
  # @param [Object] Object to be compared
429
395
  def ==(o)
@@ -114,10 +114,6 @@ module DearInventoryRuby
114
114
  invalid_properties.push('invalid value for "name", name cannot be nil.')
115
115
  end
116
116
 
117
- if @name.to_s.length > 256
118
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
119
- end
120
-
121
117
  invalid_properties
122
118
  end
123
119
 
@@ -125,24 +121,9 @@ module DearInventoryRuby
125
121
  # @return true if the model is valid
126
122
  def valid?
127
123
  return false if @name.nil?
128
- return false if @name.to_s.length > 256
129
124
  true
130
125
  end
131
126
 
132
- # Custom attribute writer method with validation
133
- # @param [Object] name Value to be assigned
134
- def name=(name)
135
- if name.nil?
136
- fail ArgumentError, 'name cannot be nil'
137
- end
138
-
139
- if name.to_s.length > 256
140
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
141
- end
142
-
143
- @name = name
144
- end
145
-
146
127
  # Checks equality by comparing each attribute.
147
128
  # @param [Object] Object to be compared
148
129
  def ==(o)
@@ -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
@@ -135,26 +135,6 @@ module DearInventoryRuby
135
135
  # @return Array for valid properties with the reasons
136
136
  def list_invalid_properties
137
137
  invalid_properties = Array.new
138
- if !@line1.nil? && @line1.to_s.length > 256
139
- invalid_properties.push('invalid value for "line1", the character length must be smaller than or equal to 256.')
140
- end
141
-
142
- if !@line2.nil? && @line2.to_s.length > 256
143
- invalid_properties.push('invalid value for "line2", the character length must be smaller than or equal to 256.')
144
- end
145
-
146
- if !@city.nil? && @city.to_s.length > 256
147
- invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 256.')
148
- end
149
-
150
- if !@state.nil? && @state.to_s.length > 256
151
- invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 256.')
152
- end
153
-
154
- if !@post_code.nil? && @post_code.to_s.length > 20
155
- invalid_properties.push('invalid value for "post_code", the character length must be smaller than or equal to 20.')
156
- end
157
-
158
138
  if @country.nil?
159
139
  invalid_properties.push('invalid value for "country", country cannot be nil.')
160
140
  end
@@ -169,66 +149,11 @@ module DearInventoryRuby
169
149
  # Check to see if the all the properties in the model are valid
170
150
  # @return true if the model is valid
171
151
  def valid?
172
- return false if !@line1.nil? && @line1.to_s.length > 256
173
- return false if !@line2.nil? && @line2.to_s.length > 256
174
- return false if !@city.nil? && @city.to_s.length > 256
175
- return false if !@state.nil? && @state.to_s.length > 256
176
- return false if !@post_code.nil? && @post_code.to_s.length > 20
177
152
  return false if @country.nil?
178
153
  return false if @type.nil?
179
154
  true
180
155
  end
181
156
 
182
- # Custom attribute writer method with validation
183
- # @param [Object] line1 Value to be assigned
184
- def line1=(line1)
185
- if !line1.nil? && line1.to_s.length > 256
186
- fail ArgumentError, 'invalid value for "line1", the character length must be smaller than or equal to 256.'
187
- end
188
-
189
- @line1 = line1
190
- end
191
-
192
- # Custom attribute writer method with validation
193
- # @param [Object] line2 Value to be assigned
194
- def line2=(line2)
195
- if !line2.nil? && line2.to_s.length > 256
196
- fail ArgumentError, 'invalid value for "line2", the character length must be smaller than or equal to 256.'
197
- end
198
-
199
- @line2 = line2
200
- end
201
-
202
- # Custom attribute writer method with validation
203
- # @param [Object] city Value to be assigned
204
- def city=(city)
205
- if !city.nil? && city.to_s.length > 256
206
- fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 256.'
207
- end
208
-
209
- @city = city
210
- end
211
-
212
- # Custom attribute writer method with validation
213
- # @param [Object] state Value to be assigned
214
- def state=(state)
215
- if !state.nil? && state.to_s.length > 256
216
- fail ArgumentError, 'invalid value for "state", the character length must be smaller than or equal to 256.'
217
- end
218
-
219
- @state = state
220
- end
221
-
222
- # Custom attribute writer method with validation
223
- # @param [Object] post_code Value to be assigned
224
- def post_code=(post_code)
225
- if !post_code.nil? && post_code.to_s.length > 20
226
- fail ArgumentError, 'invalid value for "post_code", the character length must be smaller than or equal to 20.'
227
- end
228
-
229
- @post_code = post_code
230
- end
231
-
232
157
  # Checks equality by comparing each attribute.
233
158
  # @param [Object] Object to be compared
234
159
  def ==(o)
@@ -94,10 +94,6 @@ module DearInventoryRuby
94
94
  invalid_properties.push('invalid value for "name", name cannot be nil.')
95
95
  end
96
96
 
97
- if @name.to_s.length > 50
98
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
99
- end
100
-
101
97
  if @percent.nil?
102
98
  invalid_properties.push('invalid value for "percent", percent cannot be nil.')
103
99
  end
@@ -125,7 +121,6 @@ module DearInventoryRuby
125
121
  # @return true if the model is valid
126
122
  def valid?
127
123
  return false if @name.nil?
128
- return false if @name.to_s.length > 50
129
124
  return false if @percent.nil?
130
125
  return false if @percent > 100
131
126
  return false if @percent < 0
@@ -134,20 +129,6 @@ module DearInventoryRuby
134
129
  true
135
130
  end
136
131
 
137
- # Custom attribute writer method with validation
138
- # @param [Object] name Value to be assigned
139
- def name=(name)
140
- if name.nil?
141
- fail ArgumentError, 'name cannot be nil'
142
- end
143
-
144
- if name.to_s.length > 50
145
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
146
- end
147
-
148
- @name = name
149
- end
150
-
151
132
  # Custom attribute writer method with validation
152
133
  # @param [Object] percent Value to be assigned
153
134
  def percent=(percent)
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module DearInventoryRuby
14
- VERSION = '0.2.8'
14
+ VERSION = '0.2.10.1'
15
15
  end
@@ -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
@@ -284,4 +284,10 @@ describe 'Sale' do
284
284
  end
285
285
  end
286
286
 
287
+ describe 'test attribute "attachments"' do
288
+ it 'should work' do
289
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
290
+ end
291
+ end
292
+
287
293
  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.2.8
4
+ version: 0.2.10.1
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: 2022-12-15 00:00:00.000000000 Z
11
+ date: 2024-02-06 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
- rubygems_version: 3.2.3
244
- signing_key:
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