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

namespace Keyapis\Identity\V1\PostTokenUserResponse;

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

/**
 * Ошибка запроса на получение токена по идентификатору пользователя
 *
 * Generated from protobuf message <code>keyapis.identity.v1.PostTokenUserResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Identity\V1\PostTokenUserResponse\Error\TokenError $token
     *           Ошибка получения токена
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityTokenV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка получения токена
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.PostTokenUserResponse.Error.TokenError token = 1;</code>
     * @return \Keyapis\Identity\V1\PostTokenUserResponse\Error\TokenError|null
     */
    public function getToken()
    {
        return $this->readOneof(1);
    }

    public function hasToken()
    {
        return $this->hasOneof(1);
    }

    /**
     * Ошибка получения токена
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.PostTokenUserResponse.Error.TokenError token = 1;</code>
     * @param \Keyapis\Identity\V1\PostTokenUserResponse\Error\TokenError $var
     * @return $this
     */
    public function setToken($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\PostTokenUserResponse\Error\TokenError::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getReason()
    {
        return $this->whichOneof("reason");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Error::class, \Keyapis\Identity\V1\PostTokenUserResponse_Error::class);

