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

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

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

/**
 * The option message that defines when a data element should be visible to
 * the end users.
 *
 * Generated from protobuf message <code>maps.fleetengine.delivery.v1.TaskTrackingViewConfig.VisibilityOption</code>
 */
class VisibilityOption extends \Google\Protobuf\Internal\Message
{
    protected $visibility_option;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $remaining_stop_count_threshold
     *           This data element is visible to the end users if the remaining stop
     *           count <= remaining_stop_count_threshold.
     *     @type \Google\Protobuf\Duration $duration_until_estimated_arrival_time_threshold
     *           This data element is visible to the end users if the ETA to the stop
     *           <= duration_until_estimated_arrival_time_threshold.
     *     @type int $remaining_driving_distance_meters_threshold
     *           This data element is visible to the end users if the remaining
     *           driving distance in meters <=
     *           remaining_driving_distance_meters_threshold.
     *     @type bool $always
     *           If set to true, this data element is always visible to the end users
     *           with no thresholds. This field cannot be set to false.
     *     @type bool $never
     *           If set to true, this data element is always hidden from the end users
     *           with no thresholds. This field cannot be set to false.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\Tasks::initOnce();
        parent::__construct($data);
    }

    /**
     * This data element is visible to the end users if the remaining stop
     * count <= remaining_stop_count_threshold.
     *
     * Generated from protobuf field <code>int32 remaining_stop_count_threshold = 1;</code>
     * @return int
     */
    public function getRemainingStopCountThreshold()
    {
        return $this->readOneof(1);
    }

    public function hasRemainingStopCountThreshold()
    {
        return $this->hasOneof(1);
    }

    /**
     * This data element is visible to the end users if the remaining stop
     * count <= remaining_stop_count_threshold.
     *
     * Generated from protobuf field <code>int32 remaining_stop_count_threshold = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setRemainingStopCountThreshold($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * This data element is visible to the end users if the ETA to the stop
     * <= duration_until_estimated_arrival_time_threshold.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration_until_estimated_arrival_time_threshold = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDurationUntilEstimatedArrivalTimeThreshold()
    {
        return $this->readOneof(2);
    }

    public function hasDurationUntilEstimatedArrivalTimeThreshold()
    {
        return $this->hasOneof(2);
    }

    /**
     * This data element is visible to the end users if the ETA to the stop
     * <= duration_until_estimated_arrival_time_threshold.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration_until_estimated_arrival_time_threshold = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDurationUntilEstimatedArrivalTimeThreshold($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * This data element is visible to the end users if the remaining
     * driving distance in meters <=
     * remaining_driving_distance_meters_threshold.
     *
     * Generated from protobuf field <code>int32 remaining_driving_distance_meters_threshold = 3;</code>
     * @return int
     */
    public function getRemainingDrivingDistanceMetersThreshold()
    {
        return $this->readOneof(3);
    }

    public function hasRemainingDrivingDistanceMetersThreshold()
    {
        return $this->hasOneof(3);
    }

    /**
     * This data element is visible to the end users if the remaining
     * driving distance in meters <=
     * remaining_driving_distance_meters_threshold.
     *
     * Generated from protobuf field <code>int32 remaining_driving_distance_meters_threshold = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setRemainingDrivingDistanceMetersThreshold($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * If set to true, this data element is always visible to the end users
     * with no thresholds. This field cannot be set to false.
     *
     * Generated from protobuf field <code>bool always = 4;</code>
     * @return bool
     */
    public function getAlways()
    {
        return $this->readOneof(4);
    }

    public function hasAlways()
    {
        return $this->hasOneof(4);
    }

    /**
     * If set to true, this data element is always visible to the end users
     * with no thresholds. This field cannot be set to false.
     *
     * Generated from protobuf field <code>bool always = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setAlways($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * If set to true, this data element is always hidden from the end users
     * with no thresholds. This field cannot be set to false.
     *
     * Generated from protobuf field <code>bool never = 5;</code>
     * @return bool
     */
    public function getNever()
    {
        return $this->readOneof(5);
    }

    public function hasNever()
    {
        return $this->hasOneof(5);
    }

    /**
     * If set to true, this data element is always hidden from the end users
     * with no thresholds. This field cannot be set to false.
     *
     * Generated from protobuf field <code>bool never = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setNever($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getVisibilityOption()
    {
        return $this->whichOneof("visibility_option");
    }

}


