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

namespace Google\Maps\FleetEngine\V1;

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

/**
 * Traffic density along a Vehicle's path.
 *
 * Generated from protobuf message <code>maps.fleetengine.v1.ConsumableTrafficPolyline</code>
 */
class ConsumableTrafficPolyline extends \Google\Protobuf\Internal\Message
{
    /**
     * Traffic speed along the path from the previous waypoint to the current
     * waypoint.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1;</code>
     */
    private $speed_reading_interval;
    /**
     * The path the driver is taking from the previous waypoint to the current
     * waypoint. This path has landmarks in it so clients can show traffic markers
     * along the path (see `speed_reading_interval`).  Decoding is not yet
     * supported.
     *
     * Generated from protobuf field <code>string encoded_path_to_waypoint = 2;</code>
     */
    protected $encoded_path_to_waypoint = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Maps\FleetEngine\V1\SpeedReadingInterval>|\Google\Protobuf\Internal\RepeatedField $speed_reading_interval
     *           Traffic speed along the path from the previous waypoint to the current
     *           waypoint.
     *     @type string $encoded_path_to_waypoint
     *           The path the driver is taking from the previous waypoint to the current
     *           waypoint. This path has landmarks in it so clients can show traffic markers
     *           along the path (see `speed_reading_interval`).  Decoding is not yet
     *           supported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Maps\Fleetengine\V1\Traffic::initOnce();
        parent::__construct($data);
    }

    /**
     * Traffic speed along the path from the previous waypoint to the current
     * waypoint.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSpeedReadingInterval()
    {
        return $this->speed_reading_interval;
    }

    /**
     * Traffic speed along the path from the previous waypoint to the current
     * waypoint.
     *
     * Generated from protobuf field <code>repeated .maps.fleetengine.v1.SpeedReadingInterval speed_reading_interval = 1;</code>
     * @param array<\Google\Maps\FleetEngine\V1\SpeedReadingInterval>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSpeedReadingInterval($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\FleetEngine\V1\SpeedReadingInterval::class);
        $this->speed_reading_interval = $arr;

        return $this;
    }

    /**
     * The path the driver is taking from the previous waypoint to the current
     * waypoint. This path has landmarks in it so clients can show traffic markers
     * along the path (see `speed_reading_interval`).  Decoding is not yet
     * supported.
     *
     * Generated from protobuf field <code>string encoded_path_to_waypoint = 2;</code>
     * @return string
     */
    public function getEncodedPathToWaypoint()
    {
        return $this->encoded_path_to_waypoint;
    }

    /**
     * The path the driver is taking from the previous waypoint to the current
     * waypoint. This path has landmarks in it so clients can show traffic markers
     * along the path (see `speed_reading_interval`).  Decoding is not yet
     * supported.
     *
     * Generated from protobuf field <code>string encoded_path_to_waypoint = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setEncodedPathToWaypoint($var)
    {
        GPBUtil::checkString($var, True);
        $this->encoded_path_to_waypoint = $var;

        return $this;
    }

}

