factpulse 3.0.37 → 4.0.0
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 +4 -4
- data/CHANGELOG.md +10 -13
- data/Gemfile.lock +1 -1
- data/README.md +136 -138
- data/docs/ChorusProCredentials.md +8 -8
- data/docs/ChorusProDestination.md +1 -1
- data/docs/FactureElectroniqueModelsInvoiceTypeCode.md +15 -0
- data/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +24 -0
- data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +26 -0
- data/docs/GetChorusProIdRequest.md +1 -1
- data/docs/GetInvoiceRequest.md +1 -1
- data/docs/GetStructureRequest.md +1 -1
- data/docs/InvoiceInput.md +1 -1
- data/docs/Recipient.md +1 -1
- data/docs/SearchStructureRequest.md +1 -1
- data/docs/SimplifiedInvoiceData.md +1 -1
- data/docs/SubmitCompleteInvoiceResponse.md +2 -2
- data/docs/SubmitInvoiceRequest.md +1 -1
- data/docs/Supplier.md +1 -1
- data/docs/ValidateCDARResponse.md +2 -2
- data/docs/ValidationErrorResponse.md +2 -8
- data/lib/factpulse/helpers/client.rb +152 -770
- data/lib/factpulse/helpers/exceptions.rb +38 -14
- data/lib/factpulse/helpers/helpers.rb +8 -7
- data/lib/factpulse/models/chorus_pro_credentials.rb +94 -26
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb → facture_electronique_models_invoice_type_code.rb} +20 -9
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_validation_validation_error_response.rb → facture_electronique_rest_api_schemas_cdar_validation_error_response.rb} +70 -23
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb} +29 -97
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +1 -1
- data/lib/factpulse/models/get_invoice_request.rb +1 -1
- data/lib/factpulse/models/get_structure_request.rb +1 -1
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +6 -17
- data/lib/factpulse/models/recipient.rb +0 -2
- data/lib/factpulse/models/scheme_id.rb +3 -3
- data/lib/factpulse/models/search_structure_request.rb +1 -1
- data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_response.rb +16 -16
- data/lib/factpulse/models/submit_invoice_request.rb +1 -1
- data/lib/factpulse/models/supplier.rb +0 -2
- data/lib/factpulse/models/validate_cdar_response.rb +2 -2
- data/lib/factpulse/models/validation_error_response.rb +20 -67
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +3 -3
- metadata +8 -8
- data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +0 -26
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +0 -15
- data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +0 -18
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module FactPulse
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
# Additional error types (base Error class is in client.rb)
|
|
5
|
+
class AuthError < Error; end
|
|
6
|
+
|
|
7
|
+
class PollingTimeout < Error
|
|
8
|
+
attr_reader :task_id, :timeout
|
|
9
|
+
|
|
10
|
+
def initialize(task_id, timeout)
|
|
11
|
+
@task_id = task_id
|
|
12
|
+
@timeout = timeout
|
|
13
|
+
super("Timeout (#{timeout}ms) for #{task_id}")
|
|
9
14
|
end
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class ValidationErrorDetail
|
|
18
|
+
attr_accessor :level, :item, :reason, :source, :code
|
|
19
|
+
|
|
20
|
+
def initialize(level: '', item: '', reason: '', source: nil, code: nil)
|
|
21
|
+
@level = level
|
|
22
|
+
@item = item
|
|
23
|
+
@reason = reason
|
|
24
|
+
@source = source
|
|
25
|
+
@code = code
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def to_s
|
|
29
|
+
"[#{@item.to_s.empty? ? 'unknown' : @item}] #{@reason.to_s.empty? ? 'Unknown error' : @reason}"
|
|
15
30
|
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
|
|
32
|
+
def self.from_hash(h)
|
|
33
|
+
new(level: h['level'] || '', item: h['item'] || '', reason: h['reason'] || '', source: h['source'], code: h['code'])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ValidationError < Error
|
|
38
|
+
attr_reader :errors
|
|
39
|
+
|
|
40
|
+
def initialize(msg, errors = [])
|
|
41
|
+
@errors = errors
|
|
42
|
+
super(errors.empty? ? msg : "#{msg}\n\nDetails:\n#{errors.map { |e| " - #{e}" }.join("\n")}")
|
|
19
43
|
end
|
|
20
44
|
end
|
|
21
45
|
end
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
# Load client first (defines FactPulse::Error base class)
|
|
3
4
|
require_relative 'client'
|
|
5
|
+
# Then load additional exception types
|
|
6
|
+
require_relative 'exceptions'
|
|
7
|
+
|
|
4
8
|
module FactPulse
|
|
5
9
|
module Helpers
|
|
6
|
-
def self.create_client(**opts)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def self.invoice_totals(*args, **kwargs); AmountHelpers.invoice_totals(*args, **kwargs); end
|
|
10
|
-
def self.invoice_line(*args, **kwargs); AmountHelpers.invoice_line(*args, **kwargs); end
|
|
11
|
-
def self.vat_line(*args, **kwargs); AmountHelpers.vat_line(*args, **kwargs); end
|
|
10
|
+
def self.create_client(**opts)
|
|
11
|
+
FactPulse::Client.new(**opts)
|
|
12
|
+
end
|
|
12
13
|
end
|
|
13
14
|
end
|
|
@@ -14,27 +14,31 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
#
|
|
17
|
+
# Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don't want to store their credentials
|
|
18
18
|
class ChorusProCredentials < ApiModelBase
|
|
19
|
+
# PISTE Client ID (government API portal)
|
|
19
20
|
attr_accessor :piste_client_id
|
|
20
21
|
|
|
22
|
+
# PISTE Client Secret
|
|
21
23
|
attr_accessor :piste_client_secret
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
# Chorus Pro login
|
|
26
|
+
attr_accessor :chorus_pro_login
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
# Chorus Pro password
|
|
29
|
+
attr_accessor :chorus_pro_password
|
|
26
30
|
|
|
27
|
-
#
|
|
28
|
-
attr_accessor :
|
|
31
|
+
# Use sandbox environment (true) or production (false)
|
|
32
|
+
attr_accessor :sandbox
|
|
29
33
|
|
|
30
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
35
|
def self.attribute_map
|
|
32
36
|
{
|
|
33
37
|
:'piste_client_id' => :'pisteClientId',
|
|
34
38
|
:'piste_client_secret' => :'pisteClientSecret',
|
|
35
|
-
:'
|
|
36
|
-
:'
|
|
37
|
-
:'
|
|
39
|
+
:'chorus_pro_login' => :'chorusProLogin',
|
|
40
|
+
:'chorus_pro_password' => :'chorusProPassword',
|
|
41
|
+
:'sandbox' => :'sandbox'
|
|
38
42
|
}
|
|
39
43
|
end
|
|
40
44
|
|
|
@@ -53,19 +57,15 @@ module FactPulse
|
|
|
53
57
|
{
|
|
54
58
|
:'piste_client_id' => :'String',
|
|
55
59
|
:'piste_client_secret' => :'String',
|
|
56
|
-
:'
|
|
57
|
-
:'
|
|
58
|
-
:'
|
|
60
|
+
:'chorus_pro_login' => :'String',
|
|
61
|
+
:'chorus_pro_password' => :'String',
|
|
62
|
+
:'sandbox' => :'Boolean'
|
|
59
63
|
}
|
|
60
64
|
end
|
|
61
65
|
|
|
62
66
|
# List of attributes with nullable: true
|
|
63
67
|
def self.openapi_nullable
|
|
64
68
|
Set.new([
|
|
65
|
-
:'piste_client_id',
|
|
66
|
-
:'piste_client_secret',
|
|
67
|
-
:'chorus_login',
|
|
68
|
-
:'chorus_password',
|
|
69
69
|
])
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -87,24 +87,32 @@ module FactPulse
|
|
|
87
87
|
|
|
88
88
|
if attributes.key?(:'piste_client_id')
|
|
89
89
|
self.piste_client_id = attributes[:'piste_client_id']
|
|
90
|
+
else
|
|
91
|
+
self.piste_client_id = nil
|
|
90
92
|
end
|
|
91
93
|
|
|
92
94
|
if attributes.key?(:'piste_client_secret')
|
|
93
95
|
self.piste_client_secret = attributes[:'piste_client_secret']
|
|
96
|
+
else
|
|
97
|
+
self.piste_client_secret = nil
|
|
94
98
|
end
|
|
95
99
|
|
|
96
|
-
if attributes.key?(:'
|
|
97
|
-
self.
|
|
100
|
+
if attributes.key?(:'chorus_pro_login')
|
|
101
|
+
self.chorus_pro_login = attributes[:'chorus_pro_login']
|
|
102
|
+
else
|
|
103
|
+
self.chorus_pro_login = nil
|
|
98
104
|
end
|
|
99
105
|
|
|
100
|
-
if attributes.key?(:'
|
|
101
|
-
self.
|
|
106
|
+
if attributes.key?(:'chorus_pro_password')
|
|
107
|
+
self.chorus_pro_password = attributes[:'chorus_pro_password']
|
|
108
|
+
else
|
|
109
|
+
self.chorus_pro_password = nil
|
|
102
110
|
end
|
|
103
111
|
|
|
104
|
-
if attributes.key?(:'
|
|
105
|
-
self.
|
|
112
|
+
if attributes.key?(:'sandbox')
|
|
113
|
+
self.sandbox = attributes[:'sandbox']
|
|
106
114
|
else
|
|
107
|
-
self.
|
|
115
|
+
self.sandbox = true
|
|
108
116
|
end
|
|
109
117
|
end
|
|
110
118
|
|
|
@@ -113,6 +121,22 @@ module FactPulse
|
|
|
113
121
|
def list_invalid_properties
|
|
114
122
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
115
123
|
invalid_properties = Array.new
|
|
124
|
+
if @piste_client_id.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "piste_client_id", piste_client_id cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @piste_client_secret.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "piste_client_secret", piste_client_secret cannot be nil.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if @chorus_pro_login.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "chorus_pro_login", chorus_pro_login cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @chorus_pro_password.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "chorus_pro_password", chorus_pro_password cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
116
140
|
invalid_properties
|
|
117
141
|
end
|
|
118
142
|
|
|
@@ -120,9 +144,53 @@ module FactPulse
|
|
|
120
144
|
# @return true if the model is valid
|
|
121
145
|
def valid?
|
|
122
146
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
147
|
+
return false if @piste_client_id.nil?
|
|
148
|
+
return false if @piste_client_secret.nil?
|
|
149
|
+
return false if @chorus_pro_login.nil?
|
|
150
|
+
return false if @chorus_pro_password.nil?
|
|
123
151
|
true
|
|
124
152
|
end
|
|
125
153
|
|
|
154
|
+
# Custom attribute writer method with validation
|
|
155
|
+
# @param [Object] piste_client_id Value to be assigned
|
|
156
|
+
def piste_client_id=(piste_client_id)
|
|
157
|
+
if piste_client_id.nil?
|
|
158
|
+
fail ArgumentError, 'piste_client_id cannot be nil'
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
@piste_client_id = piste_client_id
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Custom attribute writer method with validation
|
|
165
|
+
# @param [Object] piste_client_secret Value to be assigned
|
|
166
|
+
def piste_client_secret=(piste_client_secret)
|
|
167
|
+
if piste_client_secret.nil?
|
|
168
|
+
fail ArgumentError, 'piste_client_secret cannot be nil'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
@piste_client_secret = piste_client_secret
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Custom attribute writer method with validation
|
|
175
|
+
# @param [Object] chorus_pro_login Value to be assigned
|
|
176
|
+
def chorus_pro_login=(chorus_pro_login)
|
|
177
|
+
if chorus_pro_login.nil?
|
|
178
|
+
fail ArgumentError, 'chorus_pro_login cannot be nil'
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
@chorus_pro_login = chorus_pro_login
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] chorus_pro_password Value to be assigned
|
|
186
|
+
def chorus_pro_password=(chorus_pro_password)
|
|
187
|
+
if chorus_pro_password.nil?
|
|
188
|
+
fail ArgumentError, 'chorus_pro_password cannot be nil'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@chorus_pro_password = chorus_pro_password
|
|
192
|
+
end
|
|
193
|
+
|
|
126
194
|
# Checks equality by comparing each attribute.
|
|
127
195
|
# @param [Object] Object to be compared
|
|
128
196
|
def ==(o)
|
|
@@ -130,9 +198,9 @@ module FactPulse
|
|
|
130
198
|
self.class == o.class &&
|
|
131
199
|
piste_client_id == o.piste_client_id &&
|
|
132
200
|
piste_client_secret == o.piste_client_secret &&
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
201
|
+
chorus_pro_login == o.chorus_pro_login &&
|
|
202
|
+
chorus_pro_password == o.chorus_pro_password &&
|
|
203
|
+
sandbox == o.sandbox
|
|
136
204
|
end
|
|
137
205
|
|
|
138
206
|
# @see the `==` method
|
|
@@ -144,7 +212,7 @@ module FactPulse
|
|
|
144
212
|
# Calculates hash code according to all attributes.
|
|
145
213
|
# @return [Integer] Hash code
|
|
146
214
|
def hash
|
|
147
|
-
[piste_client_id, piste_client_secret,
|
|
215
|
+
[piste_client_id, piste_client_secret, chorus_pro_login, chorus_pro_password, sandbox].hash
|
|
148
216
|
end
|
|
149
217
|
|
|
150
218
|
# Builds the object from hash
|
|
@@ -14,15 +14,26 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
class FactureElectroniqueModelsInvoiceTypeCode
|
|
18
|
+
INVOICE = "380".freeze
|
|
19
|
+
SELF_BILLED_INVOICE = "389".freeze
|
|
20
|
+
FACTORED_INVOICE = "393".freeze
|
|
21
|
+
SELF_BILLED_FACTORED_INVOICE = "501".freeze
|
|
22
|
+
PREPAYMENT_INVOICE = "386".freeze
|
|
23
|
+
SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
|
|
24
|
+
CORRECTIVE_INVOICE = "384".freeze
|
|
25
|
+
SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
|
|
26
|
+
FACTORED_CORRECTIVE_INVOICE = "472".freeze
|
|
27
|
+
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
|
|
28
|
+
CREDIT_NOTE = "381".freeze
|
|
29
|
+
SELF_BILLED_CREDIT_NOTE = "261".freeze
|
|
30
|
+
GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
|
|
31
|
+
FACTORED_CREDIT_NOTE = "396".freeze
|
|
32
|
+
SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
|
|
33
|
+
PREPAYMENT_CREDIT_NOTE = "503".freeze
|
|
23
34
|
|
|
24
35
|
def self.all_vars
|
|
25
|
-
@all_vars ||= [
|
|
36
|
+
@all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
|
|
26
37
|
end
|
|
27
38
|
|
|
28
39
|
# Builds the enum from string
|
|
@@ -36,8 +47,8 @@ module FactPulse
|
|
|
36
47
|
# @param [String] The enum value in the form of the string
|
|
37
48
|
# @return [String] The enum value
|
|
38
49
|
def build_from_hash(value)
|
|
39
|
-
return value if
|
|
40
|
-
raise "Invalid ENUM value #{value} for class #
|
|
50
|
+
return value if FactureElectroniqueModelsInvoiceTypeCode.all_vars.include?(value)
|
|
51
|
+
raise "Invalid ENUM value #{value} for class #FactureElectroniqueModelsInvoiceTypeCode"
|
|
41
52
|
end
|
|
42
53
|
end
|
|
43
54
|
end
|
|
@@ -14,15 +14,26 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
#
|
|
20
|
-
attr_accessor :
|
|
17
|
+
# Erreur de validation.
|
|
18
|
+
class FactureElectroniqueRestApiSchemasCdarValidationErrorResponse < ApiModelBase
|
|
19
|
+
# Champ concerné
|
|
20
|
+
attr_accessor :field
|
|
21
|
+
|
|
22
|
+
# Message d'erreur
|
|
23
|
+
attr_accessor :message
|
|
24
|
+
|
|
25
|
+
attr_accessor :rule
|
|
26
|
+
|
|
27
|
+
# Sévérité (error/warning)
|
|
28
|
+
attr_accessor :severity
|
|
21
29
|
|
|
22
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
31
|
def self.attribute_map
|
|
24
32
|
{
|
|
25
|
-
:'
|
|
33
|
+
:'field' => :'field',
|
|
34
|
+
:'message' => :'message',
|
|
35
|
+
:'rule' => :'rule',
|
|
36
|
+
:'severity' => :'severity'
|
|
26
37
|
}
|
|
27
38
|
end
|
|
28
39
|
|
|
@@ -39,13 +50,17 @@ module FactPulse
|
|
|
39
50
|
# Attribute type mapping.
|
|
40
51
|
def self.openapi_types
|
|
41
52
|
{
|
|
42
|
-
:'
|
|
53
|
+
:'field' => :'String',
|
|
54
|
+
:'message' => :'String',
|
|
55
|
+
:'rule' => :'String',
|
|
56
|
+
:'severity' => :'String'
|
|
43
57
|
}
|
|
44
58
|
end
|
|
45
59
|
|
|
46
60
|
# List of attributes with nullable: true
|
|
47
61
|
def self.openapi_nullable
|
|
48
62
|
Set.new([
|
|
63
|
+
:'rule',
|
|
49
64
|
])
|
|
50
65
|
end
|
|
51
66
|
|
|
@@ -53,24 +68,38 @@ module FactPulse
|
|
|
53
68
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
69
|
def initialize(attributes = {})
|
|
55
70
|
if (!attributes.is_a?(Hash))
|
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse` initialize method"
|
|
57
72
|
end
|
|
58
73
|
|
|
59
74
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
75
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
76
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
77
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
79
|
end
|
|
65
80
|
h[k.to_sym] = v
|
|
66
81
|
}
|
|
67
82
|
|
|
68
|
-
if attributes.key?(:'
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
if attributes.key?(:'field')
|
|
84
|
+
self.field = attributes[:'field']
|
|
85
|
+
else
|
|
86
|
+
self.field = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'message')
|
|
90
|
+
self.message = attributes[:'message']
|
|
72
91
|
else
|
|
73
|
-
self.
|
|
92
|
+
self.message = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'rule')
|
|
96
|
+
self.rule = attributes[:'rule']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'severity')
|
|
100
|
+
self.severity = attributes[:'severity']
|
|
101
|
+
else
|
|
102
|
+
self.severity = 'error'
|
|
74
103
|
end
|
|
75
104
|
end
|
|
76
105
|
|
|
@@ -79,8 +108,12 @@ module FactPulse
|
|
|
79
108
|
def list_invalid_properties
|
|
80
109
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
81
110
|
invalid_properties = Array.new
|
|
82
|
-
if @
|
|
83
|
-
invalid_properties.push('invalid value for "
|
|
111
|
+
if @field.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "field", field cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @message.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
84
117
|
end
|
|
85
118
|
|
|
86
119
|
invalid_properties
|
|
@@ -90,18 +123,29 @@ module FactPulse
|
|
|
90
123
|
# @return true if the model is valid
|
|
91
124
|
def valid?
|
|
92
125
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
-
return false if @
|
|
126
|
+
return false if @field.nil?
|
|
127
|
+
return false if @message.nil?
|
|
94
128
|
true
|
|
95
129
|
end
|
|
96
130
|
|
|
97
131
|
# Custom attribute writer method with validation
|
|
98
|
-
# @param [Object]
|
|
99
|
-
def
|
|
100
|
-
if
|
|
101
|
-
fail ArgumentError, '
|
|
132
|
+
# @param [Object] field Value to be assigned
|
|
133
|
+
def field=(field)
|
|
134
|
+
if field.nil?
|
|
135
|
+
fail ArgumentError, 'field cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@field = field
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] message Value to be assigned
|
|
143
|
+
def message=(message)
|
|
144
|
+
if message.nil?
|
|
145
|
+
fail ArgumentError, 'message cannot be nil'
|
|
102
146
|
end
|
|
103
147
|
|
|
104
|
-
@
|
|
148
|
+
@message = message
|
|
105
149
|
end
|
|
106
150
|
|
|
107
151
|
# Checks equality by comparing each attribute.
|
|
@@ -109,7 +153,10 @@ module FactPulse
|
|
|
109
153
|
def ==(o)
|
|
110
154
|
return true if self.equal?(o)
|
|
111
155
|
self.class == o.class &&
|
|
112
|
-
|
|
156
|
+
field == o.field &&
|
|
157
|
+
message == o.message &&
|
|
158
|
+
rule == o.rule &&
|
|
159
|
+
severity == o.severity
|
|
113
160
|
end
|
|
114
161
|
|
|
115
162
|
# @see the `==` method
|
|
@@ -121,7 +168,7 @@ module FactPulse
|
|
|
121
168
|
# Calculates hash code according to all attributes.
|
|
122
169
|
# @return [Integer] Hash code
|
|
123
170
|
def hash
|
|
124
|
-
[
|
|
171
|
+
[field, message, rule, severity].hash
|
|
125
172
|
end
|
|
126
173
|
|
|
127
174
|
# Builds the object from hash
|