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

namespace Keyapis\Rfidregistry\V1\Record;

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

/**
 * Контрольная сумма
 *
 * Generated from protobuf message <code>keyapis.rfidregistry.v1.Record.Trailer</code>
 */
class Trailer extends \Google\Protobuf\Internal\Message
{
    /**
     * Сектор.
     * # Диапазон: 0..15
     *
     * Generated from protobuf field <code>int32 sector = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $sector = 0;
    /**
     * Ключ А.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_a = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key_a = '';
    /**
     * Ключ Б.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_b = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key_b = '';
    /**
     * Маска доступа.
     * # Диапазон: 1..512
     *
     * Generated from protobuf field <code>string access_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $access_mask = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $sector
     *           Сектор.
     *           # Диапазон: 0..15
     *     @type string $key_a
     *           Ключ А.
     *           # Диапазон: 1..256
     *     @type string $key_b
     *           Ключ Б.
     *           # Диапазон: 1..256
     *     @type string $access_mask
     *           Маска доступа.
     *           # Диапазон: 1..512
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Rfidregistry\V1\KeyapisRfidregistryRecordV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Сектор.
     * # Диапазон: 0..15
     *
     * Generated from protobuf field <code>int32 sector = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getSector()
    {
        return $this->sector;
    }

    /**
     * Сектор.
     * # Диапазон: 0..15
     *
     * Generated from protobuf field <code>int32 sector = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setSector($var)
    {
        GPBUtil::checkInt32($var);
        $this->sector = $var;

        return $this;
    }

    /**
     * Ключ А.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_a = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKeyA()
    {
        return $this->key_a;
    }

    /**
     * Ключ А.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_a = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKeyA($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_a = $var;

        return $this;
    }

    /**
     * Ключ Б.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_b = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKeyB()
    {
        return $this->key_b;
    }

    /**
     * Ключ Б.
     * # Диапазон: 1..256
     *
     * Generated from protobuf field <code>string key_b = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKeyB($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_b = $var;

        return $this;
    }

    /**
     * Маска доступа.
     * # Диапазон: 1..512
     *
     * Generated from protobuf field <code>string access_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getAccessMask()
    {
        return $this->access_mask;
    }

    /**
     * Маска доступа.
     * # Диапазон: 1..512
     *
     * Generated from protobuf field <code>string access_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setAccessMask($var)
    {
        GPBUtil::checkString($var, True);
        $this->access_mask = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Trailer::class, \Keyapis\Rfidregistry\V1\Record_Trailer::class);

