Class: FreightFinancialsWebhookIngestionApi::InvoiceIssue
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::InvoiceIssue
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb
Overview
InvoiceIssue Model.
Instance Attribute Summary collapse
-
#code ⇒ String
TODO: Write general description for this method.
-
#created_at ⇒ DateTime
TODO: Write general description for this method.
-
#exception_id ⇒ UUID | String
TODO: Write general description for this method.
-
#field ⇒ String
TODO: Write general description for this method.
-
#message ⇒ String
TODO: Write general description for this method.
-
#severity ⇒ Integer
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(code: SKIP, created_at: SKIP, exception_id: SKIP, field: SKIP, message: SKIP, severity: SKIP) ⇒ InvoiceIssue
constructor
A new instance of InvoiceIssue.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(code: SKIP, created_at: SKIP, exception_id: SKIP, field: SKIP, message: SKIP, severity: SKIP) ⇒ InvoiceIssue
Returns a new instance of InvoiceIssue.
68 69 70 71 72 73 74 75 76 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 68 def initialize(code: SKIP, created_at: SKIP, exception_id: SKIP, field: SKIP, message: SKIP, severity: SKIP) @code = code unless code == SKIP @created_at = created_at unless created_at == SKIP @exception_id = exception_id unless exception_id == SKIP @field = field unless field == SKIP @message = unless == SKIP @severity = severity unless severity == SKIP end |
Instance Attribute Details
#code ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 15 def code @code end |
#created_at ⇒ DateTime
TODO: Write general description for this method
19 20 21 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 19 def created_at @created_at end |
#exception_id ⇒ UUID | String
TODO: Write general description for this method
23 24 25 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 23 def exception_id @exception_id end |
#field ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 27 def field @field end |
#message ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 31 def @message end |
#severity ⇒ Integer
TODO: Write general description for this method
35 36 37 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 35 def severity @severity end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : SKIP created_at = if hash.key?('createdAt') (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt']) else SKIP end exception_id = hash.key?('exceptionId') ? hash['exceptionId'] : SKIP field = hash.key?('field') ? hash['field'] : SKIP = hash.key?('message') ? hash['message'] : SKIP severity = hash.key?('severity') ? hash['severity'] : SKIP # Create object from extracted values. InvoiceIssue.new(code: code, created_at: created_at, exception_id: exception_id, field: field, message: , severity: severity) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['created_at'] = 'createdAt' @_hash['exception_id'] = 'exceptionId' @_hash['field'] = 'field' @_hash['message'] = 'message' @_hash['severity'] = 'severity' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 65 66 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 62 def self.nullables %w[ field ] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 50 def self.optionals %w[ code created_at exception_id field message severity ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
115 116 117 118 119 120 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 115 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, created_at: #{@created_at.inspect}, exception_id:"\ " #{@exception_id.inspect}, field: #{@field.inspect}, message: #{@message.inspect},"\ " severity: #{@severity.inspect}>" end |
#to_custom_created_at ⇒ Object
103 104 105 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 103 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 |
# File 'lib/freight_financials_webhook_ingestion_api/models/invoice_issue.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, created_at: #{@created_at}, exception_id: #{@exception_id},"\ " field: #{@field}, message: #{@message}, severity: #{@severity}>" end |