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

namespace Keyapis\Identity\V1\CaptchaAnswer;

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

/**
 * Ошибка ответа на капчу
 *
 * Generated from protobuf message <code>keyapis.identity.v1.CaptchaAnswer.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    /**
     * Капча
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.Captcha captcha = 2;</code>
     */
    protected $captcha = null;
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Identity\V1\CaptchaAnswer\Error\WrongAnswer $wrong_answer
     *           Некорректный ответ на капчу
     *     @type \Keyapis\Identity\V1\Captcha $captcha
     *           Капча
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityAuthorizationV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Некорректный ответ на капчу
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer.Error.WrongAnswer wrong_answer = 1;</code>
     * @return \Keyapis\Identity\V1\CaptchaAnswer\Error\WrongAnswer|null
     */
    public function getWrongAnswer()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Некорректный ответ на капчу
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer.Error.WrongAnswer wrong_answer = 1;</code>
     * @param \Keyapis\Identity\V1\CaptchaAnswer\Error\WrongAnswer $var
     * @return $this
     */
    public function setWrongAnswer($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\CaptchaAnswer\Error\WrongAnswer::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Капча
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.Captcha captcha = 2;</code>
     * @return \Keyapis\Identity\V1\Captcha|null
     */
    public function getCaptcha()
    {
        return $this->captcha;
    }

    public function hasCaptcha()
    {
        return isset($this->captcha);
    }

    public function clearCaptcha()
    {
        unset($this->captcha);
    }

    /**
     * Капча
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.Captcha captcha = 2;</code>
     * @param \Keyapis\Identity\V1\Captcha $var
     * @return $this
     */
    public function setCaptcha($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\Captcha::class);
        $this->captcha = $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\CaptchaAnswer_Error::class);

