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

namespace OS\PB;

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

/**
 **
 * \@brief   Whenever a relay is activated or deactived, an event is generated
 * \@details A relay has only two states, either activated or deactivated.
 *          There is always a duration associated with either state
 *
 * Generated from protobuf message <code>OS.PB.RelayEvent</code>
 */
class RelayEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * What the current state of the relay is in right now
     *
     * Generated from protobuf field <code>.OS.PB.State RelayState = 1;</code>
     */
    protected $RelayState = 0;
    /**
     * Indicates how long the relay will be activated or deactivated for, 0 to use default duration as per config
     *
     * Generated from protobuf field <code>uint32 DurationMs = 2;</code>
     */
    protected $DurationMs = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $RelayState
     *           What the current state of the relay is in right now
     *     @type int $DurationMs
     *           Indicates how long the relay will be activated or deactivated for, 0 to use default duration as per config
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Relay::initOnce();
        parent::__construct($data);
    }

    /**
     * What the current state of the relay is in right now
     *
     * Generated from protobuf field <code>.OS.PB.State RelayState = 1;</code>
     * @return int
     */
    public function getRelayState()
    {
        return $this->RelayState;
    }

    /**
     * What the current state of the relay is in right now
     *
     * Generated from protobuf field <code>.OS.PB.State RelayState = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setRelayState($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\State::class);
        $this->RelayState = $var;

        return $this;
    }

    /**
     * Indicates how long the relay will be activated or deactivated for, 0 to use default duration as per config
     *
     * Generated from protobuf field <code>uint32 DurationMs = 2;</code>
     * @return int
     */
    public function getDurationMs()
    {
        return $this->DurationMs;
    }

    /**
     * Indicates how long the relay will be activated or deactivated for, 0 to use default duration as per config
     *
     * Generated from protobuf field <code>uint32 DurationMs = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDurationMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->DurationMs = $var;

        return $this;
    }

}

