storecove 1.0.3

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.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/lib/storecove/api/invoice_submissions_api.rb +148 -0
  3. data/lib/storecove/api/shop_account_requests_api.rb +323 -0
  4. data/lib/storecove/api/shop_accounts_api.rb +376 -0
  5. data/lib/storecove/api/shops_api.rb +87 -0
  6. data/lib/storecove/api_client.rb +379 -0
  7. data/lib/storecove/api_error.rb +47 -0
  8. data/lib/storecove/configuration.rb +214 -0
  9. data/lib/storecove/models/accounting_cost_code.rb +298 -0
  10. data/lib/storecove/models/accounting_customer_party.rb +210 -0
  11. data/lib/storecove/models/country.rb +280 -0
  12. data/lib/storecove/models/currency_code.rb +209 -0
  13. data/lib/storecove/models/error_model.rb +208 -0
  14. data/lib/storecove/models/invoice_line.rb +327 -0
  15. data/lib/storecove/models/invoice_line_tax.rb +222 -0
  16. data/lib/storecove/models/invoice_recipient.rb +227 -0
  17. data/lib/storecove/models/invoice_recipient_preflight.rb +211 -0
  18. data/lib/storecove/models/invoice_submission.rb +321 -0
  19. data/lib/storecove/models/invoice_submission_invoice.rb +506 -0
  20. data/lib/storecove/models/invoice_submission_result.rb +200 -0
  21. data/lib/storecove/models/legal_entity.rb +264 -0
  22. data/lib/storecove/models/legal_entity_identifier.rb +217 -0
  23. data/lib/storecove/models/logos.rb +217 -0
  24. data/lib/storecove/models/party.rb +242 -0
  25. data/lib/storecove/models/party_address.rb +331 -0
  26. data/lib/storecove/models/party_contact.rb +218 -0
  27. data/lib/storecove/models/preflight_invoice_recipient_result.rb +233 -0
  28. data/lib/storecove/models/public_identifiers.rb +190 -0
  29. data/lib/storecove/models/public_identifiers_inner.rb +258 -0
  30. data/lib/storecove/models/shop.rb +237 -0
  31. data/lib/storecove/models/shop_account.rb +270 -0
  32. data/lib/storecove/models/shop_account_input.rb +244 -0
  33. data/lib/storecove/models/shop_account_request.rb +236 -0
  34. data/lib/storecove/models/shop_account_request_input.rb +235 -0
  35. data/lib/storecove/models/shop_account_request_update.rb +226 -0
  36. data/lib/storecove/models/shop_account_update.rb +220 -0
  37. data/lib/storecove/models/swagger-codegen +2799 -0
  38. data/lib/storecove/version.rb +26 -0
  39. data/lib/storecove.rb +82 -0
  40. data/storecove.gemspec +55 -0
  41. metadata +263 -0
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #Storecove API
3
+
4
+ #Storecove API
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: apisupport@storecove.nl
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
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
+ =end
23
+
24
+ require 'date'
25
+
26
+ module StorecoveApi
27
+ # A party that can receive or send invoices
28
+ class Party
29
+ # The name of the company receiving the invoice
30
+ attr_accessor :company_name
31
+
32
+ attr_accessor :address
33
+
34
+ attr_accessor :contact
35
+
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'company_name' => :'companyName',
41
+ :'address' => :'address',
42
+ :'contact' => :'contact'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'company_name' => :'String',
50
+ :'address' => :'PartyAddress',
51
+ :'contact' => :'PartyContact'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'companyName')
64
+ self.company_name = attributes[:'companyName']
65
+ end
66
+
67
+ if attributes.has_key?(:'address')
68
+ self.address = attributes[:'address']
69
+ end
70
+
71
+ if attributes.has_key?(:'contact')
72
+ self.contact = attributes[:'contact']
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properies with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @company_name.nil?
82
+ invalid_properties.push("invalid value for 'company_name', company_name cannot be nil.")
83
+ end
84
+
85
+ if @company_name.to_s.length < 2
86
+ invalid_properties.push("invalid value for 'company_name', the character length must be great than or equal to 2.")
87
+ end
88
+
89
+ return invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @company_name.nil?
96
+ return false if @company_name.to_s.length < 2
97
+ return true
98
+ end
99
+
100
+ # Custom attribute writer method with validation
101
+ # @param [Object] company_name Value to be assigned
102
+ def company_name=(company_name)
103
+ if company_name.nil?
104
+ fail ArgumentError, "company_name cannot be nil"
105
+ end
106
+
107
+ if company_name.to_s.length < 2
108
+ fail ArgumentError, "invalid value for 'company_name', the character length must be great than or equal to 2."
109
+ end
110
+
111
+ @company_name = company_name
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ company_name == o.company_name &&
120
+ address == o.address &&
121
+ contact == o.contact
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Fixnum] Hash code
132
+ def hash
133
+ [company_name, address, contact].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /^Array<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :BOOLEAN
173
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ temp_model = StorecoveApi.const_get(type).new
194
+ temp_model.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ next if value.nil?
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map{ |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -0,0 +1,331 @@
1
+ =begin
2
+ #Storecove API
3
+
4
+ #Storecove API
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: apisupport@storecove.nl
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
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
+ =end
23
+
24
+ require 'date'
25
+
26
+ module StorecoveApi
27
+ # The company address
28
+ class PartyAddress
29
+ # The postbox number
30
+ attr_accessor :postbox
31
+
32
+ # The department the invoice is addressed to
33
+ attr_accessor :department
34
+
35
+ # The street name. The number can be provided in this fiedl OR in the number field, but not in both.
36
+ attr_accessor :street1
37
+
38
+ # The second street field. Use this if you used the first field for the building name.
39
+ attr_accessor :street2
40
+
41
+ # This number will be added to the street1 element. The number can be provided in this field OR in the street1 field, but not in both.
42
+ attr_accessor :number
43
+
44
+ # The name of the city.
45
+ attr_accessor :city
46
+
47
+ # The zipcode/postalzone.
48
+ attr_accessor :zip
49
+
50
+ # An optional county name.
51
+ attr_accessor :county
52
+
53
+ attr_accessor :country
54
+
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'postbox' => :'postbox',
60
+ :'department' => :'department',
61
+ :'street1' => :'street1',
62
+ :'street2' => :'street2',
63
+ :'number' => :'number',
64
+ :'city' => :'city',
65
+ :'zip' => :'zip',
66
+ :'county' => :'county',
67
+ :'country' => :'country'
68
+ }
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.swagger_types
73
+ {
74
+ :'postbox' => :'String',
75
+ :'department' => :'String',
76
+ :'street1' => :'String',
77
+ :'street2' => :'String',
78
+ :'number' => :'String',
79
+ :'city' => :'String',
80
+ :'zip' => :'String',
81
+ :'county' => :'String',
82
+ :'country' => :'Country'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
93
+
94
+ if attributes.has_key?(:'postbox')
95
+ self.postbox = attributes[:'postbox']
96
+ end
97
+
98
+ if attributes.has_key?(:'department')
99
+ self.department = attributes[:'department']
100
+ end
101
+
102
+ if attributes.has_key?(:'street1')
103
+ self.street1 = attributes[:'street1']
104
+ end
105
+
106
+ if attributes.has_key?(:'street2')
107
+ self.street2 = attributes[:'street2']
108
+ end
109
+
110
+ if attributes.has_key?(:'number')
111
+ self.number = attributes[:'number']
112
+ end
113
+
114
+ if attributes.has_key?(:'city')
115
+ self.city = attributes[:'city']
116
+ end
117
+
118
+ if attributes.has_key?(:'zip')
119
+ self.zip = attributes[:'zip']
120
+ end
121
+
122
+ if attributes.has_key?(:'county')
123
+ self.county = attributes[:'county']
124
+ end
125
+
126
+ if attributes.has_key?(:'country')
127
+ self.country = attributes[:'country']
128
+ end
129
+
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properies with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+
137
+ if !@street1.nil? && @street1.to_s.length < 2
138
+ invalid_properties.push("invalid value for 'street1', the character length must be great than or equal to 2.")
139
+ end
140
+
141
+
142
+ if !@city.nil? && @city.to_s.length < 2
143
+ invalid_properties.push("invalid value for 'city', the character length must be great than or equal to 2.")
144
+ end
145
+
146
+
147
+ if !@zip.nil? && @zip.to_s.length < 2
148
+ invalid_properties.push("invalid value for 'zip', the character length must be great than or equal to 2.")
149
+ end
150
+
151
+ return invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ return false if !@street1.nil? && @street1.to_s.length < 2
158
+ return false if !@city.nil? && @city.to_s.length < 2
159
+ return false if !@zip.nil? && @zip.to_s.length < 2
160
+ return false if @country.nil?
161
+ return true
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] street1 Value to be assigned
166
+ def street1=(street1)
167
+
168
+ if !street1.nil? && street1.to_s.length < 2
169
+ fail ArgumentError, "invalid value for 'street1', the character length must be great than or equal to 2."
170
+ end
171
+
172
+ @street1 = street1
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] city Value to be assigned
177
+ def city=(city)
178
+
179
+ if !city.nil? && city.to_s.length < 2
180
+ fail ArgumentError, "invalid value for 'city', the character length must be great than or equal to 2."
181
+ end
182
+
183
+ @city = city
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] zip Value to be assigned
188
+ def zip=(zip)
189
+
190
+ if !zip.nil? && zip.to_s.length < 2
191
+ fail ArgumentError, "invalid value for 'zip', the character length must be great than or equal to 2."
192
+ end
193
+
194
+ @zip = zip
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ postbox == o.postbox &&
203
+ department == o.department &&
204
+ street1 == o.street1 &&
205
+ street2 == o.street2 &&
206
+ number == o.number &&
207
+ city == o.city &&
208
+ zip == o.zip &&
209
+ county == o.county &&
210
+ country == o.country
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Fixnum] Hash code
221
+ def hash
222
+ [postbox, department, street1, street2, number, city, zip, county, country].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+ self.class.swagger_types.each_pair do |key, type|
231
+ if type =~ /^Array<(.*)>/i
232
+ # check to ensure the input is an array given that the the attribute
233
+ # is documented as an array but the input is not
234
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
235
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
236
+ end
237
+ elsif !attributes[self.class.attribute_map[key]].nil?
238
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
239
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
240
+ end
241
+
242
+ self
243
+ end
244
+
245
+ # Deserializes the data based on type
246
+ # @param string type Data type
247
+ # @param string value Value to be deserialized
248
+ # @return [Object] Deserialized data
249
+ def _deserialize(type, value)
250
+ case type.to_sym
251
+ when :DateTime
252
+ DateTime.parse(value)
253
+ when :Date
254
+ Date.parse(value)
255
+ when :String
256
+ value.to_s
257
+ when :Integer
258
+ value.to_i
259
+ when :Float
260
+ value.to_f
261
+ when :BOOLEAN
262
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
263
+ true
264
+ else
265
+ false
266
+ end
267
+ when :Object
268
+ # generic object (usually a Hash), return directly
269
+ value
270
+ when /\AArray<(?<inner_type>.+)>\z/
271
+ inner_type = Regexp.last_match[:inner_type]
272
+ value.map { |v| _deserialize(inner_type, v) }
273
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
274
+ k_type = Regexp.last_match[:k_type]
275
+ v_type = Regexp.last_match[:v_type]
276
+ {}.tap do |hash|
277
+ value.each do |k, v|
278
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
279
+ end
280
+ end
281
+ else # model
282
+ temp_model = StorecoveApi.const_get(type).new
283
+ temp_model.build_from_hash(value)
284
+ end
285
+ end
286
+
287
+ # Returns the string representation of the object
288
+ # @return [String] String presentation of the object
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_hash (backward compatibility)
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ next if value.nil?
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ # Outputs non-array value in the form of hash
312
+ # For object, use to_hash. Otherwise, just return the value
313
+ # @param [Object] value Any valid value
314
+ # @return [Hash] Returns the value in the form of hash
315
+ def _to_hash(value)
316
+ if value.is_a?(Array)
317
+ value.compact.map{ |v| _to_hash(v) }
318
+ elsif value.is_a?(Hash)
319
+ {}.tap do |hash|
320
+ value.each { |k, v| hash[k] = _to_hash(v) }
321
+ end
322
+ elsif value.respond_to? :to_hash
323
+ value.to_hash
324
+ else
325
+ value
326
+ end
327
+ end
328
+
329
+ end
330
+
331
+ end