storecove 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/lib/storecove.rb +20 -1
  5. data/lib/storecove/api/invoice_submissions_api.rb +9 -4
  6. data/lib/storecove/api/legal_entities_api.rb +248 -0
  7. data/lib/storecove/api/peppol_identifiers_api.rb +156 -0
  8. data/lib/storecove/api/purchase_invoices_api.rb +133 -0
  9. data/lib/storecove/api/shop_account_requests_api.rb +24 -11
  10. data/lib/storecove/api/shop_accounts_api.rb +25 -12
  11. data/lib/storecove/api/shops_api.rb +2 -1
  12. data/lib/storecove/api_client.rb +39 -26
  13. data/lib/storecove/api_error.rb +1 -0
  14. data/lib/storecove/configuration.rb +7 -0
  15. data/lib/storecove/models/accounting_cost_code.rb +2 -1
  16. data/lib/storecove/models/accounting_customer_party.rb +2 -1
  17. data/lib/storecove/models/accounting_details.rb +219 -0
  18. data/lib/storecove/models/accounting_details_1.rb +219 -0
  19. data/lib/storecove/models/address.rb +2 -1
  20. data/lib/storecove/models/contact.rb +2 -6
  21. data/lib/storecove/models/country.rb +10 -0
  22. data/lib/storecove/models/currency_code.rb +10 -0
  23. data/lib/storecove/models/error_model.rb +2 -1
  24. data/lib/storecove/models/invoice.rb +16 -3
  25. data/lib/storecove/models/invoice_line.rb +251 -6
  26. data/lib/storecove/models/invoice_recipient.rb +24 -11
  27. data/lib/storecove/models/invoice_recipient_preflight.rb +21 -19
  28. data/lib/storecove/models/invoice_submission.rb +20 -9
  29. data/lib/storecove/models/invoice_submission_result.rb +2 -1
  30. data/lib/storecove/models/legal_entity.rb +164 -25
  31. data/lib/storecove/models/legal_entity_create.rb +417 -0
  32. data/lib/storecove/models/legal_entity_identifier.rb +2 -1
  33. data/lib/storecove/models/legal_entity_shop.rb +253 -0
  34. data/lib/storecove/models/legal_entity_update.rb +380 -0
  35. data/lib/storecove/models/logos.rb +2 -1
  36. data/lib/storecove/models/party.rb +7 -1
  37. data/lib/storecove/models/payment_means.rb +199 -0
  38. data/lib/storecove/models/peppol_identifier.rb +284 -0
  39. data/lib/storecove/models/peppol_identifier_create.rb +308 -0
  40. data/lib/storecove/models/preflight_invoice_recipient_result.rb +2 -1
  41. data/lib/storecove/models/public_identifier.rb +3 -2
  42. data/lib/storecove/models/public_identifiers.rb +2 -1
  43. data/lib/storecove/models/purchase_invoice.rb +463 -0
  44. data/lib/storecove/models/purchase_invoice_invoice_line.rb +247 -0
  45. data/lib/storecove/models/purchase_invoice_sender.rb +280 -0
  46. data/lib/storecove/models/purchase_invoice_sender_billing_contact.rb +209 -0
  47. data/lib/storecove/models/purchase_invoice_ubl.rb +209 -0
  48. data/lib/storecove/models/shop.rb +3 -2
  49. data/lib/storecove/models/shop_account_input.rb +2 -1
  50. data/lib/storecove/models/shop_account_request_input.rb +2 -1
  51. data/lib/storecove/models/shop_account_request_result.rb +2 -1
  52. data/lib/storecove/models/shop_account_request_update.rb +2 -1
  53. data/lib/storecove/models/shop_account_result.rb +2 -1
  54. data/lib/storecove/models/shop_account_update.rb +2 -1
  55. data/lib/storecove/models/tax.rb +2 -1
  56. data/lib/storecove/models/vat_details.rb +209 -0
  57. data/lib/storecove/models/widget_identification.rb +228 -0
  58. data/lib/storecove/version.rb +2 -1
  59. data/spec/api/invoice_submissions_api_spec.rb +9 -20
  60. data/spec/api/legal_entities_api_spec.rb +84 -0
  61. data/spec/api/peppol_identifiers_api_spec.rb +63 -0
  62. data/spec/api/purchase_invoices_api_spec.rb +59 -0
  63. data/spec/api/shop_account_requests_api_spec.rb +30 -41
  64. data/spec/api/shop_accounts_api_spec.rb +34 -45
  65. data/spec/api/shops_api_spec.rb +6 -17
  66. data/spec/api_client_spec.rb +2 -13
  67. data/spec/configuration_spec.rb +2 -13
  68. data/spec/models/accounting_cost_code_spec.rb +3 -14
  69. data/spec/models/accounting_customer_party_spec.rb +3 -14
  70. data/spec/models/accounting_details_1_spec.rb +60 -0
  71. data/spec/models/accounting_details_spec.rb +60 -0
  72. data/spec/models/{party_address_spec.rb → address_spec.rb} +8 -19
  73. data/spec/models/{party_contact_spec.rb → contact_spec.rb} +8 -19
  74. data/spec/models/country_spec.rb +3 -14
  75. data/spec/models/currency_code_spec.rb +3 -14
  76. data/spec/models/error_model_spec.rb +3 -14
  77. data/spec/models/invoice_line_spec.rb +69 -14
  78. data/spec/models/invoice_recipient_preflight_spec.rb +10 -15
  79. data/spec/models/invoice_recipient_spec.rb +15 -14
  80. data/spec/models/{invoice_submission_invoice_spec.rb → invoice_spec.rb} +20 -19
  81. data/spec/models/invoice_submission_result_spec.rb +4 -15
  82. data/spec/models/invoice_submission_spec.rb +4 -15
  83. data/spec/models/legal_entity_create_spec.rb +78 -0
  84. data/spec/models/legal_entity_identifier_spec.rb +3 -14
  85. data/spec/models/legal_entity_shop_spec.rb +84 -0
  86. data/spec/models/legal_entity_spec.rb +7 -18
  87. data/spec/models/legal_entity_update_spec.rb +78 -0
  88. data/spec/models/logos_spec.rb +3 -14
  89. data/spec/models/party_spec.rb +3 -14
  90. data/spec/models/payment_means_spec.rb +48 -0
  91. data/spec/models/peppol_identifier_create_spec.rb +54 -0
  92. data/spec/models/peppol_identifier_spec.rb +54 -0
  93. data/spec/models/preflight_invoice_recipient_result_spec.rb +3 -14
  94. data/spec/models/public_identifier_spec.rb +3 -14
  95. data/spec/models/public_identifiers_spec.rb +3 -14
  96. data/spec/models/purchase_invoice_invoice_line_spec.rb +78 -0
  97. data/spec/models/purchase_invoice_sender_billing_contact_spec.rb +54 -0
  98. data/spec/models/purchase_invoice_sender_spec.rb +96 -0
  99. data/spec/models/purchase_invoice_spec.rb +188 -0
  100. data/spec/models/purchase_invoice_ubl_spec.rb +54 -0
  101. data/spec/models/shop_account_input_spec.rb +3 -14
  102. data/spec/models/shop_account_request_input_spec.rb +3 -14
  103. data/spec/models/{shop_account_request_spec.rb → shop_account_request_result_spec.rb} +8 -19
  104. data/spec/models/shop_account_request_update_spec.rb +3 -14
  105. data/spec/models/shop_account_result_spec.rb +3 -14
  106. data/spec/models/shop_account_update_spec.rb +3 -14
  107. data/spec/models/shop_spec.rb +3 -14
  108. data/spec/models/{invoice_line_tax_spec.rb → tax_spec.rb} +8 -19
  109. data/spec/models/vat_details_spec.rb +54 -0
  110. data/spec/models/widget_identification_spec.rb +48 -0
  111. data/spec/spec_helper.rb +2 -13
  112. data/storecove.gemspec +10 -19
  113. metadata +83 -28
@@ -6,6 +6,7 @@
6
6
  OpenAPI spec version: 2.0.1
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
9
10
 
10
11
  =end
11
12
 
@@ -14,22 +15,26 @@ require 'date'
14
15
  module StorecoveApi
15
16
  # Ids that identify this invoice recipient. The list of identifiers should match with the accountingCustomerParty. I.e., you should not be sending an invoice for one accountingCustomerParty to the publicIdentifier of another.
16
17
  class InvoiceRecipient
17
- # Your id for this organization. This should match the id that you use for the Storecove widget (if you use that).
18
+ # DEPRECATED. Use widgetIdentification.id
18
19
  attr_accessor :id
19
20
 
20
- # The public identifiers for this invoice recipient. Either an id, or one or more public identifiers must be given
21
+ # The identification for the identifier related to the Storecove Destination Configuration widget.
22
+ attr_accessor :widget_identification
23
+
24
+ # The public identifiers for this invoice recipient. These are the identifiers used on the Peppol network.
21
25
  attr_accessor :public_identifiers
22
26
 
23
- # The email address the invoice should be sent to if none of the other identifiers can be used
24
- attr_accessor :fallback_email
27
+ # The email addresses the invoice should be sent to if none of the other identifiers can be used
28
+ attr_accessor :emails
25
29
 
26
30
 
27
31
  # Attribute mapping from ruby-style variable name to JSON key.
28
32
  def self.attribute_map
29
33
  {
30
34
  :'id' => :'id',
35
+ :'widget_identification' => :'widgetIdentification',
31
36
  :'public_identifiers' => :'publicIdentifiers',
32
- :'fallback_email' => :'fallbackEmail'
37
+ :'emails' => :'emails'
33
38
  }
34
39
  end
35
40
 
@@ -37,8 +42,9 @@ module StorecoveApi
37
42
  def self.swagger_types
38
43
  {
39
44
  :'id' => :'String',
45
+ :'widget_identification' => :'WidgetIdentification',
40
46
  :'public_identifiers' => :'PublicIdentifiers',
41
- :'fallback_email' => :'String'
47
+ :'emails' => :'Array<String>'
42
48
  }
43
49
  end
44
50
 
@@ -54,18 +60,24 @@ module StorecoveApi
54
60
  self.id = attributes[:'id']
55
61
  end
56
62
 
63
+ if attributes.has_key?(:'widgetIdentification')
64
+ self.widget_identification = attributes[:'widgetIdentification']
65
+ end
66
+
57
67
  if attributes.has_key?(:'publicIdentifiers')
58
68
  self.public_identifiers = attributes[:'publicIdentifiers']
59
69
  end
60
70
 
61
- if attributes.has_key?(:'fallbackEmail')
62
- self.fallback_email = attributes[:'fallbackEmail']
71
+ if attributes.has_key?(:'emails')
72
+ if (value = attributes[:'emails']).is_a?(Array)
73
+ self.emails = value
74
+ end
63
75
  end
64
76
 
65
77
  end
66
78
 
67
79
  # Show invalid properties with the reasons. Usually used together with valid?
68
- # @return Array for valid properies with the reasons
80
+ # @return Array for valid properties with the reasons
69
81
  def list_invalid_properties
70
82
  invalid_properties = Array.new
71
83
  if !@id.nil? && @id.to_s.length < 2
@@ -99,8 +111,9 @@ module StorecoveApi
99
111
  return true if self.equal?(o)
100
112
  self.class == o.class &&
101
113
  id == o.id &&
114
+ widget_identification == o.widget_identification &&
102
115
  public_identifiers == o.public_identifiers &&
103
- fallback_email == o.fallback_email
116
+ emails == o.emails
104
117
  end
105
118
 
106
119
  # @see the `==` method
@@ -112,7 +125,7 @@ module StorecoveApi
112
125
  # Calculates hash code according to all attributes.
113
126
  # @return [Fixnum] Hash code
114
127
  def hash
115
- [id, public_identifiers, fallback_email].hash
128
+ [id, widget_identification, public_identifiers, emails].hash
116
129
  end
117
130
 
118
131
  # Builds the object from hash
@@ -6,6 +6,7 @@
6
6
  OpenAPI spec version: 2.0.1
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
9
10
 
10
11
  =end
11
12
 
@@ -14,17 +15,22 @@ require 'date'
14
15
  module StorecoveApi
15
16
  # Identifies the invoice recipient to preflight
16
17
  class InvoiceRecipientPreflight
17
- # The supplier id, provided by Storecove.
18
+ # DEPRECATED.
18
19
  attr_accessor :supplier_id
19
20
 
20
- attr_accessor :invoice_recipient
21
+ # The identification for the identifier related to the Storecove Destination Configuration widget.
22
+ attr_accessor :widget_identification
23
+
24
+ # The public identifiers for this invoice recipient.
25
+ attr_accessor :public_identifiers
21
26
 
22
27
 
23
28
  # Attribute mapping from ruby-style variable name to JSON key.
24
29
  def self.attribute_map
25
30
  {
26
31
  :'supplier_id' => :'supplierId',
27
- :'invoice_recipient' => :'invoiceRecipient'
32
+ :'widget_identification' => :'widgetIdentification',
33
+ :'public_identifiers' => :'publicIdentifiers'
28
34
  }
29
35
  end
30
36
 
@@ -32,7 +38,8 @@ module StorecoveApi
32
38
  def self.swagger_types
33
39
  {
34
40
  :'supplier_id' => :'Integer',
35
- :'invoice_recipient' => :'InvoiceRecipient'
41
+ :'widget_identification' => :'WidgetIdentification',
42
+ :'public_identifiers' => :'PublicIdentifiers'
36
43
  }
37
44
  end
38
45
 
@@ -48,32 +55,26 @@ module StorecoveApi
48
55
  self.supplier_id = attributes[:'supplierId']
49
56
  end
50
57
 
51
- if attributes.has_key?(:'invoiceRecipient')
52
- self.invoice_recipient = attributes[:'invoiceRecipient']
58
+ if attributes.has_key?(:'widgetIdentification')
59
+ self.widget_identification = attributes[:'widgetIdentification']
60
+ end
61
+
62
+ if attributes.has_key?(:'publicIdentifiers')
63
+ self.public_identifiers = attributes[:'publicIdentifiers']
53
64
  end
54
65
 
55
66
  end
56
67
 
57
68
  # Show invalid properties with the reasons. Usually used together with valid?
58
- # @return Array for valid properies with the reasons
69
+ # @return Array for valid properties with the reasons
59
70
  def list_invalid_properties
60
71
  invalid_properties = Array.new
61
- if @supplier_id.nil?
62
- invalid_properties.push("invalid value for 'supplier_id', supplier_id cannot be nil.")
63
- end
64
-
65
- if @invoice_recipient.nil?
66
- invalid_properties.push("invalid value for 'invoice_recipient', invoice_recipient cannot be nil.")
67
- end
68
-
69
72
  return invalid_properties
70
73
  end
71
74
 
72
75
  # Check to see if the all the properties in the model are valid
73
76
  # @return true if the model is valid
74
77
  def valid?
75
- return false if @supplier_id.nil?
76
- return false if @invoice_recipient.nil?
77
78
  return true
78
79
  end
79
80
 
@@ -83,7 +84,8 @@ module StorecoveApi
83
84
  return true if self.equal?(o)
84
85
  self.class == o.class &&
85
86
  supplier_id == o.supplier_id &&
86
- invoice_recipient == o.invoice_recipient
87
+ widget_identification == o.widget_identification &&
88
+ public_identifiers == o.public_identifiers
87
89
  end
88
90
 
89
91
  # @see the `==` method
@@ -95,7 +97,7 @@ module StorecoveApi
95
97
  # Calculates hash code according to all attributes.
96
98
  # @return [Fixnum] Hash code
97
99
  def hash
98
- [supplier_id, invoice_recipient].hash
100
+ [supplier_id, widget_identification, public_identifiers].hash
99
101
  end
100
102
 
101
103
  # Builds the object from hash
@@ -6,6 +6,7 @@
6
6
  OpenAPI spec version: 2.0.1
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
9
10
 
10
11
  =end
11
12
 
@@ -17,12 +18,15 @@ module StorecoveApi
17
18
  # The mode in which to run this invoice submission.
18
19
  attr_accessor :mode
19
20
 
20
- # The supplier id, provided by Storecove.
21
+ # DEPRECATED.
21
22
  attr_accessor :supplier_id
22
23
 
23
- # If a supplierId has more than one legal entity to send invoices from, specify the legal entity here. If you have not received one or more legal entities, don't supply this field.
24
+ # DEPRECATED. Use legalEntityId
24
25
  attr_accessor :legal_supplier_id
25
26
 
27
+ # The id of the LegalEntity this invoice should be sent for.
28
+ attr_accessor :legal_entity_id
29
+
26
30
  attr_accessor :invoice_recipient
27
31
 
28
32
  # The invoice in PDF form. The document should be base64 encoded and the enocded string length should not exceed 2MB (2097152 bytes).
@@ -61,6 +65,7 @@ module StorecoveApi
61
65
  :'mode' => :'mode',
62
66
  :'supplier_id' => :'supplierId',
63
67
  :'legal_supplier_id' => :'legalSupplierId',
68
+ :'legal_entity_id' => :'legalEntityId',
64
69
  :'invoice_recipient' => :'invoiceRecipient',
65
70
  :'document' => :'document',
66
71
  :'document_url' => :'documentUrl',
@@ -74,6 +79,7 @@ module StorecoveApi
74
79
  :'mode' => :'String',
75
80
  :'supplier_id' => :'Integer',
76
81
  :'legal_supplier_id' => :'Integer',
82
+ :'legal_entity_id' => :'Integer',
77
83
  :'invoice_recipient' => :'InvoiceRecipient',
78
84
  :'document' => :'String',
79
85
  :'document_url' => :'String',
@@ -101,6 +107,10 @@ module StorecoveApi
101
107
  self.legal_supplier_id = attributes[:'legalSupplierId']
102
108
  end
103
109
 
110
+ if attributes.has_key?(:'legalEntityId')
111
+ self.legal_entity_id = attributes[:'legalEntityId']
112
+ end
113
+
104
114
  if attributes.has_key?(:'invoiceRecipient')
105
115
  self.invoice_recipient = attributes[:'invoiceRecipient']
106
116
  end
@@ -120,17 +130,13 @@ module StorecoveApi
120
130
  end
121
131
 
122
132
  # Show invalid properties with the reasons. Usually used together with valid?
123
- # @return Array for valid properies with the reasons
133
+ # @return Array for valid properties with the reasons
124
134
  def list_invalid_properties
125
135
  invalid_properties = Array.new
126
136
  if @mode.nil?
127
137
  invalid_properties.push("invalid value for 'mode', mode cannot be nil.")
128
138
  end
129
139
 
130
- if @supplier_id.nil?
131
- invalid_properties.push("invalid value for 'supplier_id', supplier_id cannot be nil.")
132
- end
133
-
134
140
  if @invoice_recipient.nil?
135
141
  invalid_properties.push("invalid value for 'invoice_recipient', invoice_recipient cannot be nil.")
136
142
  end
@@ -139,6 +145,10 @@ module StorecoveApi
139
145
  invalid_properties.push("invalid value for 'document', the character length must be great than or equal to 5.")
140
146
  end
141
147
 
148
+ if @invoice.nil?
149
+ invalid_properties.push("invalid value for 'invoice', invoice cannot be nil.")
150
+ end
151
+
142
152
  return invalid_properties
143
153
  end
144
154
 
@@ -148,9 +158,9 @@ module StorecoveApi
148
158
  return false if @mode.nil?
149
159
  mode_validator = EnumAttributeValidator.new('String', ["direct"])
150
160
  return false unless mode_validator.valid?(@mode)
151
- return false if @supplier_id.nil?
152
161
  return false if @invoice_recipient.nil?
153
162
  return false if !@document.nil? && @document.to_s.length < 5
163
+ return false if @invoice.nil?
154
164
  return true
155
165
  end
156
166
 
@@ -183,6 +193,7 @@ module StorecoveApi
183
193
  mode == o.mode &&
184
194
  supplier_id == o.supplier_id &&
185
195
  legal_supplier_id == o.legal_supplier_id &&
196
+ legal_entity_id == o.legal_entity_id &&
186
197
  invoice_recipient == o.invoice_recipient &&
187
198
  document == o.document &&
188
199
  document_url == o.document_url &&
@@ -198,7 +209,7 @@ module StorecoveApi
198
209
  # Calculates hash code according to all attributes.
199
210
  # @return [Fixnum] Hash code
200
211
  def hash
201
- [mode, supplier_id, legal_supplier_id, invoice_recipient, document, document_url, invoice].hash
212
+ [mode, supplier_id, legal_supplier_id, legal_entity_id, invoice_recipient, document, document_url, invoice].hash
202
213
  end
203
214
 
204
215
  # Builds the object from hash
@@ -6,6 +6,7 @@
6
6
  OpenAPI spec version: 2.0.1
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
9
10
 
10
11
  =end
11
12
 
@@ -47,7 +48,7 @@ module StorecoveApi
47
48
  end
48
49
 
49
50
  # Show invalid properties with the reasons. Usually used together with valid?
50
- # @return Array for valid properies with the reasons
51
+ # @return Array for valid properties with the reasons
51
52
  def list_invalid_properties
52
53
  invalid_properties = Array.new
53
54
  return invalid_properties
@@ -6,6 +6,7 @@
6
6
  OpenAPI spec version: 2.0.1
7
7
  Contact: apisupport@storecove.nl
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
9
10
 
10
11
  =end
11
12
 
@@ -14,48 +15,54 @@ require 'date'
14
15
  module StorecoveApi
15
16
 
16
17
  class LegalEntity
17
- attr_accessor :name
18
+ # The name of the company.
19
+ attr_accessor :party_name
18
20
 
21
+ # The first address line.
19
22
  attr_accessor :line1
20
23
 
24
+ # The second address line, if applicable
21
25
  attr_accessor :line2
22
26
 
23
- attr_accessor :zip
24
-
27
+ # The city.
25
28
  attr_accessor :city
26
29
 
30
+ # The zipcode.
31
+ attr_accessor :zip
32
+
33
+ # County, if applicable
27
34
  attr_accessor :county
28
35
 
29
36
  attr_accessor :country
30
37
 
31
- attr_accessor :identifiers
38
+ attr_accessor :peppol_identifiers
32
39
 
33
40
 
34
41
  # Attribute mapping from ruby-style variable name to JSON key.
35
42
  def self.attribute_map
36
43
  {
37
- :'name' => :'name',
44
+ :'party_name' => :'party_name',
38
45
  :'line1' => :'line1',
39
46
  :'line2' => :'line2',
40
- :'zip' => :'zip',
41
47
  :'city' => :'city',
48
+ :'zip' => :'zip',
42
49
  :'county' => :'county',
43
50
  :'country' => :'country',
44
- :'identifiers' => :'identifiers'
51
+ :'peppol_identifiers' => :'peppol_identifiers'
45
52
  }
46
53
  end
47
54
 
48
55
  # Attribute type mapping.
49
56
  def self.swagger_types
50
57
  {
51
- :'name' => :'String',
58
+ :'party_name' => :'String',
52
59
  :'line1' => :'String',
53
60
  :'line2' => :'String',
54
- :'zip' => :'String',
55
61
  :'city' => :'String',
62
+ :'zip' => :'String',
56
63
  :'county' => :'String',
57
- :'country' => :'String',
58
- :'identifiers' => :'Array<LegalEntityIdentifier>'
64
+ :'country' => :'Country',
65
+ :'peppol_identifiers' => :'Array<PeppolIdentifier>'
59
66
  }
60
67
  end
61
68
 
@@ -67,8 +74,8 @@ module StorecoveApi
67
74
  # convert string to symbol for hash key
68
75
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
69
76
 
70
- if attributes.has_key?(:'name')
71
- self.name = attributes[:'name']
77
+ if attributes.has_key?(:'party_name')
78
+ self.party_name = attributes[:'party_name']
72
79
  end
73
80
 
74
81
  if attributes.has_key?(:'line1')
@@ -79,14 +86,14 @@ module StorecoveApi
79
86
  self.line2 = attributes[:'line2']
80
87
  end
81
88
 
82
- if attributes.has_key?(:'zip')
83
- self.zip = attributes[:'zip']
84
- end
85
-
86
89
  if attributes.has_key?(:'city')
87
90
  self.city = attributes[:'city']
88
91
  end
89
92
 
93
+ if attributes.has_key?(:'zip')
94
+ self.zip = attributes[:'zip']
95
+ end
96
+
90
97
  if attributes.has_key?(:'county')
91
98
  self.county = attributes[:'county']
92
99
  end
@@ -95,40 +102,172 @@ module StorecoveApi
95
102
  self.country = attributes[:'country']
96
103
  end
97
104
 
98
- if attributes.has_key?(:'identifiers')
99
- if (value = attributes[:'identifiers']).is_a?(Array)
100
- self.identifiers = value
105
+ if attributes.has_key?(:'peppol_identifiers')
106
+ if (value = attributes[:'peppol_identifiers']).is_a?(Array)
107
+ self.peppol_identifiers = value
101
108
  end
102
109
  end
103
110
 
104
111
  end
105
112
 
106
113
  # Show invalid properties with the reasons. Usually used together with valid?
107
- # @return Array for valid properies with the reasons
114
+ # @return Array for valid properties with the reasons
108
115
  def list_invalid_properties
109
116
  invalid_properties = Array.new
117
+ if !@party_name.nil? && @party_name.to_s.length > 64
118
+ invalid_properties.push("invalid value for 'party_name', the character length must be smaller than or equal to 64.")
119
+ end
120
+
121
+ if !@party_name.nil? && @party_name.to_s.length < 2
122
+ invalid_properties.push("invalid value for 'party_name', the character length must be great than or equal to 2.")
123
+ end
124
+
125
+ if !@line1.nil? && @line1.to_s.length > 64
126
+ invalid_properties.push("invalid value for 'line1', the character length must be smaller than or equal to 64.")
127
+ end
128
+
129
+ if !@line1.nil? && @line1.to_s.length < 2
130
+ invalid_properties.push("invalid value for 'line1', the character length must be great than or equal to 2.")
131
+ end
132
+
133
+ if !@line2.nil? && @line2.to_s.length > 64
134
+ invalid_properties.push("invalid value for 'line2', the character length must be smaller than or equal to 64.")
135
+ end
136
+
137
+ if !@city.nil? && @city.to_s.length > 64
138
+ invalid_properties.push("invalid value for 'city', the character length must be smaller than or equal to 64.")
139
+ end
140
+
141
+ if !@city.nil? && @city.to_s.length < 2
142
+ invalid_properties.push("invalid value for 'city', the character length must be great than or equal to 2.")
143
+ end
144
+
145
+ if !@zip.nil? && @zip.to_s.length > 32
146
+ invalid_properties.push("invalid value for 'zip', the character length must be smaller than or equal to 32.")
147
+ end
148
+
149
+ if !@zip.nil? && @zip.to_s.length < 2
150
+ invalid_properties.push("invalid value for 'zip', the character length must be great than or equal to 2.")
151
+ end
152
+
153
+ if !@county.nil? && @county.to_s.length > 64
154
+ invalid_properties.push("invalid value for 'county', the character length must be smaller than or equal to 64.")
155
+ end
156
+
110
157
  return invalid_properties
111
158
  end
112
159
 
113
160
  # Check to see if the all the properties in the model are valid
114
161
  # @return true if the model is valid
115
162
  def valid?
163
+ return false if !@party_name.nil? && @party_name.to_s.length > 64
164
+ return false if !@party_name.nil? && @party_name.to_s.length < 2
165
+ return false if !@line1.nil? && @line1.to_s.length > 64
166
+ return false if !@line1.nil? && @line1.to_s.length < 2
167
+ return false if !@line2.nil? && @line2.to_s.length > 64
168
+ return false if !@city.nil? && @city.to_s.length > 64
169
+ return false if !@city.nil? && @city.to_s.length < 2
170
+ return false if !@zip.nil? && @zip.to_s.length > 32
171
+ return false if !@zip.nil? && @zip.to_s.length < 2
172
+ return false if !@county.nil? && @county.to_s.length > 64
116
173
  return true
117
174
  end
118
175
 
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] party_name Value to be assigned
178
+ def party_name=(party_name)
179
+
180
+ if !party_name.nil? && party_name.to_s.length > 64
181
+ fail ArgumentError, "invalid value for 'party_name', the character length must be smaller than or equal to 64."
182
+ end
183
+
184
+ if !party_name.nil? && party_name.to_s.length < 2
185
+ fail ArgumentError, "invalid value for 'party_name', the character length must be great than or equal to 2."
186
+ end
187
+
188
+ @party_name = party_name
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] line1 Value to be assigned
193
+ def line1=(line1)
194
+
195
+ if !line1.nil? && line1.to_s.length > 64
196
+ fail ArgumentError, "invalid value for 'line1', the character length must be smaller than or equal to 64."
197
+ end
198
+
199
+ if !line1.nil? && line1.to_s.length < 2
200
+ fail ArgumentError, "invalid value for 'line1', the character length must be great than or equal to 2."
201
+ end
202
+
203
+ @line1 = line1
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] line2 Value to be assigned
208
+ def line2=(line2)
209
+
210
+ if !line2.nil? && line2.to_s.length > 64
211
+ fail ArgumentError, "invalid value for 'line2', the character length must be smaller than or equal to 64."
212
+ end
213
+
214
+ @line2 = line2
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] city Value to be assigned
219
+ def city=(city)
220
+
221
+ if !city.nil? && city.to_s.length > 64
222
+ fail ArgumentError, "invalid value for 'city', the character length must be smaller than or equal to 64."
223
+ end
224
+
225
+ if !city.nil? && city.to_s.length < 2
226
+ fail ArgumentError, "invalid value for 'city', the character length must be great than or equal to 2."
227
+ end
228
+
229
+ @city = city
230
+ end
231
+
232
+ # Custom attribute writer method with validation
233
+ # @param [Object] zip Value to be assigned
234
+ def zip=(zip)
235
+
236
+ if !zip.nil? && zip.to_s.length > 32
237
+ fail ArgumentError, "invalid value for 'zip', the character length must be smaller than or equal to 32."
238
+ end
239
+
240
+ if !zip.nil? && zip.to_s.length < 2
241
+ fail ArgumentError, "invalid value for 'zip', the character length must be great than or equal to 2."
242
+ end
243
+
244
+ @zip = zip
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] county Value to be assigned
249
+ def county=(county)
250
+
251
+ if !county.nil? && county.to_s.length > 64
252
+ fail ArgumentError, "invalid value for 'county', the character length must be smaller than or equal to 64."
253
+ end
254
+
255
+ @county = county
256
+ end
257
+
119
258
  # Checks equality by comparing each attribute.
120
259
  # @param [Object] Object to be compared
121
260
  def ==(o)
122
261
  return true if self.equal?(o)
123
262
  self.class == o.class &&
124
- name == o.name &&
263
+ party_name == o.party_name &&
125
264
  line1 == o.line1 &&
126
265
  line2 == o.line2 &&
127
- zip == o.zip &&
128
266
  city == o.city &&
267
+ zip == o.zip &&
129
268
  county == o.county &&
130
269
  country == o.country &&
131
- identifiers == o.identifiers
270
+ peppol_identifiers == o.peppol_identifiers
132
271
  end
133
272
 
134
273
  # @see the `==` method
@@ -140,7 +279,7 @@ module StorecoveApi
140
279
  # Calculates hash code according to all attributes.
141
280
  # @return [Fixnum] Hash code
142
281
  def hash
143
- [name, line1, line2, zip, city, county, country, identifiers].hash
282
+ [party_name, line1, line2, city, zip, county, country, peppol_identifiers].hash
144
283
  end
145
284
 
146
285
  # Builds the object from hash