<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: proto/auth.proto

namespace GRPC\Auth;

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

/**
 * Generated from protobuf message <code>auth.ValidateJwtTokenResp</code>
 */
class ValidateJwtTokenResp extends \Google\Protobuf\Internal\Message
{
    /**
     * 验证结果
     *
     * Generated from protobuf field <code>.auth.JwtVerifyResult result = 1;</code>
     */
    protected $result = 0;
    /**
     * 换发的新token
     *
     * Generated from protobuf field <code>string new_token = 2;</code>
     */
    protected $new_token = '';
    /**
     * jwt token解析出来的claims数据
     *
     * Generated from protobuf field <code>optional .auth.JwtClaims claims = 3;</code>
     */
    protected $claims = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $result
     *           验证结果
     *     @type string $new_token
     *           换发的新token
     *     @type \GRPC\Auth\JwtClaims $claims
     *           jwt token解析出来的claims数据
     * }
     */
    public function __construct($data = NULL) {
        \GRPC\GPBMetadata\Auth::initOnce();
        parent::__construct($data);
    }

    /**
     * 验证结果
     *
     * Generated from protobuf field <code>.auth.JwtVerifyResult result = 1;</code>
     * @return int
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * 验证结果
     *
     * Generated from protobuf field <code>.auth.JwtVerifyResult result = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setResult($var)
    {
        GPBUtil::checkEnum($var, \GRPC\Auth\JwtVerifyResult::class);
        $this->result = $var;

        return $this;
    }

    /**
     * 换发的新token
     *
     * Generated from protobuf field <code>string new_token = 2;</code>
     * @return string
     */
    public function getNewToken()
    {
        return $this->new_token;
    }

    /**
     * 换发的新token
     *
     * Generated from protobuf field <code>string new_token = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNewToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->new_token = $var;

        return $this;
    }

    /**
     * jwt token解析出来的claims数据
     *
     * Generated from protobuf field <code>optional .auth.JwtClaims claims = 3;</code>
     * @return \GRPC\Auth\JwtClaims|null
     */
    public function getClaims()
    {
        return $this->claims;
    }

    public function hasClaims()
    {
        return isset($this->claims);
    }

    public function clearClaims()
    {
        unset($this->claims);
    }

    /**
     * jwt token解析出来的claims数据
     *
     * Generated from protobuf field <code>optional .auth.JwtClaims claims = 3;</code>
     * @param \GRPC\Auth\JwtClaims $var
     * @return $this
     */
    public function setClaims($var)
    {
        GPBUtil::checkMessage($var, \GRPC\Auth\JwtClaims::class);
        $this->claims = $var;

        return $this;
    }

}