<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/optimization/v1/fleet_routing.proto

namespace Google\Cloud\Optimization\V1\ShipmentModel\DurationDistanceMatrix;

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

/**
 * Specifies a row of the duration and distance matrix.
 *
 * Generated from protobuf message <code>google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix.Row</code>
 */
class Row extends \Google\Protobuf\Internal\Message
{
    /**
     * Duration values for a given row. It must have as many elements as
     * [ShipmentModel.duration_distance_matrix_dst_tags][google.cloud.optimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Duration durations = 1;</code>
     */
    private $durations;
    /**
     * Distance values for a given row. If no costs or constraints refer to
     * distances in the model, this can be left empty; otherwise it must have
     * as many elements as `durations`.
     *
     * Generated from protobuf field <code>repeated double meters = 2;</code>
     */
    private $meters;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration[]|\Google\Protobuf\Internal\RepeatedField $durations
     *           Duration values for a given row. It must have as many elements as
     *           [ShipmentModel.duration_distance_matrix_dst_tags][google.cloud.optimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
     *     @type float[]|\Google\Protobuf\Internal\RepeatedField $meters
     *           Distance values for a given row. If no costs or constraints refer to
     *           distances in the model, this can be left empty; otherwise it must have
     *           as many elements as `durations`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Optimization\V1\FleetRouting::initOnce();
        parent::__construct($data);
    }

    /**
     * Duration values for a given row. It must have as many elements as
     * [ShipmentModel.duration_distance_matrix_dst_tags][google.cloud.optimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Duration durations = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDurations()
    {
        return $this->durations;
    }

    /**
     * Duration values for a given row. It must have as many elements as
     * [ShipmentModel.duration_distance_matrix_dst_tags][google.cloud.optimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Duration durations = 1;</code>
     * @param \Google\Protobuf\Duration[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDurations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class);
        $this->durations = $arr;

        return $this;
    }

    /**
     * Distance values for a given row. If no costs or constraints refer to
     * distances in the model, this can be left empty; otherwise it must have
     * as many elements as `durations`.
     *
     * Generated from protobuf field <code>repeated double meters = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMeters()
    {
        return $this->meters;
    }

    /**
     * Distance values for a given row. If no costs or constraints refer to
     * distances in the model, this can be left empty; otherwise it must have
     * as many elements as `durations`.
     *
     * Generated from protobuf field <code>repeated double meters = 2;</code>
     * @param float[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMeters($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
        $this->meters = $arr;

        return $this;
    }

}


