Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule.
A precedence rule between two events (each event is the pickup or the
delivery of a shipment): the "second" event has to start at least
offset_duration after "first" has started.
Several precedences can refer to the same (or related) events, e.g.,
"pickup of B happens after delivery of A" and "pickup of C happens after
pickup of B".
Furthermore, precedences only apply when both shipments are performed and
are otherwise ignored.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#first_index
deffirst_index()->::Integer
Returns
(::Integer) — Shipment index of the "first" event. This field must be specified.
#first_index=
deffirst_index=(value)->::Integer
Parameter
value (::Integer) — Shipment index of the "first" event. This field must be specified.
Returns
(::Integer) — Shipment index of the "first" event. This field must be specified.
#first_is_delivery
deffirst_is_delivery()->::Boolean
Returns
(::Boolean) — Indicates if the "first" event is a delivery.
#first_is_delivery=
deffirst_is_delivery=(value)->::Boolean
Parameter
value (::Boolean) — Indicates if the "first" event is a delivery.
Returns
(::Boolean) — Indicates if the "first" event is a delivery.
[[["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::ShipmentModel::PrecedenceRule (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-ShipmentModel-PrecedenceRule)\n- [0.11.1](/ruby/docs/reference/google-cloud-optimization-v1/0.11.1/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.10.0](/ruby/docs/reference/google-cloud-optimization-v1/0.10.0/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.9.2](/ruby/docs/reference/google-cloud-optimization-v1/0.9.2/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.8.2](/ruby/docs/reference/google-cloud-optimization-v1/0.8.2/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.7.0](/ruby/docs/reference/google-cloud-optimization-v1/0.7.0/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.6.0](/ruby/docs/reference/google-cloud-optimization-v1/0.6.0/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.5.0](/ruby/docs/reference/google-cloud-optimization-v1/0.5.0/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.4.1](/ruby/docs/reference/google-cloud-optimization-v1/0.4.1/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.3.0](/ruby/docs/reference/google-cloud-optimization-v1/0.3.0/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.2.1](/ruby/docs/reference/google-cloud-optimization-v1/0.2.1/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\n- [0.1.1](/ruby/docs/reference/google-cloud-optimization-v1/0.1.1/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule) \nReference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule.\n\nA precedence rule between two events (each event is the pickup or the\ndelivery of a shipment): the \"second\" event has to start at least\n`offset_duration` after \"first\" has started.\n\n\nSeveral precedences can refer to the same (or related) events, e.g.,\n\"pickup of B happens after delivery of A\" and \"pickup of C happens after\npickup of B\".\n\n\u003cbr /\u003e\n\nFurthermore, precedences only apply when both shipments are performed and\nare otherwise ignored. \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### #first_index\n\n def first_index() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Shipment index of the \"first\" event. This field must be specified.\n\n### #first_index=\n\n def first_index=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Shipment index of the \"first\" event. This field must be specified. \n**Returns**\n\n- (::Integer) --- Shipment index of the \"first\" event. This field must be specified.\n\n### #first_is_delivery\n\n def first_is_delivery() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Indicates if the \"first\" event is a delivery.\n\n### #first_is_delivery=\n\n def first_is_delivery=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Indicates if the \"first\" event is a delivery. \n**Returns**\n\n- (::Boolean) --- Indicates if the \"first\" event is a delivery.\n\n### #offset_duration\n\n def offset_duration() -\u003e ::Google::Protobuf::Duration\n\n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- The offset between the \"first\" and \"second\" event. It can be negative.\n\n### #offset_duration=\n\n def offset_duration=(value) -\u003e ::Google::Protobuf::Duration\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- The offset between the \"first\" and \"second\" event. It can be negative. \n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- The offset between the \"first\" and \"second\" event. It can be negative.\n\n### #second_index\n\n def second_index() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Shipment index of the \"second\" event. This field must be specified.\n\n### #second_index=\n\n def second_index=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Shipment index of the \"second\" event. This field must be specified. \n**Returns**\n\n- (::Integer) --- Shipment index of the \"second\" event. This field must be specified.\n\n### #second_is_delivery\n\n def second_is_delivery() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Indicates if the \"second\" event is a delivery.\n\n### #second_is_delivery=\n\n def second_is_delivery=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Indicates if the \"second\" event is a delivery. \n**Returns**\n\n- (::Boolean) --- Indicates if the \"second\" event is a delivery."]]