<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_rfid_v1.proto

namespace Deviceapis\Device\V1;

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

/**
 * Ключ
 *
 * Generated from protobuf message <code>deviceapis.device.v1.Rfid</code>
 */
class Rfid extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор UID [hex 14]
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';
    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 2;</code>
     */
    protected $description = null;
    /**
     * Секрет [hex 14]
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue secret = 3;</code>
     */
    protected $secret = null;
    /**
     * Идентификаторы реле.
     * Диапазон: 1..64
     *
     * Generated from protobuf field <code>repeated int32 relay_indexes = 4;</code>
     */
    private $relay_indexes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Идентификатор UID [hex 14]
     *     @type \Google\Protobuf\StringValue $description
     *           Описание
     *     @type \Google\Protobuf\StringValue $secret
     *           Секрет [hex 14]
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $relay_indexes
     *           Идентификаторы реле.
     *           Диапазон: 1..64
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceRfidV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор UID [hex 14]
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор UID [hex 14]
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 2;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getDescription()
    {
        return $this->description;
    }

    public function hasDescription()
    {
        return isset($this->description);
    }

    public function clearDescription()
    {
        unset($this->description);
    }

    /**
     * Returns the unboxed value from <code>getDescription()</code>

     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 2;</code>
     * @return string|null
     */
    public function getDescriptionUnwrapped()
    {
        return $this->readWrapperValue("description");
    }

    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 2;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->description = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 2;</code>
     * @param string|null $var
     * @return $this
     */
    public function setDescriptionUnwrapped($var)
    {
        $this->writeWrapperValue("description", $var);
        return $this;}

    /**
     * Секрет [hex 14]
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue secret = 3;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getSecret()
    {
        return $this->secret;
    }

    public function hasSecret()
    {
        return isset($this->secret);
    }

    public function clearSecret()
    {
        unset($this->secret);
    }

    /**
     * Returns the unboxed value from <code>getSecret()</code>

     * Секрет [hex 14]
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue secret = 3;</code>
     * @return string|null
     */
    public function getSecretUnwrapped()
    {
        return $this->readWrapperValue("secret");
    }

    /**
     * Секрет [hex 14]
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue secret = 3;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setSecret($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->secret = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Секрет [hex 14]
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue secret = 3;</code>
     * @param string|null $var
     * @return $this
     */
    public function setSecretUnwrapped($var)
    {
        $this->writeWrapperValue("secret", $var);
        return $this;}

    /**
     * Идентификаторы реле.
     * Диапазон: 1..64
     *
     * Generated from protobuf field <code>repeated int32 relay_indexes = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRelayIndexes()
    {
        return $this->relay_indexes;
    }

    /**
     * Идентификаторы реле.
     * Диапазон: 1..64
     *
     * Generated from protobuf field <code>repeated int32 relay_indexes = 4;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRelayIndexes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->relay_indexes = $arr;

        return $this;
    }

}

