Class: FreightFinancialsWebhookIngestionApi::AssignmentRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::AssignmentRequest
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb
Overview
AssignmentRequest Model.
Instance Attribute Summary collapse
-
#carrier ⇒ Carrier
TODO: Write general description for this method.
-
#document ⇒ UploadRequest
TODO: Write general description for this method.
-
#effective_date ⇒ Date
TODO: Write general description for this method.
-
#status ⇒ 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(carrier: SKIP, document: SKIP, effective_date: SKIP, status: SKIP) ⇒ AssignmentRequest
constructor
A new instance of AssignmentRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(carrier: SKIP, document: SKIP, effective_date: SKIP, status: SKIP) ⇒ AssignmentRequest
Returns a new instance of AssignmentRequest.
55 56 57 58 59 60 61 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 55 def initialize(carrier: SKIP, document: SKIP, effective_date: SKIP, status: SKIP) @carrier = carrier unless carrier == SKIP @document = document unless document == SKIP @effective_date = effective_date unless effective_date == SKIP @status = status unless status == SKIP end |
Instance Attribute Details
#carrier ⇒ Carrier
TODO: Write general description for this method
14 15 16 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 14 def carrier @carrier end |
#document ⇒ UploadRequest
TODO: Write general description for this method
18 19 20 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 18 def document @document end |
#effective_date ⇒ Date
TODO: Write general description for this method
22 23 24 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 22 def effective_date @effective_date end |
#status ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 26 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. carrier = Carrier.from_hash(hash['carrier']) if hash['carrier'] document = UploadRequest.from_hash(hash['document']) if hash['document'] effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # Create object from extracted values. AssignmentRequest.new(carrier: carrier, document: document, effective_date: effective_date, status: status) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['carrier'] = 'carrier' @_hash['document'] = 'document' @_hash['effective_date'] = 'effectiveDate' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 49 def self.nullables %w[ document ] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 39 def self.optionals %w[ carrier document effective_date status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} carrier: #{@carrier.inspect}, document: #{@document.inspect},"\ " effective_date: #{@effective_date.inspect}, status: #{@status.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} carrier: #{@carrier}, document: #{@document}, effective_date:"\ " #{@effective_date}, status: #{@status}>" end |