Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::SkippedShipment::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, reason will have
more than 1 element. A skipped shipment cannot have duplicate reasons,
i.e. where all fields are the same except for example_vehicle_index.
Example:
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
example_vehicle_index: 1
example_exceeded_capacity_type: "Apples"
}
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
example_vehicle_index: 3
example_exceeded_capacity_type: "Pears"
}
reasons {
code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
example_vehicle_index: 1
}
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).
[[["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-09 UTC."],[],[],null,["# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::SkippedShipment::Reason (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.11.1](/ruby/docs/reference/google-cloud-optimization-v1/0.11.1/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.10.0](/ruby/docs/reference/google-cloud-optimization-v1/0.10.0/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.9.2](/ruby/docs/reference/google-cloud-optimization-v1/0.9.2/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.8.2](/ruby/docs/reference/google-cloud-optimization-v1/0.8.2/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.7.0](/ruby/docs/reference/google-cloud-optimization-v1/0.7.0/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.6.0](/ruby/docs/reference/google-cloud-optimization-v1/0.6.0/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.5.0](/ruby/docs/reference/google-cloud-optimization-v1/0.5.0/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.4.1](/ruby/docs/reference/google-cloud-optimization-v1/0.4.1/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.3.0](/ruby/docs/reference/google-cloud-optimization-v1/0.3.0/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.2.1](/ruby/docs/reference/google-cloud-optimization-v1/0.2.1/Google-Cloud-Optimization-V1-SkippedShipment-Reason)\n- [0.1.1](/ruby/docs/reference/google-cloud-optimization-v1/0.1.1/Google-Cloud-Optimization-V1-SkippedShipment-Reason) \nReference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::SkippedShipment::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`.\nExample:\n`\nreasons {\ncode: DEMAND_EXCEEDS_VEHICLE_CAPACITY\nexample_vehicle_index: 1\nexample_exceeded_capacity_type: \"Apples\"\n}\nreasons {\ncode: DEMAND_EXCEEDS_VEHICLE_CAPACITY\nexample_vehicle_index: 3\nexample_exceeded_capacity_type: \"Pears\"\n}\nreasons {\ncode: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT\nexample_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\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #code\n\n def code() -\u003e ::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code\n\n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code](./Google-Cloud-Optimization-V1-SkippedShipment-Reason-Code)) --- Refer to the comments of Code.\n\n### #code=\n\n def code=(value) -\u003e ::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code](./Google-Cloud-Optimization-V1-SkippedShipment-Reason-Code)) --- Refer to the comments of Code. \n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code](./Google-Cloud-Optimization-V1-SkippedShipment-Reason-Code)) --- Refer to the comments of Code.\n\n### #example_exceeded_capacity_type\n\n def example_exceeded_capacity_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one capacity type that is exceeded.\n\n### #example_exceeded_capacity_type=\n\n def example_exceeded_capacity_type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one capacity type that is exceeded. \n**Returns**\n\n- (::String) --- If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one capacity type that is exceeded.\n\n### #example_vehicle_index\n\n def example_vehicle_index() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.\n\n### #example_vehicle_index=\n\n def example_vehicle_index=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle. \n**Returns**\n\n- (::Integer) --- If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle."]]