<?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;

/**
 * Generated from protobuf message <code>OS.PB.RelayConfig</code>
 */
class RelayConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Determines whether an event should be generated when the relay is activated or deactivated
     *
     * Generated from protobuf field <code>.OS.PB.Toggle EventOnStateChange = 1;</code>
     */
    protected $EventOnStateChange = 0;
    /**
     * Default: 4 seconds. If no duration is specified for RelayActivate action, then the DefaultDurationsMs will be used to drive the relay
     *
     * Generated from protobuf field <code>uint32 DefaultDurationMs = 2;</code>
     */
    protected $DefaultDurationMs = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $EventOnStateChange
     *           Determines whether an event should be generated when the relay is activated or deactivated
     *     @type int $DefaultDurationMs
     *           Default: 4 seconds. If no duration is specified for RelayActivate action, then the DefaultDurationsMs will be used to drive the relay
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Relay::initOnce();
        parent::__construct($data);
    }

    /**
     * Determines whether an event should be generated when the relay is activated or deactivated
     *
     * Generated from protobuf field <code>.OS.PB.Toggle EventOnStateChange = 1;</code>
     * @return int
     */
    public function getEventOnStateChange()
    {
        return $this->EventOnStateChange;
    }

    /**
     * Determines whether an event should be generated when the relay is activated or deactivated
     *
     * Generated from protobuf field <code>.OS.PB.Toggle EventOnStateChange = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setEventOnStateChange($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\Toggle::class);
        $this->EventOnStateChange = $var;

        return $this;
    }

    /**
     * Default: 4 seconds. If no duration is specified for RelayActivate action, then the DefaultDurationsMs will be used to drive the relay
     *
     * Generated from protobuf field <code>uint32 DefaultDurationMs = 2;</code>
     * @return int
     */
    public function getDefaultDurationMs()
    {
        return $this->DefaultDurationMs;
    }

    /**
     * Default: 4 seconds. If no duration is specified for RelayActivate action, then the DefaultDurationsMs will be used to drive the relay
     *
     * Generated from protobuf field <code>uint32 DefaultDurationMs = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDefaultDurationMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->DefaultDurationMs = $var;

        return $this;
    }

}

