struct Google::Maps::RouteOptimization::SkippedShipment::Reason

Overview

If we can explain why the shipment was skipped, reasons will be listed here. If the reason is not the same for all vehicles, reason will have more than 1 element. A skipped shipment cannot have duplicate reasons, i.e. where all fields are the same except for exampleVehicleIndex. Example:

SkippedShipment(
  @reasons=[
    Reason(
      @code=DEMAND_EXCEEDS_VEHICLE_CAPACITY
      @example_vehicle_index=1
      @example_exceeded_capacity_type="Apples"
    ),
  ]
)

The skipped shipment is incompatible with all vehicles. The reasons may be different for all vehicles but at least one vehicle's "Apples" capacity would be exceeded (including vehicle 1), at least one vehicle's "Pears" capacity would be exceeded (including vehicle 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1).

Included Modules

Extended Modules

Defined in:

maps.cr

Constructors

Instance Method Summary

Macros inherited from module Google::Resource

define(name, *fields) define, field(var, key = nil, **options, &block) field, field!(var, key = nil, **options, &block) field!, field?(var, key = nil, **options, &block) field?

Constructor Detail

def self.new(pull : JSON::PullParser) #

def self.new(pull : MessagePack::Unpacker) #

Instance Method Detail

def code : Code #

Code identifying the reason type


def example_exceeded_capacity_type : String | Nil #

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded


def example_vehicle_index : Int32 | Nil #

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle