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

namespace Keyapis\Identity\V1;

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

/**
 * Запрос на авторизацию по паролю
 *
 * Generated from protobuf message <code>keyapis.identity.v1.PostAuthorizationLoginByPasswordRequest</code>
 */
class PostAuthorizationLoginByPasswordRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $password = '';
    /**
     * Ответ на капчу
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer captcha_answer = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $captcha_answer = null;
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $phone_number
     *           Номер телефона
     *     @type string $email
     *           Электронная почта
     *     @type string $login
     *           Логин
     *     @type string $password
     *           Пароль
     *     @type \Keyapis\Identity\V1\CaptchaAnswer $captcha_answer
     *           Ответ на капчу
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityAuthorizationV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Номер телефона
     *
     * Generated from protobuf field <code>string phone_number = 1;</code>
     * @return string
     */
    public function getPhoneNumber()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Номер телефона
     *
     * Generated from protobuf field <code>string phone_number = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPhoneNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Электронная почта
     *
     * Generated from protobuf field <code>string email = 2;</code>
     * @return string
     */
    public function getEmail()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Электронная почта
     *
     * Generated from protobuf field <code>string email = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setEmail($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Логин
     *
     * Generated from protobuf field <code>string login = 3;</code>
     * @return string
     */
    public function getLogin()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Логин
     *
     * Generated from protobuf field <code>string login = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setLogin($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setPassword($var)
    {
        GPBUtil::checkString($var, True);
        $this->password = $var;

        return $this;
    }

    /**
     * Ответ на капчу
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer captcha_answer = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Keyapis\Identity\V1\CaptchaAnswer|null
     */
    public function getCaptchaAnswer()
    {
        return $this->captcha_answer;
    }

    public function hasCaptchaAnswer()
    {
        return isset($this->captcha_answer);
    }

    public function clearCaptchaAnswer()
    {
        unset($this->captcha_answer);
    }

    /**
     * Ответ на капчу
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.CaptchaAnswer captcha_answer = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Keyapis\Identity\V1\CaptchaAnswer $var
     * @return $this
     */
    public function setCaptchaAnswer($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\CaptchaAnswer::class);
        $this->captcha_answer = $var;

        return $this;
    }

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

}

