Class: FreightFinancialsWebhookIngestionApi::AssignmentResponseData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::AssignmentResponseData
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb
Overview
AssignmentResponseData Model.
Instance Attribute Summary collapse
-
#assignment_id ⇒ UUID | String
TODO: Write general description for this method.
-
#carrier ⇒ Carrier
TODO: Write general description for this method.
-
#effective_date ⇒ Date
TODO: Write general description for this method.
-
#recorded_at ⇒ DateTime
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(assignment_id: SKIP, carrier: SKIP, effective_date: SKIP, recorded_at: SKIP, status: SKIP, additional_properties: nil) ⇒ AssignmentResponseData
constructor
A new instance of AssignmentResponseData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_recorded_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(assignment_id: SKIP, carrier: SKIP, effective_date: SKIP, recorded_at: SKIP, status: SKIP, additional_properties: nil) ⇒ AssignmentResponseData
Returns a new instance of AssignmentResponseData.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 60 def initialize(assignment_id: SKIP, carrier: SKIP, effective_date: SKIP, recorded_at: SKIP, status: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @assignment_id = assignment_id unless assignment_id == SKIP @carrier = carrier unless carrier == SKIP @effective_date = effective_date unless effective_date == SKIP @recorded_at = recorded_at unless recorded_at == SKIP @status = status unless status == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#assignment_id ⇒ UUID | String
TODO: Write general description for this method
15 16 17 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 15 def assignment_id @assignment_id end |
#carrier ⇒ Carrier
TODO: Write general description for this method
19 20 21 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 19 def carrier @carrier end |
#effective_date ⇒ Date
TODO: Write general description for this method
23 24 25 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 23 def effective_date @effective_date end |
#recorded_at ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 27 def recorded_at @recorded_at end |
#status ⇒ Integer
TODO: Write general description for this method
31 32 33 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 31 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. assignment_id = hash.key?('assignmentId') ? hash['assignmentId'] : SKIP carrier = Carrier.from_hash(hash['carrier']) if hash['carrier'] effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP recorded_at = if hash.key?('recordedAt') (DateTimeHelper.from_rfc3339(hash['recordedAt']) if hash['recordedAt']) else SKIP end status = hash.key?('status') ? hash['status'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AssignmentResponseData.new(assignment_id: assignment_id, carrier: carrier, effective_date: effective_date, recorded_at: recorded_at, status: status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['assignment_id'] = 'assignmentId' @_hash['carrier'] = 'carrier' @_hash['effective_date'] = 'effectiveDate' @_hash['recorded_at'] = 'recordedAt' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 45 def self.optionals %w[ assignment_id carrier effective_date recorded_at status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} assignment_id: #{@assignment_id.inspect}, carrier: #{@carrier.inspect},"\ " effective_date: #{@effective_date.inspect}, recorded_at: #{@recorded_at.inspect}, status:"\ " #{@status.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_recorded_at ⇒ Object
104 105 106 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 104 def to_custom_recorded_at DateTimeHelper.to_rfc3339(recorded_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 114 |
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response_data.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} assignment_id: #{@assignment_id}, carrier: #{@carrier}, effective_date:"\ " #{@effective_date}, recorded_at: #{@recorded_at}, status: #{@status},"\ " additional_properties: #{@additional_properties}>" end |