<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/access_control/v1/keyapis_access_control_rfid_v1.proto

namespace Keyapis\AccessControl\V1;

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

/**
 * Ключ.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.access_control.v1.Rfid</code>
 */
class Rfid extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор ключа.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 2;</code>
     */
    protected $user_id = null;
    /**
     * Системное описание.
     * Обычно оставляет УК/Админ, пользователь его не видет
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</code>
     */
    protected $description = null;
    /**
     * Идентификатор компании
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value company_id = 4;</code>
     */
    protected $company_id = null;
    /**
     * Идентификатор создателя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value creator_id = 5;</code>
     */
    protected $creator_id = null;
    /**
     * Код ключа (UID).
     * Уникальное значение.
     * # Паттерн: /^[0-9a-fA-F]{1,14}$/
     *
     * Generated from protobuf field <code>string key = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key = '';
    /**
     * Тип оплаты
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.PayType pay_type = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $pay_type = 0;
    /**
     * Тип владельца ключа
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.HolderType holder_type = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $holder_type = 0;
    /**
     * Дата создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата обновления.
     * # Тип: DateTime?
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10;</code>
     */
    protected $changed_at = null;
    /**
     * ОРПОН дома.
     * # Диапазон: 1..9223372036854775807
     *
     * Generated from protobuf field <code>int64 orpon = 11 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $orpon = 0;
    /**
     * Номер квартиры.
     * # Диапазон: 1..4
     *
     * Generated from protobuf field <code>string room_number = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $room_number = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор ключа.
     *           # Диапазон: 0..2147483647
     *     @type \Google\Protobuf\Int32Value $user_id
     *           Идентификатор пользователя
     *     @type \Google\Protobuf\StringValue $description
     *           Системное описание.
     *           Обычно оставляет УК/Админ, пользователь его не видет
     *     @type \Google\Protobuf\Int32Value $company_id
     *           Идентификатор компании
     *     @type \Google\Protobuf\Int32Value $creator_id
     *           Идентификатор создателя
     *     @type string $key
     *           Код ключа (UID).
     *           Уникальное значение.
     *           # Паттерн: /^[0-9a-fA-F]{1,14}$/
     *     @type int $pay_type
     *           Тип оплаты
     *     @type int $holder_type
     *           Тип владельца ключа
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата обновления.
     *           # Тип: DateTime?
     *     @type int|string $orpon
     *           ОРПОН дома.
     *           # Диапазон: 1..9223372036854775807
     *     @type string $room_number
     *           Номер квартиры.
     *           # Диапазон: 1..4
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\AccessControl\V1\KeyapisAccessControlRfidV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор ключа.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор ключа.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 2;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    public function hasUserId()
    {
        return isset($this->user_id);
    }

    public function clearUserId()
    {
        unset($this->user_id);
    }

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

     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 2;</code>
     * @return int|null
     */
    public function getUserIdUnwrapped()
    {
        return $this->readWrapperValue("user_id");
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 2;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->user_id = $var;

        return $this;
    }

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

     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 2;</code>
     * @param int|null $var
     * @return $this
     */
    public function setUserIdUnwrapped($var)
    {
        $this->writeWrapperValue("user_id", $var);
        return $this;}

    /**
     * Системное описание.
     * Обычно оставляет УК/Админ, пользователь его не видет
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</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 = 3;</code>
     * @return string|null
     */
    public function getDescriptionUnwrapped()
    {
        return $this->readWrapperValue("description");
    }

    /**
     * Системное описание.
     * Обычно оставляет УК/Админ, пользователь его не видет
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</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 = 3;</code>
     * @param string|null $var
     * @return $this
     */
    public function setDescriptionUnwrapped($var)
    {
        $this->writeWrapperValue("description", $var);
        return $this;}

    /**
     * Идентификатор компании
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value company_id = 4;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getCompanyId()
    {
        return $this->company_id;
    }

    public function hasCompanyId()
    {
        return isset($this->company_id);
    }

    public function clearCompanyId()
    {
        unset($this->company_id);
    }

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

     * Идентификатор компании
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value company_id = 4;</code>
     * @return int|null
     */
    public function getCompanyIdUnwrapped()
    {
        return $this->readWrapperValue("company_id");
    }

    /**
     * Идентификатор компании
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value company_id = 4;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setCompanyId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->company_id = $var;

        return $this;
    }

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

     * Идентификатор компании
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value company_id = 4;</code>
     * @param int|null $var
     * @return $this
     */
    public function setCompanyIdUnwrapped($var)
    {
        $this->writeWrapperValue("company_id", $var);
        return $this;}

    /**
     * Идентификатор создателя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value creator_id = 5;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getCreatorId()
    {
        return $this->creator_id;
    }

    public function hasCreatorId()
    {
        return isset($this->creator_id);
    }

    public function clearCreatorId()
    {
        unset($this->creator_id);
    }

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

     * Идентификатор создателя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value creator_id = 5;</code>
     * @return int|null
     */
    public function getCreatorIdUnwrapped()
    {
        return $this->readWrapperValue("creator_id");
    }

    /**
     * Идентификатор создателя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value creator_id = 5;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setCreatorId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->creator_id = $var;

        return $this;
    }

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

     * Идентификатор создателя
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value creator_id = 5;</code>
     * @param int|null $var
     * @return $this
     */
    public function setCreatorIdUnwrapped($var)
    {
        $this->writeWrapperValue("creator_id", $var);
        return $this;}

    /**
     * Код ключа (UID).
     * Уникальное значение.
     * # Паттерн: /^[0-9a-fA-F]{1,14}$/
     *
     * Generated from protobuf field <code>string key = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Код ключа (UID).
     * Уникальное значение.
     * # Паттерн: /^[0-9a-fA-F]{1,14}$/
     *
     * Generated from protobuf field <code>string key = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * Тип оплаты
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.PayType pay_type = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getPayType()
    {
        return $this->pay_type;
    }

    /**
     * Тип оплаты
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.PayType pay_type = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setPayType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\AccessControl\V1\Rfid\PayType::class);
        $this->pay_type = $var;

        return $this;
    }

    /**
     * Тип владельца ключа
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.HolderType holder_type = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getHolderType()
    {
        return $this->holder_type;
    }

    /**
     * Тип владельца ключа
     *
     * Generated from protobuf field <code>.keyapis.access_control.v1.Rfid.HolderType holder_type = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setHolderType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\AccessControl\V1\Rfid\HolderType::class);
        $this->holder_type = $var;

        return $this;
    }

    /**
     * Дата создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    public function hasCreatedAt()
    {
        return isset($this->created_at);
    }

    public function clearCreatedAt()
    {
        unset($this->created_at);
    }

    /**
     * Дата создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Дата обновления.
     * # Тип: DateTime?
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getChangedAt()
    {
        return $this->changed_at;
    }

    public function hasChangedAt()
    {
        return isset($this->changed_at);
    }

    public function clearChangedAt()
    {
        unset($this->changed_at);
    }

    /**
     * Дата обновления.
     * # Тип: DateTime?
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setChangedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->changed_at = $var;

        return $this;
    }

    /**
     * ОРПОН дома.
     * # Диапазон: 1..9223372036854775807
     *
     * Generated from protobuf field <code>int64 orpon = 11 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int|string
     */
    public function getOrpon()
    {
        return $this->orpon;
    }

    /**
     * ОРПОН дома.
     * # Диапазон: 1..9223372036854775807
     *
     * Generated from protobuf field <code>int64 orpon = 11 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int|string $var
     * @return $this
     */
    public function setOrpon($var)
    {
        GPBUtil::checkInt64($var);
        $this->orpon = $var;

        return $this;
    }

    /**
     * Номер квартиры.
     * # Диапазон: 1..4
     *
     * Generated from protobuf field <code>string room_number = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRoomNumber()
    {
        return $this->room_number;
    }

    /**
     * Номер квартиры.
     * # Диапазон: 1..4
     *
     * Generated from protobuf field <code>string room_number = 12 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRoomNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->room_number = $var;

        return $this;
    }

}

