storecove 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/storecove/api/invoice_submissions_api.rb +8 -28
  3. data/lib/storecove/api/shop_account_requests_api.rb +10 -42
  4. data/lib/storecove/api/shop_accounts_api.rb +45 -81
  5. data/lib/storecove/api/shops_api.rb +4 -20
  6. data/lib/storecove/api_client.rb +16 -19
  7. data/lib/storecove/api_error.rb +7 -17
  8. data/lib/storecove/configuration.rb +0 -12
  9. data/lib/storecove/models/accounting_cost_code.rb +3 -19
  10. data/lib/storecove/models/accounting_customer_party.rb +7 -15
  11. data/lib/storecove/models/{party_address.rb → address.rb} +8 -19
  12. data/lib/storecove/models/{party_contact.rb → contact.rb} +8 -16
  13. data/lib/storecove/models/country.rb +0 -12
  14. data/lib/storecove/models/currency_code.rb +0 -12
  15. data/lib/storecove/models/error_model.rb +3 -15
  16. data/lib/storecove/models/{invoice_submission_invoice.rb → invoice.rb} +55 -41
  17. data/lib/storecove/models/invoice_line.rb +12 -22
  18. data/lib/storecove/models/invoice_recipient.rb +18 -21
  19. data/lib/storecove/models/invoice_recipient_preflight.rb +11 -15
  20. data/lib/storecove/models/invoice_submission.rb +15 -16
  21. data/lib/storecove/models/invoice_submission_result.rb +11 -23
  22. data/lib/storecove/models/legal_entity.rb +3 -15
  23. data/lib/storecove/models/legal_entity_identifier.rb +3 -15
  24. data/lib/storecove/models/logos.rb +3 -15
  25. data/lib/storecove/models/party.rb +5 -17
  26. data/lib/storecove/models/preflight_invoice_recipient_result.rb +3 -15
  27. data/lib/storecove/models/{public_identifiers_inner.rb → public_identifier.rb} +4 -16
  28. data/lib/storecove/models/public_identifiers.rb +3 -15
  29. data/lib/storecove/models/shop.rb +3 -15
  30. data/lib/storecove/models/shop_account_input.rb +19 -15
  31. data/lib/storecove/models/shop_account_request.rb +7 -15
  32. data/lib/storecove/models/shop_account_request_input.rb +3 -15
  33. data/lib/storecove/models/shop_account_request_update.rb +3 -15
  34. data/lib/storecove/models/{shop_account.rb → shop_account_result.rb} +4 -16
  35. data/lib/storecove/models/shop_account_update.rb +3 -15
  36. data/lib/storecove/models/{invoice_line_tax.rb → tax.rb} +16 -16
  37. data/lib/storecove/version.rb +1 -13
  38. data/lib/storecove.rb +6 -18
  39. data/spec/api/invoice_submissions_api_spec.rb +70 -0
  40. data/spec/api/shop_account_requests_api_spec.rb +107 -0
  41. data/spec/api/shop_accounts_api_spec.rb +118 -0
  42. data/spec/api/shops_api_spec.rb +57 -0
  43. data/spec/api_client_spec.rb +237 -0
  44. data/spec/configuration_spec.rb +53 -0
  45. data/spec/models/accounting_cost_code_spec.rb +71 -0
  46. data/spec/models/accounting_customer_party_spec.rb +59 -0
  47. data/spec/models/country_spec.rb +47 -0
  48. data/spec/models/currency_code_spec.rb +47 -0
  49. data/spec/models/error_model_spec.rb +59 -0
  50. data/spec/models/invoice_line_spec.rb +95 -0
  51. data/spec/models/invoice_line_tax_spec.rb +65 -0
  52. data/spec/models/invoice_recipient_preflight_spec.rb +59 -0
  53. data/spec/models/invoice_recipient_spec.rb +59 -0
  54. data/spec/models/invoice_submission_invoice_spec.rb +159 -0
  55. data/spec/models/invoice_submission_result_spec.rb +53 -0
  56. data/spec/models/invoice_submission_spec.rb +99 -0
  57. data/spec/models/legal_entity_identifier_spec.rb +65 -0
  58. data/spec/models/legal_entity_spec.rb +95 -0
  59. data/spec/models/logos_spec.rb +65 -0
  60. data/spec/models/party_address_spec.rb +101 -0
  61. data/spec/models/party_contact_spec.rb +65 -0
  62. data/spec/models/party_spec.rb +65 -0
  63. data/spec/models/preflight_invoice_recipient_result_spec.rb +57 -0
  64. data/spec/models/public_identifier_spec.rb +59 -0
  65. data/spec/models/public_identifiers_spec.rb +47 -0
  66. data/spec/models/shop_account_input_spec.rb +77 -0
  67. data/spec/models/shop_account_request_input_spec.rb +77 -0
  68. data/spec/models/shop_account_request_spec.rb +77 -0
  69. data/spec/models/shop_account_request_update_spec.rb +71 -0
  70. data/spec/models/shop_account_result_spec.rb +95 -0
  71. data/spec/models/shop_account_update_spec.rb +65 -0
  72. data/spec/models/shop_spec.rb +77 -0
  73. data/spec/spec_helper.rb +122 -0
  74. metadata +79 -10
  75. data/lib/storecove/models/swagger-codegen +0 -2799
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  module StorecoveApi
@@ -32,12 +20,14 @@ module StorecoveApi
32
20
  # ApiError.new(:code => 404, :message => "Not Found")
33
21
  def initialize(arg = nil)
34
22
  if arg.is_a? Hash
23
+ if arg.key?(:message) || arg.key?('message')
24
+ super(arg[:message] || arg['message'])
25
+ else
26
+ super arg
27
+ end
28
+
35
29
  arg.each do |k, v|
36
- if k.to_s == 'message'
37
- super v
38
- else
39
- instance_variable_set "@#{k}", v
40
- end
30
+ instance_variable_set "@#{k}", v
41
31
  end
42
32
  else
43
33
  super arg
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'uri'
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -89,22 +77,18 @@ module StorecoveApi
89
77
  # @return Array for valid properies with the reasons
90
78
  def list_invalid_properties
91
79
  invalid_properties = Array.new
92
-
93
80
  if !@code.nil? && @code.to_s.length < 1
94
81
  invalid_properties.push("invalid value for 'code', the character length must be great than or equal to 1.")
95
82
  end
96
83
 
97
-
98
84
  if !@list.nil? && @list.to_s.length < 1
99
85
  invalid_properties.push("invalid value for 'list', the character length must be great than or equal to 1.")
100
86
  end
101
87
 
102
-
103
88
  if !@list_version.nil? && @list_version.to_s.length < 1
104
89
  invalid_properties.push("invalid value for 'list_version', the character length must be great than or equal to 1.")
105
90
  end
106
91
 
107
-
108
92
  if !@list_agency.nil? && @list_agency.to_s.length < 1
109
93
  invalid_properties.push("invalid value for 'list_agency', the character length must be great than or equal to 1.")
110
94
  end
@@ -195,7 +179,7 @@ module StorecoveApi
195
179
  def build_from_hash(attributes)
196
180
  return nil unless attributes.is_a?(Hash)
197
181
  self.class.swagger_types.each_pair do |key, type|
198
- if type =~ /^Array<(.*)>/i
182
+ if type =~ /\AArray<(.*)>/i
199
183
  # check to ensure the input is an array given that the the attribute
200
184
  # is documented as an array but the input is not
201
185
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -226,7 +210,7 @@ module StorecoveApi
226
210
  when :Float
227
211
  value.to_f
228
212
  when :BOOLEAN
229
- if value.to_s =~ /^(true|t|yes|y|1)$/i
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
214
  true
231
215
  else
232
216
  false
@@ -237,7 +221,7 @@ module StorecoveApi
237
221
  when /\AArray<(?<inner_type>.+)>\z/
238
222
  inner_type = Regexp.last_match[:inner_type]
239
223
  value.map { |v| _deserialize(inner_type, v) }
240
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
225
  k_type = Regexp.last_match[:k_type]
242
226
  v_type = Regexp.last_match[:v_type]
243
227
  {}.tap do |hash|
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -70,6 +58,10 @@ module StorecoveApi
70
58
  # @return Array for valid properies with the reasons
71
59
  def list_invalid_properties
72
60
  invalid_properties = Array.new
61
+ if @party.nil?
62
+ invalid_properties.push("invalid value for 'party', party cannot be nil.")
63
+ end
64
+
73
65
  return invalid_properties
74
66
  end
75
67
 
@@ -107,7 +99,7 @@ module StorecoveApi
107
99
  def build_from_hash(attributes)
108
100
  return nil unless attributes.is_a?(Hash)
109
101
  self.class.swagger_types.each_pair do |key, type|
110
- if type =~ /^Array<(.*)>/i
102
+ if type =~ /\AArray<(.*)>/i
111
103
  # check to ensure the input is an array given that the the attribute
112
104
  # is documented as an array but the input is not
113
105
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -138,7 +130,7 @@ module StorecoveApi
138
130
  when :Float
139
131
  value.to_f
140
132
  when :BOOLEAN
141
- if value.to_s =~ /^(true|t|yes|y|1)$/i
133
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
134
  true
143
135
  else
144
136
  false
@@ -149,7 +141,7 @@ module StorecoveApi
149
141
  when /\AArray<(?<inner_type>.+)>\z/
150
142
  inner_type = Regexp.last_match[:inner_type]
151
143
  value.map { |v| _deserialize(inner_type, v) }
152
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
145
  k_type = Regexp.last_match[:k_type]
154
146
  v_type = Regexp.last_match[:v_type]
155
147
  {}.tap do |hash|
@@ -7,25 +7,13 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
25
13
 
26
14
  module StorecoveApi
27
15
  # The company address
28
- class PartyAddress
16
+ class Address
29
17
  # The postbox number
30
18
  attr_accessor :postbox
31
19
 
@@ -133,21 +121,22 @@ module StorecoveApi
133
121
  # @return Array for valid properies with the reasons
134
122
  def list_invalid_properties
135
123
  invalid_properties = Array.new
136
-
137
124
  if !@street1.nil? && @street1.to_s.length < 2
138
125
  invalid_properties.push("invalid value for 'street1', the character length must be great than or equal to 2.")
139
126
  end
140
127
 
141
-
142
128
  if !@city.nil? && @city.to_s.length < 2
143
129
  invalid_properties.push("invalid value for 'city', the character length must be great than or equal to 2.")
144
130
  end
145
131
 
146
-
147
132
  if !@zip.nil? && @zip.to_s.length < 2
148
133
  invalid_properties.push("invalid value for 'zip', the character length must be great than or equal to 2.")
149
134
  end
150
135
 
136
+ if @country.nil?
137
+ invalid_properties.push("invalid value for 'country', country cannot be nil.")
138
+ end
139
+
151
140
  return invalid_properties
152
141
  end
153
142
 
@@ -228,7 +217,7 @@ module StorecoveApi
228
217
  def build_from_hash(attributes)
229
218
  return nil unless attributes.is_a?(Hash)
230
219
  self.class.swagger_types.each_pair do |key, type|
231
- if type =~ /^Array<(.*)>/i
220
+ if type =~ /\AArray<(.*)>/i
232
221
  # check to ensure the input is an array given that the the attribute
233
222
  # is documented as an array but the input is not
234
223
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -259,7 +248,7 @@ module StorecoveApi
259
248
  when :Float
260
249
  value.to_f
261
250
  when :BOOLEAN
262
- if value.to_s =~ /^(true|t|yes|y|1)$/i
251
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
263
252
  true
264
253
  else
265
254
  false
@@ -270,7 +259,7 @@ module StorecoveApi
270
259
  when /\AArray<(?<inner_type>.+)>\z/
271
260
  inner_type = Regexp.last_match[:inner_type]
272
261
  value.map { |v| _deserialize(inner_type, v) }
273
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
262
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
274
263
  k_type = Regexp.last_match[:k_type]
275
264
  v_type = Regexp.last_match[:v_type]
276
265
  {}.tap do |hash|
@@ -7,25 +7,13 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
25
13
 
26
14
  module StorecoveApi
27
15
  # The billing contact
28
- class PartyContact
16
+ class Contact
29
17
  attr_accessor :first_name
30
18
 
31
19
  attr_accessor :last_name
@@ -77,6 +65,10 @@ module StorecoveApi
77
65
  # @return Array for valid properies with the reasons
78
66
  def list_invalid_properties
79
67
  invalid_properties = Array.new
68
+ if @email.nil?
69
+ invalid_properties.push("invalid value for 'email', email cannot be nil.")
70
+ end
71
+
80
72
  return invalid_properties
81
73
  end
82
74
 
@@ -115,7 +107,7 @@ module StorecoveApi
115
107
  def build_from_hash(attributes)
116
108
  return nil unless attributes.is_a?(Hash)
117
109
  self.class.swagger_types.each_pair do |key, type|
118
- if type =~ /^Array<(.*)>/i
110
+ if type =~ /\AArray<(.*)>/i
119
111
  # check to ensure the input is an array given that the the attribute
120
112
  # is documented as an array but the input is not
121
113
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -146,7 +138,7 @@ module StorecoveApi
146
138
  when :Float
147
139
  value.to_f
148
140
  when :BOOLEAN
149
- if value.to_s =~ /^(true|t|yes|y|1)$/i
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
142
  true
151
143
  else
152
144
  false
@@ -157,7 +149,7 @@ module StorecoveApi
157
149
  when /\AArray<(?<inner_type>.+)>\z/
158
150
  inner_type = Regexp.last_match[:inner_type]
159
151
  value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
153
  k_type = Regexp.last_match[:k_type]
162
154
  v_type = Regexp.last_match[:v_type]
163
155
  {}.tap do |hash|
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -7,18 +7,6 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -105,7 +93,7 @@ module StorecoveApi
105
93
  def build_from_hash(attributes)
106
94
  return nil unless attributes.is_a?(Hash)
107
95
  self.class.swagger_types.each_pair do |key, type|
108
- if type =~ /^Array<(.*)>/i
96
+ if type =~ /\AArray<(.*)>/i
109
97
  # check to ensure the input is an array given that the the attribute
110
98
  # is documented as an array but the input is not
111
99
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -136,7 +124,7 @@ module StorecoveApi
136
124
  when :Float
137
125
  value.to_f
138
126
  when :BOOLEAN
139
- if value.to_s =~ /^(true|t|yes|y|1)$/i
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
128
  true
141
129
  else
142
130
  false
@@ -147,7 +135,7 @@ module StorecoveApi
147
135
  when /\AArray<(?<inner_type>.+)>\z/
148
136
  inner_type = Regexp.last_match[:inner_type]
149
137
  value.map { |v| _deserialize(inner_type, v) }
150
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
139
  k_type = Regexp.last_match[:k_type]
152
140
  v_type = Regexp.last_match[:v_type]
153
141
  {}.tap do |hash|
@@ -7,33 +7,23 @@ OpenAPI spec version: 2.0.0
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
25
13
 
26
14
  module StorecoveApi
27
15
  # The invoice to send
28
- class InvoiceSubmissionInvoice
16
+ class Invoice
17
+ # The documentCurrencyCode is the currency for the entire invoice. We currently do not support invoices in multiple currencies.
29
18
  attr_accessor :document_currency_code
30
19
 
31
- # The invoice number you assigned to the invoice. The minimum length is 1 character, to allow invoice numbers 1-9.
20
+ # The invoice number you assigned to the invoice. The invoiceNumber should be unique for the supplierId and year of the issueDate. This means invoice numbers can be reused in different years, as is customary in some countries.
32
21
  attr_accessor :invoice_number
33
22
 
34
23
  # Format: yyyy-mm-dd.
35
24
  attr_accessor :issue_date
36
25
 
26
+ # The receiving party
37
27
  attr_accessor :accounting_customer_party
38
28
 
39
29
  # An array of invoice lines.
@@ -77,6 +67,9 @@ module StorecoveApi
77
67
  # The payment id that you will use to match the payment against the invoice.
78
68
  attr_accessor :payment_means_payment_id
79
69
 
70
+ # amountIncludingVat is important because of rounding differences. In many invoices, the sum of the line item amounts excluding VAT and the VAT amounts is not equal to first summing the line items without VAT, and then applying VAT. The difference is automatically calculated and included in the electronic invoice, so the receiving accounting package can process the electronic invoice without problems.
71
+ attr_accessor :amount_including_vat
72
+
80
73
  class EnumAttributeValidator
81
74
  attr_reader :datatype
82
75
  attr_reader :allowable_values
@@ -119,7 +112,8 @@ module StorecoveApi
119
112
  :'project_reference' => :'projectReference',
120
113
  :'payment_means_iban' => :'paymentMeansIban',
121
114
  :'payment_means_code' => :'paymentMeansCode',
122
- :'payment_means_payment_id' => :'paymentMeansPaymentId'
115
+ :'payment_means_payment_id' => :'paymentMeansPaymentId',
116
+ :'amount_including_vat' => :'amountIncludingVat'
123
117
  }
124
118
  end
125
119
 
@@ -143,7 +137,8 @@ module StorecoveApi
143
137
  :'project_reference' => :'String',
144
138
  :'payment_means_iban' => :'String',
145
139
  :'payment_means_code' => :'String',
146
- :'payment_means_payment_id' => :'String'
140
+ :'payment_means_payment_id' => :'String',
141
+ :'amount_including_vat' => :'Float'
147
142
  }
148
143
  end
149
144
 
@@ -231,12 +226,20 @@ module StorecoveApi
231
226
  self.payment_means_payment_id = attributes[:'paymentMeansPaymentId']
232
227
  end
233
228
 
229
+ if attributes.has_key?(:'amountIncludingVat')
230
+ self.amount_including_vat = attributes[:'amountIncludingVat']
231
+ end
232
+
234
233
  end
235
234
 
236
235
  # Show invalid properties with the reasons. Usually used together with valid?
237
236
  # @return Array for valid properies with the reasons
238
237
  def list_invalid_properties
239
238
  invalid_properties = Array.new
239
+ if @document_currency_code.nil?
240
+ invalid_properties.push("invalid value for 'document_currency_code', document_currency_code cannot be nil.")
241
+ end
242
+
240
243
  if @invoice_number.nil?
241
244
  invalid_properties.push("invalid value for 'invoice_number', invoice_number cannot be nil.")
242
245
  end
@@ -249,23 +252,32 @@ module StorecoveApi
249
252
  invalid_properties.push("invalid value for 'issue_date', issue_date cannot be nil.")
250
253
  end
251
254
 
252
- if @issue_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
253
- invalid_properties.push("invalid value for 'issue_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/.")
255
+ if @issue_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
256
+ invalid_properties.push("invalid value for 'issue_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.")
254
257
  end
255
258
 
259
+ if @accounting_customer_party.nil?
260
+ invalid_properties.push("invalid value for 'accounting_customer_party', accounting_customer_party cannot be nil.")
261
+ end
256
262
 
257
- if !@due_date.nil? && @due_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
258
- invalid_properties.push("invalid value for 'due_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/.")
263
+ if @invoice_lines.nil?
264
+ invalid_properties.push("invalid value for 'invoice_lines', invoice_lines cannot be nil.")
259
265
  end
260
266
 
267
+ if !@due_date.nil? && @due_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
268
+ invalid_properties.push("invalid value for 'due_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.")
269
+ end
261
270
 
262
- if !@tax_point_date.nil? && @tax_point_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
263
- invalid_properties.push("invalid value for 'tax_point_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/.")
271
+ if !@tax_point_date.nil? && @tax_point_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
272
+ invalid_properties.push("invalid value for 'tax_point_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.")
264
273
  end
265
274
 
275
+ if !@invoice_period.nil? && @invoice_period !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2} - [0-9]{4}-[0-9]{2}-[0-9]{2}$/)
276
+ invalid_properties.push("invalid value for 'invoice_period', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2} - [0-9]{4}-[0-9]{2}-[0-9]{2}$/.")
277
+ end
266
278
 
267
- if !@invoice_period.nil? && @invoice_period !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}\\s+-\\s+\\d{4}-\\d{2}-\\d{2}$/)
268
- invalid_properties.push("invalid value for 'invoice_period', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}\\s+-\\s+\\d{4}-\\d{2}-\\d{2}$/.")
279
+ if @amount_including_vat.nil?
280
+ invalid_properties.push("invalid value for 'amount_including_vat', amount_including_vat cannot be nil.")
269
281
  end
270
282
 
271
283
  return invalid_properties
@@ -278,14 +290,15 @@ module StorecoveApi
278
290
  return false if @invoice_number.nil?
279
291
  return false if @invoice_number.to_s.length < 1
280
292
  return false if @issue_date.nil?
281
- return false if @issue_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
293
+ return false if @issue_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
282
294
  return false if @accounting_customer_party.nil?
283
295
  return false if @invoice_lines.nil?
284
- return false if !@due_date.nil? && @due_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
296
+ return false if !@due_date.nil? && @due_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
285
297
  invoice_type_validator = EnumAttributeValidator.new('String', ["380", "384"])
286
298
  return false unless invoice_type_validator.valid?(@invoice_type)
287
- return false if !@tax_point_date.nil? && @tax_point_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
288
- return false if !@invoice_period.nil? && @invoice_period !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}\\s+-\\s+\\d{4}-\\d{2}-\\d{2}$/)
299
+ return false if !@tax_point_date.nil? && @tax_point_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
300
+ return false if !@invoice_period.nil? && @invoice_period !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2} - [0-9]{4}-[0-9]{2}-[0-9]{2}$/)
301
+ return false if @amount_including_vat.nil?
289
302
  return true
290
303
  end
291
304
 
@@ -310,8 +323,8 @@ module StorecoveApi
310
323
  fail ArgumentError, "issue_date cannot be nil"
311
324
  end
312
325
 
313
- if issue_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
314
- fail ArgumentError, "invalid value for 'issue_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/."
326
+ if issue_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
327
+ fail ArgumentError, "invalid value for 'issue_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/."
315
328
  end
316
329
 
317
330
  @issue_date = issue_date
@@ -321,8 +334,8 @@ module StorecoveApi
321
334
  # @param [Object] due_date Value to be assigned
322
335
  def due_date=(due_date)
323
336
 
324
- if !due_date.nil? && due_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
325
- fail ArgumentError, "invalid value for 'due_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/."
337
+ if !due_date.nil? && due_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
338
+ fail ArgumentError, "invalid value for 'due_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/."
326
339
  end
327
340
 
328
341
  @due_date = due_date
@@ -342,8 +355,8 @@ module StorecoveApi
342
355
  # @param [Object] tax_point_date Value to be assigned
343
356
  def tax_point_date=(tax_point_date)
344
357
 
345
- if !tax_point_date.nil? && tax_point_date !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/)
346
- fail ArgumentError, "invalid value for 'tax_point_date', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}$/."
358
+ if !tax_point_date.nil? && tax_point_date !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)
359
+ fail ArgumentError, "invalid value for 'tax_point_date', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/."
347
360
  end
348
361
 
349
362
  @tax_point_date = tax_point_date
@@ -353,8 +366,8 @@ module StorecoveApi
353
366
  # @param [Object] invoice_period Value to be assigned
354
367
  def invoice_period=(invoice_period)
355
368
 
356
- if !invoice_period.nil? && invoice_period !~ Regexp.new(/^\\d{4}-\\d{2}-\\d{2}\\s+-\\s+\\d{4}-\\d{2}-\\d{2}$/)
357
- fail ArgumentError, "invalid value for 'invoice_period', must conform to the pattern /^\\d{4}-\\d{2}-\\d{2}\\s+-\\s+\\d{4}-\\d{2}-\\d{2}$/."
369
+ if !invoice_period.nil? && invoice_period !~ Regexp.new(/^[0-9]{4}-[0-9]{2}-[0-9]{2} - [0-9]{4}-[0-9]{2}-[0-9]{2}$/)
370
+ fail ArgumentError, "invalid value for 'invoice_period', must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2} - [0-9]{4}-[0-9]{2}-[0-9]{2}$/."
358
371
  end
359
372
 
360
373
  @invoice_period = invoice_period
@@ -382,7 +395,8 @@ module StorecoveApi
382
395
  project_reference == o.project_reference &&
383
396
  payment_means_iban == o.payment_means_iban &&
384
397
  payment_means_code == o.payment_means_code &&
385
- payment_means_payment_id == o.payment_means_payment_id
398
+ payment_means_payment_id == o.payment_means_payment_id &&
399
+ amount_including_vat == o.amount_including_vat
386
400
  end
387
401
 
388
402
  # @see the `==` method
@@ -394,7 +408,7 @@ module StorecoveApi
394
408
  # Calculates hash code according to all attributes.
395
409
  # @return [Fixnum] Hash code
396
410
  def hash
397
- [document_currency_code, invoice_number, issue_date, accounting_customer_party, invoice_lines, accounting_cost_code, due_date, invoice_type, tax_point_date, buyer_reference, invoice_period, order_reference, billing_reference, contract_document_reference, project_reference, payment_means_iban, payment_means_code, payment_means_payment_id].hash
411
+ [document_currency_code, invoice_number, issue_date, accounting_customer_party, invoice_lines, accounting_cost_code, due_date, invoice_type, tax_point_date, buyer_reference, invoice_period, order_reference, billing_reference, contract_document_reference, project_reference, payment_means_iban, payment_means_code, payment_means_payment_id, amount_including_vat].hash
398
412
  end
399
413
 
400
414
  # Builds the object from hash
@@ -403,7 +417,7 @@ module StorecoveApi
403
417
  def build_from_hash(attributes)
404
418
  return nil unless attributes.is_a?(Hash)
405
419
  self.class.swagger_types.each_pair do |key, type|
406
- if type =~ /^Array<(.*)>/i
420
+ if type =~ /\AArray<(.*)>/i
407
421
  # check to ensure the input is an array given that the the attribute
408
422
  # is documented as an array but the input is not
409
423
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -434,7 +448,7 @@ module StorecoveApi
434
448
  when :Float
435
449
  value.to_f
436
450
  when :BOOLEAN
437
- if value.to_s =~ /^(true|t|yes|y|1)$/i
451
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
438
452
  true
439
453
  else
440
454
  false
@@ -445,7 +459,7 @@ module StorecoveApi
445
459
  when /\AArray<(?<inner_type>.+)>\z/
446
460
  inner_type = Regexp.last_match[:inner_type]
447
461
  value.map { |v| _deserialize(inner_type, v) }
448
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
462
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
449
463
  k_type = Regexp.last_match[:k_type]
450
464
  v_type = Regexp.last_match[:v_type]
451
465
  {}.tap do |hash|