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

namespace Deviceapis\Device\V1\User;

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

/**
 * Права доступа
 *
 * Generated from protobuf message <code>deviceapis.device.v1.User.Permission</code>
 */
class Permission extends \Google\Protobuf\Internal\Message
{
    /**
     * Имя разрешения
     *
     * Generated from protobuf field <code>string permission_name = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $permission_name = '';
    /**
     * Наличие разрешения
     *
     * Generated from protobuf field <code>bool is_enabled = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $is_enabled = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $permission_name
     *           Имя разрешения
     *     @type bool $is_enabled
     *           Наличие разрешения
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceUserV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Имя разрешения
     *
     * Generated from protobuf field <code>string permission_name = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return string
     */
    public function getPermissionName()
    {
        return $this->permission_name;
    }

    /**
     * Имя разрешения
     *
     * Generated from protobuf field <code>string permission_name = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param string $var
     * @return $this
     */
    public function setPermissionName($var)
    {
        GPBUtil::checkString($var, True);
        $this->permission_name = $var;

        return $this;
    }

    /**
     * Наличие разрешения
     *
     * Generated from protobuf field <code>bool is_enabled = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return bool
     */
    public function getIsEnabled()
    {
        return $this->is_enabled;
    }

    /**
     * Наличие разрешения
     *
     * Generated from protobuf field <code>bool is_enabled = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param bool $var
     * @return $this
     */
    public function setIsEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->is_enabled = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Permission::class, \Deviceapis\Device\V1\User_Permission::class);

