<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/fleetengine/delivery/v1/tasks.proto

namespace Google\Maps\FleetEngine\Delivery\V1\Task;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Journey sharing specific fields.
 *
 * Generated from protobuf message <code>maps.fleetengine.delivery.v1.Task.JourneySharingInfo</code>
 */
class JourneySharingInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Tracking information for the stops that the assigned vehicle will make
     * before it completes this Task. Note that this list can contain stops
     * from other tasks.
     * The first segment,
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC)
     * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST),
     * contains route information from the driver's last known location to the
     * upcoming `VehicleStop`. Current route information usually comes from the
     * driver app, except for some cases noted in the documentation for
     * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment].
     * The other segments in
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or
     * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are
     * populated by Fleet Engine. They provide route information between the
     * remaining `VehicleStops`.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1;</code>
     */
    private $remaining_vehicle_journey_segments;
    /**
     * Indicates the vehicle's last reported location of the assigned vehicle.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2;</code>
     */
    protected $last_location = null;
    /**
     * Indicates whether the vehicle's lastLocation can be snapped to
     * the `current_route_segment`. This value is False if either
     * `last_location` or `current_route_segment` don't exist. This value is
     * computed by Fleet Engine. Updates from clients are ignored.
     *
     * Generated from protobuf field <code>bool last_location_snappable = 3;</code>
     */
    protected $last_location_snappable = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $remaining_vehicle_journey_segments
     *           Tracking information for the stops that the assigned vehicle will make
     *           before it completes this Task. Note that this list can contain stops
     *           from other tasks.
     *           The first segment,
     *           `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC)
     *           or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST),
     *           contains route information from the driver's last known location to the
     *           upcoming `VehicleStop`. Current route information usually comes from the
     *           driver app, except for some cases noted in the documentation for
     *           [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment].
     *           The other segments in
     *           `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or
     *           `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are
     *           populated by Fleet Engine. They provide route information between the
     *           remaining `VehicleStops`.
     *     @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $last_location
     *           Indicates the vehicle's last reported location of the assigned vehicle.
     *     @type bool $last_location_snappable
     *           Indicates whether the vehicle's lastLocation can be snapped to
     *           the `current_route_segment`. This value is False if either
     *           `last_location` or `current_route_segment` don't exist. This value is
     *           computed by Fleet Engine. Updates from clients are ignored.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce();
        parent::__construct($data);
    }

    /**
     * Tracking information for the stops that the assigned vehicle will make
     * before it completes this Task. Note that this list can contain stops
     * from other tasks.
     * The first segment,
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC)
     * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST),
     * contains route information from the driver's last known location to the
     * upcoming `VehicleStop`. Current route information usually comes from the
     * driver app, except for some cases noted in the documentation for
     * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment].
     * The other segments in
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or
     * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are
     * populated by Fleet Engine. They provide route information between the
     * remaining `VehicleStops`.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRemainingVehicleJourneySegments()
    {
        return $this->remaining_vehicle_journey_segments;
    }

    /**
     * Tracking information for the stops that the assigned vehicle will make
     * before it completes this Task. Note that this list can contain stops
     * from other tasks.
     * The first segment,
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments[0]` (gRPC)
     * or `Task.journeySharingInfo.remainingVehicleJourneySegments[0]` (REST),
     * contains route information from the driver's last known location to the
     * upcoming `VehicleStop`. Current route information usually comes from the
     * driver app, except for some cases noted in the documentation for
     * [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment].
     * The other segments in
     * `Task.journey_sharing_info.remaining_vehicle_journey_segments` (gRPC) or
     * `Task.journeySharingInfo.remainingVehicleJourneySegments` (REST) are
     * populated by Fleet Engine. They provide route information between the
     * remaining `VehicleStops`.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.delivery.v1.VehicleJourneySegment remaining_vehicle_journey_segments = 1;</code>
     * @param array<\Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRemainingVehicleJourneySegments($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment::class);
        $this->remaining_vehicle_journey_segments = $arr;

        return $this;
    }

    /**
     * Indicates the vehicle's last reported location of the assigned vehicle.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2;</code>
     * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation|null
     */
    public function getLastLocation()
    {
        return $this->last_location;
    }

    public function hasLastLocation()
    {
        return isset($this->last_location);
    }

    public function clearLastLocation()
    {
        unset($this->last_location);
    }

    /**
     * Indicates the vehicle's last reported location of the assigned vehicle.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryVehicleLocation last_location = 2;</code>
     * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation $var
     * @return $this
     */
    public function setLastLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation::class);
        $this->last_location = $var;

        return $this;
    }

    /**
     * Indicates whether the vehicle's lastLocation can be snapped to
     * the `current_route_segment`. This value is False if either
     * `last_location` or `current_route_segment` don't exist. This value is
     * computed by Fleet Engine. Updates from clients are ignored.
     *
     * Generated from protobuf field <code>bool last_location_snappable = 3;</code>
     * @return bool
     */
    public function getLastLocationSnappable()
    {
        return $this->last_location_snappable;
    }

    /**
     * Indicates whether the vehicle's lastLocation can be snapped to
     * the `current_route_segment`. This value is False if either
     * `last_location` or `current_route_segment` don't exist. This value is
     * computed by Fleet Engine. Updates from clients are ignored.
     *
     * Generated from protobuf field <code>bool last_location_snappable = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setLastLocationSnappable($var)
    {
        GPBUtil::checkBool($var);
        $this->last_location_snappable = $var;

        return $this;
    }

}


