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

namespace Keyapis\User\V1;

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

/**
 * Запрос частичного обновления пользователя
 *
 * Generated from protobuf message <code>keyapis.user.v1.PatchUserRequest</code>
 */
class PatchUserRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = 0;
    /**
     * Номер телефона.
     * # Паттерн: /^(\+7\d{10})$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue phone_number = 2;</code>
     */
    protected $phone_number = null;
    /**
     * Электронная почта.
     * # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue email = 3;</code>
     */
    protected $email = null;
    /**
     * Логин.
     * # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login = 4;</code>
     */
    protected $login = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор.
     *           # Диапазон: 1..2147483647
     *     @type \Google\Protobuf\StringValue $phone_number
     *           Номер телефона.
     *           # Паттерн: /^(\+7\d{10})$/
     *     @type \Google\Protobuf\StringValue $email
     *           Электронная почта.
     *           # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *     @type \Google\Protobuf\StringValue $login
     *           Логин.
     *           # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\User\V1\KeyapisUserUserV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Номер телефона.
     * # Паттерн: /^(\+7\d{10})$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue phone_number = 2;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getPhoneNumber()
    {
        return $this->phone_number;
    }

    public function hasPhoneNumber()
    {
        return isset($this->phone_number);
    }

    public function clearPhoneNumber()
    {
        unset($this->phone_number);
    }

    /**
     * Returns the unboxed value from <code>getPhoneNumber()</code>

     * Номер телефона.
     * # Паттерн: /^(\+7\d{10})$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue phone_number = 2;</code>
     * @return string|null
     */
    public function getPhoneNumberUnwrapped()
    {
        return $this->readWrapperValue("phone_number");
    }

    /**
     * Номер телефона.
     * # Паттерн: /^(\+7\d{10})$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue phone_number = 2;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setPhoneNumber($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->phone_number = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Номер телефона.
     * # Паттерн: /^(\+7\d{10})$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue phone_number = 2;</code>
     * @param string|null $var
     * @return $this
     */
    public function setPhoneNumberUnwrapped($var)
    {
        $this->writeWrapperValue("phone_number", $var);
        return $this;}

    /**
     * Электронная почта.
     * # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue email = 3;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getEmail()
    {
        return $this->email;
    }

    public function hasEmail()
    {
        return isset($this->email);
    }

    public function clearEmail()
    {
        unset($this->email);
    }

    /**
     * Returns the unboxed value from <code>getEmail()</code>

     * Электронная почта.
     * # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue email = 3;</code>
     * @return string|null
     */
    public function getEmailUnwrapped()
    {
        return $this->readWrapperValue("email");
    }

    /**
     * Электронная почта.
     * # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue email = 3;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setEmail($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->email = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Электронная почта.
     * # Паттерн: /^[A-Za-z0-9._%+-]+&#64;[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue email = 3;</code>
     * @param string|null $var
     * @return $this
     */
    public function setEmailUnwrapped($var)
    {
        $this->writeWrapperValue("email", $var);
        return $this;}

    /**
     * Логин.
     * # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login = 4;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getLogin()
    {
        return $this->login;
    }

    public function hasLogin()
    {
        return isset($this->login);
    }

    public function clearLogin()
    {
        unset($this->login);
    }

    /**
     * Returns the unboxed value from <code>getLogin()</code>

     * Логин.
     * # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login = 4;</code>
     * @return string|null
     */
    public function getLoginUnwrapped()
    {
        return $this->readWrapperValue("login");
    }

    /**
     * Логин.
     * # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login = 4;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setLogin($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->login = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Логин.
     * # Паттерн: /^[A-Za-z0-9._-]{3,64}$/
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login = 4;</code>
     * @param string|null $var
     * @return $this
     */
    public function setLoginUnwrapped($var)
    {
        $this->writeWrapperValue("login", $var);
        return $this;}

}

