<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/v2/session.proto

namespace Google\Cloud\Bigtable\V2;

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

/**
 * Open sessions for an AuthorizedView. Internal usage only.
 *
 * Generated from protobuf message <code>google.bigtable.v2.OpenAuthorizedViewRequest</code>
 */
class OpenAuthorizedViewRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The Authorized view name to read and write from. Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
     *
     * Generated from protobuf field <code>string authorized_view_name = 1;</code>
     */
    protected $authorized_view_name = '';
    /**
     * The app profile id to use for the authorized view sessions.
     *
     * Generated from protobuf field <code>string app_profile_id = 2;</code>
     */
    protected $app_profile_id = '';
    /**
     * Permission for the session.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3;</code>
     */
    protected $permission = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $authorized_view_name
     *           The Authorized view name to read and write from. Values are of the form
     *           `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
     *     @type string $app_profile_id
     *           The app profile id to use for the authorized view sessions.
     *     @type int $permission
     *           Permission for the session.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Session::initOnce();
        parent::__construct($data);
    }

    /**
     * The Authorized view name to read and write from. Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
     *
     * Generated from protobuf field <code>string authorized_view_name = 1;</code>
     * @return string
     */
    public function getAuthorizedViewName()
    {
        return $this->authorized_view_name;
    }

    /**
     * The Authorized view name to read and write from. Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
     *
     * Generated from protobuf field <code>string authorized_view_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setAuthorizedViewName($var)
    {
        GPBUtil::checkString($var, True);
        $this->authorized_view_name = $var;

        return $this;
    }

    /**
     * The app profile id to use for the authorized view sessions.
     *
     * Generated from protobuf field <code>string app_profile_id = 2;</code>
     * @return string
     */
    public function getAppProfileId()
    {
        return $this->app_profile_id;
    }

    /**
     * The app profile id to use for the authorized view sessions.
     *
     * Generated from protobuf field <code>string app_profile_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAppProfileId($var)
    {
        GPBUtil::checkString($var, True);
        $this->app_profile_id = $var;

        return $this;
    }

    /**
     * Permission for the session.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3;</code>
     * @return int
     */
    public function getPermission()
    {
        return $this->permission;
    }

    /**
     * Permission for the session.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setPermission($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\V2\OpenAuthorizedViewRequest\Permission::class);
        $this->permission = $var;

        return $this;
    }

}

