Class: AmznSpApi::FulfillmentInboundApiModel::PartneredLtlDataOutput
- Inherits:
-
Object
- Object
- AmznSpApi::FulfillmentInboundApiModel::PartneredLtlDataOutput
- Defined in:
- lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb
Overview
Information returned by Amazon about a Less Than Truckload/Full Truckload (LTL/FTL) shipment by an Amazon-partnered carrier.
Instance Attribute Summary collapse
-
#amazon_calculated_value ⇒ Object
Returns the value of attribute amazon_calculated_value.
-
#amazon_reference_id ⇒ Object
A unique identifier created by Amazon that identifies this Amazon-partnered, Less Than Truckload/Full Truckload (LTL/FTL) shipment.
-
#box_count ⇒ Object
Returns the value of attribute box_count.
-
#carrier_name ⇒ Object
The carrier for the inbound shipment.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#freight_ready_date ⇒ Object
Returns the value of attribute freight_ready_date.
-
#is_bill_of_lading_available ⇒ Object
Indicates whether the bill of lading for the shipment is available.
-
#pallet_list ⇒ Object
Returns the value of attribute pallet_list.
-
#partnered_estimate ⇒ Object
Returns the value of attribute partnered_estimate.
-
#preview_delivery_date ⇒ Object
Returns the value of attribute preview_delivery_date.
-
#preview_freight_class ⇒ Object
Returns the value of attribute preview_freight_class.
-
#preview_pickup_date ⇒ Object
Returns the value of attribute preview_pickup_date.
-
#seller_declared_value ⇒ Object
Returns the value of attribute seller_declared_value.
-
#seller_freight_class ⇒ Object
Returns the value of attribute seller_freight_class.
-
#total_weight ⇒ Object
Returns the value of attribute total_weight.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PartneredLtlDataOutput
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PartneredLtlDataOutput
Initializes the object
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 75 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `AmznSpApi::FulfillmentInboundApiModel::PartneredLtlDataOutput` initialize method' unless attributes.is_a?(Hash) # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| raise ArgumentError, "`#{k}` is not a valid attribute in `AmznSpApi::FulfillmentInboundApiModel::PartneredLtlDataOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym) h[k.to_sym] = v end self.contact = attributes[:contact] if attributes.key?(:contact) self.box_count = attributes[:box_count] if attributes.key?(:box_count) self.seller_freight_class = attributes[:seller_freight_class] if attributes.key?(:seller_freight_class) self.freight_ready_date = attributes[:freight_ready_date] if attributes.key?(:freight_ready_date) self.pallet_list = attributes[:pallet_list] if attributes.key?(:pallet_list) self.total_weight = attributes[:total_weight] if attributes.key?(:total_weight) self.seller_declared_value = attributes[:seller_declared_value] if attributes.key?(:seller_declared_value) self.amazon_calculated_value = attributes[:amazon_calculated_value] if attributes.key?(:amazon_calculated_value) self.preview_pickup_date = attributes[:preview_pickup_date] if attributes.key?(:preview_pickup_date) self.preview_delivery_date = attributes[:preview_delivery_date] if attributes.key?(:preview_delivery_date) self.preview_freight_class = attributes[:preview_freight_class] if attributes.key?(:preview_freight_class) self.amazon_reference_id = attributes[:amazon_reference_id] if attributes.key?(:amazon_reference_id) self.is_bill_of_lading_available = attributes[:is_bill_of_lading_available] if attributes.key?(:is_bill_of_lading_available) self.partnered_estimate = attributes[:partnered_estimate] if attributes.key?(:partnered_estimate) return unless attributes.key?(:carrier_name) self.carrier_name = attributes[:carrier_name] end |
Instance Attribute Details
#amazon_calculated_value ⇒ Object
Returns the value of attribute amazon_calculated_value.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def amazon_calculated_value @amazon_calculated_value end |
#amazon_reference_id ⇒ Object
A unique identifier created by Amazon that identifies this Amazon-partnered, Less Than Truckload/Full Truckload (LTL/FTL) shipment.
18 19 20 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 18 def amazon_reference_id @amazon_reference_id end |
#box_count ⇒ Object
Returns the value of attribute box_count.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def box_count @box_count end |
#carrier_name ⇒ Object
The carrier for the inbound shipment.
24 25 26 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 24 def carrier_name @carrier_name end |
#contact ⇒ Object
Returns the value of attribute contact.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def contact @contact end |
#freight_ready_date ⇒ Object
Returns the value of attribute freight_ready_date.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def freight_ready_date @freight_ready_date end |
#is_bill_of_lading_available ⇒ Object
Indicates whether the bill of lading for the shipment is available.
21 22 23 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 21 def is_bill_of_lading_available @is_bill_of_lading_available end |
#pallet_list ⇒ Object
Returns the value of attribute pallet_list.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def pallet_list @pallet_list end |
#partnered_estimate ⇒ Object
Returns the value of attribute partnered_estimate.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def partnered_estimate @partnered_estimate end |
#preview_delivery_date ⇒ Object
Returns the value of attribute preview_delivery_date.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def preview_delivery_date @preview_delivery_date end |
#preview_freight_class ⇒ Object
Returns the value of attribute preview_freight_class.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def preview_freight_class @preview_freight_class end |
#preview_pickup_date ⇒ Object
Returns the value of attribute preview_pickup_date.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def preview_pickup_date @preview_pickup_date end |
#seller_declared_value ⇒ Object
Returns the value of attribute seller_declared_value.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def seller_declared_value @seller_declared_value end |
#seller_freight_class ⇒ Object
Returns the value of attribute seller_freight_class.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def seller_freight_class @seller_freight_class end |
#total_weight ⇒ Object
Returns the value of attribute total_weight.
15 16 17 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 15 def total_weight @total_weight end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 27 def self.attribute_map { 'contact': :Contact, 'box_count': :BoxCount, 'seller_freight_class': :SellerFreightClass, 'freight_ready_date': :FreightReadyDate, 'pallet_list': :PalletList, 'total_weight': :TotalWeight, 'seller_declared_value': :SellerDeclaredValue, 'amazon_calculated_value': :AmazonCalculatedValue, 'preview_pickup_date': :PreviewPickupDate, 'preview_delivery_date': :PreviewDeliveryDate, 'preview_freight_class': :PreviewFreightClass, 'amazon_reference_id': :AmazonReferenceId, 'is_bill_of_lading_available': :IsBillOfLadingAvailable, 'partnered_estimate': :PartneredEstimate, 'carrier_name': :CarrierName } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
203 204 205 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 203 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
69 70 71 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 69 def self.openapi_nullable Set.new([]) end |
.openapi_types ⇒ Object
Attribute type mapping.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 48 def self.openapi_types { 'contact': :Object, 'box_count': :Object, 'seller_freight_class': :Object, 'freight_ready_date': :Object, 'pallet_list': :Object, 'total_weight': :Object, 'seller_declared_value': :Object, 'amazon_calculated_value': :Object, 'preview_pickup_date': :Object, 'preview_delivery_date': :Object, 'preview_freight_class': :Object, 'amazon_reference_id': :Object, 'is_bill_of_lading_available': :Object, 'partnered_estimate': :Object, 'carrier_name': :Object } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 167 def ==(other) return true if equal?(other) self.class == other.class && contact == other.contact && box_count == other.box_count && seller_freight_class == other.seller_freight_class && freight_ready_date == other.freight_ready_date && pallet_list == other.pallet_list && total_weight == other.total_weight && seller_declared_value == other.seller_declared_value && amazon_calculated_value == other.amazon_calculated_value && preview_pickup_date == other.preview_pickup_date && preview_delivery_date == other.preview_delivery_date && preview_freight_class == other.preview_freight_class && amazon_reference_id == other.amazon_reference_id && is_bill_of_lading_available == other.is_bill_of_lading_available && partnered_estimate == other.partnered_estimate && carrier_name == other.carrier_name end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 232 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model AmznSpApi::FulfillmentInboundApiModel.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 301 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 210 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array) elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) send("#{key}=", nil) end end self end |
#eql?(other) ⇒ Boolean
190 191 192 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 190 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
196 197 198 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 196 def hash [contact, box_count, seller_freight_class, freight_ready_date, pallet_list, total_weight, seller_declared_value, amazon_calculated_value, preview_pickup_date, preview_delivery_date, preview_freight_class, amazon_reference_id, is_bill_of_lading_available, partnered_estimate, carrier_name].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 120 def list_invalid_properties invalid_properties = [] invalid_properties.push('invalid value for "contact", contact cannot be nil.') if @contact.nil? invalid_properties.push('invalid value for "box_count", box_count cannot be nil.') if @box_count.nil? invalid_properties.push('invalid value for "freight_ready_date", freight_ready_date cannot be nil.') if @freight_ready_date.nil? invalid_properties.push('invalid value for "pallet_list", pallet_list cannot be nil.') if @pallet_list.nil? invalid_properties.push('invalid value for "total_weight", total_weight cannot be nil.') if @total_weight.nil? invalid_properties.push('invalid value for "preview_pickup_date", preview_pickup_date cannot be nil.') if @preview_pickup_date.nil? invalid_properties.push('invalid value for "preview_delivery_date", preview_delivery_date cannot be nil.') if @preview_delivery_date.nil? invalid_properties.push('invalid value for "preview_freight_class", preview_freight_class cannot be nil.') if @preview_freight_class.nil? invalid_properties.push('invalid value for "amazon_reference_id", amazon_reference_id cannot be nil.') if @amazon_reference_id.nil? invalid_properties.push('invalid value for "is_bill_of_lading_available", is_bill_of_lading_available cannot be nil.') if @is_bill_of_lading_available.nil? invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') if @carrier_name.nil? invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
277 278 279 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 277 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 283 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
271 272 273 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 271 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/fulfillment_inbound_api_model/models/partnered_ltl_data_output.rb', line 149 def valid? return false if @contact.nil? return false if @box_count.nil? return false if @freight_ready_date.nil? return false if @pallet_list.nil? return false if @total_weight.nil? return false if @preview_pickup_date.nil? return false if @preview_delivery_date.nil? return false if @preview_freight_class.nil? return false if @amazon_reference_id.nil? return false if @is_bill_of_lading_available.nil? return false if @carrier_name.nil? true end |