Reference documentation and code samples for the Google Cloud Optimization V1 Client class Reason.
If we can explain why the shipment was skipped, reasons will be listed
here. If the reason is not the same for all vehicles,reasonwill have
more than 1 element. A skipped shipment cannot have duplicate reasons,
i.e. where all fields are the same except forexample_vehicle_index.
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).
Generated from protobuf messagegoogle.cloud.optimization.v1.SkippedShipment.Reason
Namespace
Google \ Cloud \ Optimization \ V1 \ SkippedShipment
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ code
int
Refer to the comments of Code.
↳ example_vehicle_index
int
If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.
↳ example_exceeded_capacity_type
string
If the reason code isDEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.
getCode
Refer to the comments of Code.
Returns
Type
Description
int
setCode
Refer to the comments of Code.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getExampleVehicleIndex
If the reason is related to a shipment-vehicle incompatibility, this
field provides the index of one relevant vehicle.
Returns
Type
Description
int
hasExampleVehicleIndex
clearExampleVehicleIndex
setExampleVehicleIndex
If the reason is related to a shipment-vehicle incompatibility, this
field provides the index of one relevant vehicle.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getExampleExceededCapacityType
If the reason code isDEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one
capacity type that is exceeded.
Returns
Type
Description
string
setExampleExceededCapacityType
If the reason code isDEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one
capacity type that is exceeded.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Optimization V1 Client - Class Reason (1.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.5 (latest)](/php/docs/reference/cloud-optimization/latest/V1.SkippedShipment.Reason)\n- [1.0.4](/php/docs/reference/cloud-optimization/1.0.4/V1.SkippedShipment.Reason)\n- [0.7.0](/php/docs/reference/cloud-optimization/0.7.0/V1.SkippedShipment.Reason)\n- [0.6.5](/php/docs/reference/cloud-optimization/0.6.5/V1.SkippedShipment.Reason)\n- [0.5.1](/php/docs/reference/cloud-optimization/0.5.1/V1.SkippedShipment.Reason)\n- [0.4.0](/php/docs/reference/cloud-optimization/0.4.0/V1.SkippedShipment.Reason)\n- [0.3.4](/php/docs/reference/cloud-optimization/0.3.4/V1.SkippedShipment.Reason)\n- [0.2.0](/php/docs/reference/cloud-optimization/0.2.0/V1.SkippedShipment.Reason)\n- [0.1.9](/php/docs/reference/cloud-optimization/0.1.9/V1.SkippedShipment.Reason) \nReference documentation and code samples for the Google Cloud Optimization V1 Client class Reason.\n\nIf we can explain why the shipment was skipped, reasons will be listed\nhere. If the reason is not the same for all vehicles, `reason` will have\nmore than 1 element. A skipped shipment cannot have duplicate reasons,\ni.e. where all fields are the same except for `example_vehicle_index`.\n\nExample: \n\n reasons {\n code: DEMAND_EXCEEDS_VEHICLE_CAPACITY\n example_vehicle_index: 1\n example_exceeded_capacity_type: \"Apples\"\n }\n reasons {\n code: DEMAND_EXCEEDS_VEHICLE_CAPACITY\n example_vehicle_index: 3\n example_exceeded_capacity_type: \"Pears\"\n }\n reasons {\n code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT\n example_vehicle_index: 1\n }\n\nThe skipped shipment is incompatible with all vehicles. The reasons may\nbe different for all vehicles but at least one vehicle's \"Apples\"\ncapacity would be exceeded (including vehicle 1), at least one vehicle's\n\"Pears\" capacity would be exceeded (including vehicle 3) and at least one\nvehicle's distance limit would be exceeded (including vehicle 1).\n\nGenerated from protobuf message `google.cloud.optimization.v1.SkippedShipment.Reason`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Optimization \\\\ V1 \\\\ SkippedShipment\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCode\n\nRefer to the comments of Code.\n\n### setCode\n\nRefer to the comments of Code.\n\n### getExampleVehicleIndex\n\nIf the reason is related to a shipment-vehicle incompatibility, this\nfield provides the index of one relevant vehicle.\n\n### hasExampleVehicleIndex\n\n### clearExampleVehicleIndex\n\n### setExampleVehicleIndex\n\nIf the reason is related to a shipment-vehicle incompatibility, this\nfield provides the index of one relevant vehicle.\n\n### getExampleExceededCapacityType\n\nIf the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one\ncapacity type that is exceeded.\n\n### setExampleExceededCapacityType\n\nIf the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one\ncapacity type that is exceeded."]]