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

namespace Keyapis\Identity\V1\PostAuthorizationLoginByPasswordResponse;

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

/**
 * Ошибка запроса авторизации пользователя
 *
 * Generated from protobuf message <code>keyapis.identity.v1.PostAuthorizationLoginByPasswordResponse.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\CaptchaAnswer\Error $captcha_answer
     *           Ошибка капчи
     *     @type \Keyapis\Identity\V1\SsoError $sso
     *           Ошибка из ССО
     *     @type \Keyapis\Identity\V1\KeyError $key
     *           Ошибка из сервисов ключа
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityAuthorizationV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка капчи
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer.Error captcha_answer = 1;</code>
     * @return \Keyapis\Identity\V1\CaptchaAnswer\Error|null
     */
    public function getCaptchaAnswer()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Ошибка капчи
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer.Error captcha_answer = 1;</code>
     * @param \Keyapis\Identity\V1\CaptchaAnswer\Error $var
     * @return $this
     */
    public function setCaptchaAnswer($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\CaptchaAnswer\Error::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Ошибка из ССО
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.SsoError sso = 2;</code>
     * @return \Keyapis\Identity\V1\SsoError|null
     */
    public function getSso()
    {
        return $this->readOneof(2);
    }

    public function hasSso()
    {
        return $this->hasOneof(2);
    }

    /**
     * Ошибка из ССО
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.SsoError sso = 2;</code>
     * @param \Keyapis\Identity\V1\SsoError $var
     * @return $this
     */
    public function setSso($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\SsoError::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Ошибка из сервисов ключа
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.KeyError key = 3;</code>
     * @return \Keyapis\Identity\V1\KeyError|null
     */
    public function getKey()
    {
        return $this->readOneof(3);
    }

    public function hasKey()
    {
        return $this->hasOneof(3);
    }

    /**
     * Ошибка из сервисов ключа
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.KeyError key = 3;</code>
     * @param \Keyapis\Identity\V1\KeyError $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\KeyError::class);
        $this->writeOneof(3, $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\PostAuthorizationLoginByPasswordResponse_Error::class);

