Class: ComplyanceSDK::PurchaseInvoice::PurchaseInvoiceResult
- Inherits:
-
Object
- Object
- ComplyanceSDK::PurchaseInvoice::PurchaseInvoiceResult
- Defined in:
- lib/complyance_sdk/purchase_invoice/models.rb
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#compliance ⇒ Object
readonly
Returns the value of attribute compliance.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#document_id ⇒ Object
readonly
Returns the value of attribute document_id.
-
#document_number ⇒ Object
readonly
Returns the value of attribute document_number.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#government ⇒ Object
readonly
Returns the value of attribute government.
-
#invoice ⇒ Object
readonly
Returns the value of attribute invoice.
-
#is_terminal ⇒ Object
readonly
Returns the value of attribute is_terminal.
-
#last_updated_at ⇒ Object
readonly
Returns the value of attribute last_updated_at.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#validation_results ⇒ Object
readonly
Returns the value of attribute validation_results.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
-
#xml_response ⇒ Object
readonly
Returns the value of attribute xml_response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(document_id:, client_id:, country:, environment:, document_number:, state:, is_terminal:, last_updated_at:, invoice:, xml:, xml_response:, artifacts:, government:, compliance:, errors:, validation_results:) ⇒ PurchaseInvoiceResult
constructor
A new instance of PurchaseInvoiceResult.
Constructor Details
#initialize(document_id:, client_id:, country:, environment:, document_number:, state:, is_terminal:, last_updated_at:, invoice:, xml:, xml_response:, artifacts:, government:, compliance:, errors:, validation_results:) ⇒ PurchaseInvoiceResult
Returns a new instance of PurchaseInvoiceResult.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 169 def initialize(document_id:, client_id:, country:, environment:, document_number:, state:, is_terminal:, last_updated_at:, invoice:, xml:, xml_response:, artifacts:, government:, compliance:, errors:, validation_results:) @document_id = document_id @client_id = client_id @country = country @environment = environment @document_number = document_number @state = state @is_terminal = is_terminal @last_updated_at = last_updated_at @invoice = invoice @xml = xml @xml_response = xml_response @artifacts = artifacts @government = government @compliance = compliance @errors = errors || [] @validation_results = validation_results end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def artifacts @artifacts end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def client_id @client_id end |
#compliance ⇒ Object (readonly)
Returns the value of attribute compliance.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def compliance @compliance end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def country @country end |
#document_id ⇒ Object (readonly)
Returns the value of attribute document_id.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def document_id @document_id end |
#document_number ⇒ Object (readonly)
Returns the value of attribute document_number.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def document_number @document_number end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def environment @environment end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def errors @errors end |
#government ⇒ Object (readonly)
Returns the value of attribute government.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def government @government end |
#invoice ⇒ Object (readonly)
Returns the value of attribute invoice.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def invoice @invoice end |
#is_terminal ⇒ Object (readonly)
Returns the value of attribute is_terminal.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def is_terminal @is_terminal end |
#last_updated_at ⇒ Object (readonly)
Returns the value of attribute last_updated_at.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def last_updated_at @last_updated_at end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def state @state end |
#validation_results ⇒ Object (readonly)
Returns the value of attribute validation_results.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def validation_results @validation_results end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def xml @xml end |
#xml_response ⇒ Object (readonly)
Returns the value of attribute xml_response.
152 153 154 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 152 def xml_response @xml_response end |
Class Method Details
.from_h(data) ⇒ Object
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 190 def self.from_h(data) return nil unless data.is_a?(Hash) errors = Array(ModelHelpers.value_for(data, :errors)).filter_map do |entry| PurchaseInvoiceValidationErrorEntry.from_h(entry) end new( document_id: ModelHelpers.value_for(data, :documentId), client_id: ModelHelpers.value_for(data, :clientId), country: ModelHelpers.value_for(data, :country), environment: ModelHelpers.value_for(data, :environment), document_number: ModelHelpers.value_for(data, :documentNumber), state: ModelHelpers.value_for(data, :state), is_terminal: ModelHelpers.value_for(data, :isTerminal), last_updated_at: ModelHelpers.value_for(data, :lastUpdatedAt), invoice: ModelHelpers.value_for(data, :invoice), xml: ModelHelpers.value_for(data, :xml), xml_response: ModelHelpers.value_for(data, :xmlResponse), artifacts: PurchaseInvoiceArtifacts.from_h(ModelHelpers.value_for(data, :artifacts)), government: PurchaseInvoiceGovernmentStatus.from_h(ModelHelpers.value_for(data, :government)), compliance: PurchaseInvoiceCompliance.from_h(ModelHelpers.value_for(data, :compliance)), errors: errors, validation_results: PurchaseInvoiceValidationResults.from_h(ModelHelpers.value_for(data, :validationResults)) ) end |