<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: health.proto

namespace OS\PB;

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

/**
 * Generated from protobuf message <code>OS.PB.HealthEvent</code>
 */
class HealthEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * CorrelationId = Serial + (Sequence << 32) is used to create a unique CorrelationId for the event
     *
     * Generated from protobuf field <code>uint32 Serial = 1;</code>
     */
    protected $Serial = 0;
    /**
     * Incrementing Alert Id generated by the button for Health Alert events
     *
     * Generated from protobuf field <code>uint32 AlertId = 2;</code>
     */
    protected $AlertId = 0;
    /**
     * What role does the button have set, see HealthFlags
     *
     * Generated from protobuf field <code>.OS.PB.HealthButtonRole Role = 4;</code>
     */
    protected $Role = 0;
    /**
     * the Received Signal Strength Indicator of the Button Advertisement
     *
     * Generated from protobuf field <code>sint32 RSSI = 5;</code>
     */
    protected $RSSI = 0;
    /**
     * in dBm, the transmit power of the Health Button
     *
     * Generated from protobuf field <code>sint32 TxPower = 6;</code>
     */
    protected $TxPower = 0;
    /**
     * The battery voltage of the 
     *
     * Generated from protobuf field <code>uint32 BatteryVoltage = 7;</code>
     */
    protected $BatteryVoltage = 0;
    /**
     * True if the button has detected a brownout condition, the coin cell is critically low 
     *
     * Generated from protobuf field <code>bool BatteryBrownout = 8;</code>
     */
    protected $BatteryBrownout = false;
    /**
     * How far the Button is from Link devices by serial
     *
     * Generated from protobuf field <code>repeated .OS.PB.HealthEvent.Distance Distances = 10;</code>
     */
    private $Distances;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $Serial
     *           CorrelationId = Serial + (Sequence << 32) is used to create a unique CorrelationId for the event
     *     @type int $AlertId
     *           Incrementing Alert Id generated by the button for Health Alert events
     *     @type int $Role
     *           What role does the button have set, see HealthFlags
     *     @type int $RSSI
     *           the Received Signal Strength Indicator of the Button Advertisement
     *     @type int $TxPower
     *           in dBm, the transmit power of the Health Button
     *     @type int $BatteryVoltage
     *           The battery voltage of the 
     *     @type bool $BatteryBrownout
     *           True if the button has detected a brownout condition, the coin cell is critically low 
     *     @type \OS\PB\HealthEvent\Distance[] $Distances
     *           How far the Button is from Link devices by serial
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Health::initOnce();
        parent::__construct($data);
    }

    /**
     * CorrelationId = Serial + (Sequence << 32) is used to create a unique CorrelationId for the event
     *
     * Generated from protobuf field <code>uint32 Serial = 1;</code>
     * @return int
     */
    public function getSerial()
    {
        return $this->Serial;
    }

    /**
     * CorrelationId = Serial + (Sequence << 32) is used to create a unique CorrelationId for the event
     *
     * Generated from protobuf field <code>uint32 Serial = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSerial($var)
    {
        GPBUtil::checkUint32($var);
        $this->Serial = $var;

        return $this;
    }

    /**
     * Incrementing Alert Id generated by the button for Health Alert events
     *
     * Generated from protobuf field <code>uint32 AlertId = 2;</code>
     * @return int
     */
    public function getAlertId()
    {
        return $this->AlertId;
    }

    /**
     * Incrementing Alert Id generated by the button for Health Alert events
     *
     * Generated from protobuf field <code>uint32 AlertId = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setAlertId($var)
    {
        GPBUtil::checkUint32($var);
        $this->AlertId = $var;

        return $this;
    }

    /**
     * What role does the button have set, see HealthFlags
     *
     * Generated from protobuf field <code>.OS.PB.HealthButtonRole Role = 4;</code>
     * @return int
     */
    public function getRole()
    {
        return $this->Role;
    }

    /**
     * What role does the button have set, see HealthFlags
     *
     * Generated from protobuf field <code>.OS.PB.HealthButtonRole Role = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setRole($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\HealthButtonRole::class);
        $this->Role = $var;

        return $this;
    }

    /**
     * the Received Signal Strength Indicator of the Button Advertisement
     *
     * Generated from protobuf field <code>sint32 RSSI = 5;</code>
     * @return int
     */
    public function getRSSI()
    {
        return $this->RSSI;
    }

    /**
     * the Received Signal Strength Indicator of the Button Advertisement
     *
     * Generated from protobuf field <code>sint32 RSSI = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRSSI($var)
    {
        GPBUtil::checkInt32($var);
        $this->RSSI = $var;

        return $this;
    }

    /**
     * in dBm, the transmit power of the Health Button
     *
     * Generated from protobuf field <code>sint32 TxPower = 6;</code>
     * @return int
     */
    public function getTxPower()
    {
        return $this->TxPower;
    }

    /**
     * in dBm, the transmit power of the Health Button
     *
     * Generated from protobuf field <code>sint32 TxPower = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setTxPower($var)
    {
        GPBUtil::checkInt32($var);
        $this->TxPower = $var;

        return $this;
    }

    /**
     * The battery voltage of the 
     *
     * Generated from protobuf field <code>uint32 BatteryVoltage = 7;</code>
     * @return int
     */
    public function getBatteryVoltage()
    {
        return $this->BatteryVoltage;
    }

    /**
     * The battery voltage of the 
     *
     * Generated from protobuf field <code>uint32 BatteryVoltage = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setBatteryVoltage($var)
    {
        GPBUtil::checkUint32($var);
        $this->BatteryVoltage = $var;

        return $this;
    }

    /**
     * True if the button has detected a brownout condition, the coin cell is critically low 
     *
     * Generated from protobuf field <code>bool BatteryBrownout = 8;</code>
     * @return bool
     */
    public function getBatteryBrownout()
    {
        return $this->BatteryBrownout;
    }

    /**
     * True if the button has detected a brownout condition, the coin cell is critically low 
     *
     * Generated from protobuf field <code>bool BatteryBrownout = 8;</code>
     * @param bool $var
     * @return $this
     */
    public function setBatteryBrownout($var)
    {
        GPBUtil::checkBool($var);
        $this->BatteryBrownout = $var;

        return $this;
    }

    /**
     * How far the Button is from Link devices by serial
     *
     * Generated from protobuf field <code>repeated .OS.PB.HealthEvent.Distance Distances = 10;</code>
     * @return RepeatedField<\OS\PB\HealthEvent\Distance>
     */
    public function getDistances()
    {
        return $this->Distances;
    }

    /**
     * How far the Button is from Link devices by serial
     *
     * Generated from protobuf field <code>repeated .OS.PB.HealthEvent.Distance Distances = 10;</code>
     * @param \OS\PB\HealthEvent\Distance[] $var
     * @return $this
     */
    public function setDistances($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \OS\PB\HealthEvent\Distance::class);
        $this->Distances = $arr;

        return $this;
    }

}

