Class: FreightFinancialsWebhookIngestionApi::NavixRateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::NavixRateRequest
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb
Overview
NavixRateRequest Model.
Instance Attribute Summary collapse
-
#customer ⇒ NavixRateCustomer
TODO: Write general description for this method.
-
#delivery_date ⇒ DateTime
TODO: Write general description for this method.
-
#external_order_id ⇒ String
TODO: Write general description for this method.
-
#freight_charge_terms ⇒ String
TODO: Write general description for this method.
-
#line_items ⇒ Array[NavixRateLineItem]
TODO: Write general description for this method.
-
#ship_date ⇒ DateTime
TODO: Write general description for this method.
-
#stops ⇒ Array[NavixRateStop]
TODO: Write general description for this method.
-
#uuid ⇒ String
TODO: Write general description for this method.
-
#vendor ⇒ NavixRateVendor
TODO: Write general description for this method.
-
#vendor_charges ⇒ Array[NavixRateRequestedCharge]
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(uuid: SKIP, freight_charge_terms: SKIP, external_order_id: SKIP, ship_date: SKIP, delivery_date: SKIP, customer: SKIP, vendor: SKIP, vendor_charges: SKIP, stops: SKIP, line_items: SKIP) ⇒ NavixRateRequest
constructor
A new instance of NavixRateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_delivery_date ⇒ Object
- #to_custom_ship_date ⇒ 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(uuid: SKIP, freight_charge_terms: SKIP, external_order_id: SKIP, ship_date: SKIP, delivery_date: SKIP, customer: SKIP, vendor: SKIP, vendor_charges: SKIP, stops: SKIP, line_items: SKIP) ⇒ NavixRateRequest
Returns a new instance of NavixRateRequest.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 99 def initialize(uuid: SKIP, freight_charge_terms: SKIP, external_order_id: SKIP, ship_date: SKIP, delivery_date: SKIP, customer: SKIP, vendor: SKIP, vendor_charges: SKIP, stops: SKIP, line_items: SKIP) @uuid = uuid unless uuid == SKIP @freight_charge_terms = freight_charge_terms unless freight_charge_terms == SKIP @external_order_id = external_order_id unless external_order_id == SKIP @ship_date = ship_date unless ship_date == SKIP @delivery_date = delivery_date unless delivery_date == SKIP @customer = customer unless customer == SKIP @vendor = vendor unless vendor == SKIP @vendor_charges = vendor_charges unless vendor_charges == SKIP @stops = stops unless stops == SKIP @line_items = line_items unless line_items == SKIP end |
Instance Attribute Details
#customer ⇒ NavixRateCustomer
TODO: Write general description for this method
35 36 37 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 35 def customer @customer end |
#delivery_date ⇒ DateTime
TODO: Write general description for this method
31 32 33 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 31 def delivery_date @delivery_date end |
#external_order_id ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 23 def external_order_id @external_order_id end |
#freight_charge_terms ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 19 def freight_charge_terms @freight_charge_terms end |
#line_items ⇒ Array[NavixRateLineItem]
TODO: Write general description for this method
51 52 53 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 51 def line_items @line_items end |
#ship_date ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 27 def ship_date @ship_date end |
#stops ⇒ Array[NavixRateStop]
TODO: Write general description for this method
47 48 49 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 47 def stops @stops end |
#uuid ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 15 def uuid @uuid end |
#vendor ⇒ NavixRateVendor
TODO: Write general description for this method
39 40 41 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 39 def vendor @vendor end |
#vendor_charges ⇒ Array[NavixRateRequestedCharge]
TODO: Write general description for this method
43 44 45 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 43 def vendor_charges @vendor_charges end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 116 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. uuid = hash.key?('uuid') ? hash['uuid'] : SKIP freight_charge_terms = hash.key?('freightChargeTerms') ? hash['freightChargeTerms'] : SKIP external_order_id = hash.key?('externalOrderId') ? hash['externalOrderId'] : SKIP ship_date = if hash.key?('shipDate') (DateTimeHelper.from_rfc3339(hash['shipDate']) if hash['shipDate']) else SKIP end delivery_date = if hash.key?('deliveryDate') (DateTimeHelper.from_rfc3339(hash['deliveryDate']) if hash['deliveryDate']) else SKIP end customer = NavixRateCustomer.from_hash(hash['customer']) if hash['customer'] vendor = NavixRateVendor.from_hash(hash['vendor']) if hash['vendor'] # Parameter is an array, so we need to iterate through it vendor_charges = nil unless hash['vendorCharges'].nil? vendor_charges = [] hash['vendorCharges'].each do |structure| vendor_charges << (NavixRateRequestedCharge.from_hash(structure) if structure) end end vendor_charges = SKIP unless hash.key?('vendorCharges') # Parameter is an array, so we need to iterate through it stops = nil unless hash['stops'].nil? stops = [] hash['stops'].each do |structure| stops << (NavixRateStop.from_hash(structure) if structure) end end stops = SKIP unless hash.key?('stops') # Parameter is an array, so we need to iterate through it line_items = nil unless hash['lineItems'].nil? line_items = [] hash['lineItems'].each do |structure| line_items << (NavixRateLineItem.from_hash(structure) if structure) end end line_items = SKIP unless hash.key?('lineItems') # Create object from extracted values. NavixRateRequest.new(uuid: uuid, freight_charge_terms: freight_charge_terms, external_order_id: external_order_id, ship_date: ship_date, delivery_date: delivery_date, customer: customer, vendor: vendor, vendor_charges: vendor_charges, stops: stops, line_items: line_items) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['uuid'] = 'uuid' @_hash['freight_charge_terms'] = 'freightChargeTerms' @_hash['external_order_id'] = 'externalOrderId' @_hash['ship_date'] = 'shipDate' @_hash['delivery_date'] = 'deliveryDate' @_hash['customer'] = 'customer' @_hash['vendor'] = 'vendor' @_hash['vendor_charges'] = 'vendorCharges' @_hash['stops'] = 'stops' @_hash['line_items'] = 'lineItems' @_hash end |
.nullables ⇒ Object
An array for nullable fields
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 86 def self.nullables %w[ freight_charge_terms ship_date delivery_date customer vendor vendor_charges stops line_items ] end |
.optionals ⇒ Object
An array for optional fields
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 70 def self.optionals %w[ uuid freight_charge_terms external_order_id ship_date delivery_date customer vendor vendor_charges stops line_items ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
199 200 201 202 203 204 205 206 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 199 def inspect class_name = self.class.name.split('::').last "<#{class_name} uuid: #{@uuid.inspect}, freight_charge_terms:"\ " #{@freight_charge_terms.inspect}, external_order_id: #{@external_order_id.inspect},"\ " ship_date: #{@ship_date.inspect}, delivery_date: #{@delivery_date.inspect}, customer:"\ " #{@customer.inspect}, vendor: #{@vendor.inspect}, vendor_charges:"\ " #{@vendor_charges.inspect}, stops: #{@stops.inspect}, line_items: #{@line_items.inspect}>" end |
#to_custom_delivery_date ⇒ Object
185 186 187 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 185 def to_custom_delivery_date DateTimeHelper.to_rfc3339(delivery_date) end |
#to_custom_ship_date ⇒ Object
181 182 183 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 181 def to_custom_ship_date DateTimeHelper.to_rfc3339(ship_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
190 191 192 193 194 195 196 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb', line 190 def to_s class_name = self.class.name.split('::').last "<#{class_name} uuid: #{@uuid}, freight_charge_terms: #{@freight_charge_terms},"\ " external_order_id: #{@external_order_id}, ship_date: #{@ship_date}, delivery_date:"\ " #{@delivery_date}, customer: #{@customer}, vendor: #{@vendor}, vendor_charges:"\ " #{@vendor_charges}, stops: #{@stops}, line_items: #{@line_items}>" end |