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

namespace Keyapis\Device\V1;

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

/**
 * Задача на создание доступа к устройству.
 * Очередь key.device.create_device_access
 *
 * Generated from protobuf message <code>keyapis.device.v1.CreateDeviceAccessTask</code>
 */
class CreateDeviceAccessTask extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $request_id = '';
    /**
     * Идентификаторы устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>repeated int32 device_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $device_ids;
    /**
     * Тип субъекта доступа
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceAccess.AccessorType device_access_accessor_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_access_accessor_type = 0;
    /**
     * Идентификатор субъекта доступа.
     * # Диапазон: 1..36
     *
     * Generated from protobuf field <code>string accessor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $accessor_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $request_id
     *           Идентификатор запроса
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $device_ids
     *           Идентификаторы устройства.
     *           # Диапазон: 0..2147483647
     *     @type int $device_access_accessor_type
     *           Тип субъекта доступа
     *     @type string $accessor_id
     *           Идентификатор субъекта доступа.
     *           # Диапазон: 1..36
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceEventsV1::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Идентификаторы устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>repeated int32 device_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDeviceIds()
    {
        return $this->device_ids;
    }

    /**
     * Идентификаторы устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>repeated int32 device_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDeviceIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->device_ids = $arr;

        return $this;
    }

    /**
     * Тип субъекта доступа
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceAccess.AccessorType device_access_accessor_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDeviceAccessAccessorType()
    {
        return $this->device_access_accessor_type;
    }

    /**
     * Тип субъекта доступа
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceAccess.AccessorType device_access_accessor_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceAccessAccessorType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\DeviceAccess\AccessorType::class);
        $this->device_access_accessor_type = $var;

        return $this;
    }

    /**
     * Идентификатор субъекта доступа.
     * # Диапазон: 1..36
     *
     * Generated from protobuf field <code>string accessor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getAccessorId()
    {
        return $this->accessor_id;
    }

    /**
     * Идентификатор субъекта доступа.
     * # Диапазон: 1..36
     *
     * Generated from protobuf field <code>string accessor_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setAccessorId($var)
    {
        GPBUtil::checkString($var, True);
        $this->accessor_id = $var;

        return $this;
    }

}

