<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto

namespace Google\Cloud\RecaptchaEnterprise\V1\TransactionData;

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

/**
 * Details about a user's account involved in the transaction.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.TransactionData.User</code>
 */
class User extends \Google\Protobuf\Internal\Message
{
    /**
     * Unique account identifier for this user. If using account defender,
     * this should match the hashed_account_id field. Otherwise, a unique and
     * persistent identifier for this account.
     *
     * Generated from protobuf field <code>string account_id = 6;</code>
     */
    private $account_id = '';
    /**
     * The epoch milliseconds of the user's account creation.
     *
     * Generated from protobuf field <code>int64 creation_ms = 1;</code>
     */
    private $creation_ms = 0;
    /**
     * The email address of the user.
     *
     * Generated from protobuf field <code>string email = 2;</code>
     */
    private $email = '';
    /**
     * Whether the email has been verified to be accessible by the user (OTP or
     * similar).
     *
     * Generated from protobuf field <code>bool email_verified = 3;</code>
     */
    private $email_verified = false;
    /**
     * The phone number of the user, with country code.
     *
     * Generated from protobuf field <code>string phone_number = 4;</code>
     */
    private $phone_number = '';
    /**
     * Whether the phone number has been verified to be accessible by the user
     * (OTP or similar).
     *
     * Generated from protobuf field <code>bool phone_verified = 5;</code>
     */
    private $phone_verified = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $account_id
     *           Unique account identifier for this user. If using account defender,
     *           this should match the hashed_account_id field. Otherwise, a unique and
     *           persistent identifier for this account.
     *     @type int|string $creation_ms
     *           The epoch milliseconds of the user's account creation.
     *     @type string $email
     *           The email address of the user.
     *     @type bool $email_verified
     *           Whether the email has been verified to be accessible by the user (OTP or
     *           similar).
     *     @type string $phone_number
     *           The phone number of the user, with country code.
     *     @type bool $phone_verified
     *           Whether the phone number has been verified to be accessible by the user
     *           (OTP or similar).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Unique account identifier for this user. If using account defender,
     * this should match the hashed_account_id field. Otherwise, a unique and
     * persistent identifier for this account.
     *
     * Generated from protobuf field <code>string account_id = 6;</code>
     * @return string
     */
    public function getAccountId()
    {
        return $this->account_id;
    }

    /**
     * Unique account identifier for this user. If using account defender,
     * this should match the hashed_account_id field. Otherwise, a unique and
     * persistent identifier for this account.
     *
     * Generated from protobuf field <code>string account_id = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setAccountId($var)
    {
        GPBUtil::checkString($var, True);
        $this->account_id = $var;

        return $this;
    }

    /**
     * The epoch milliseconds of the user's account creation.
     *
     * Generated from protobuf field <code>int64 creation_ms = 1;</code>
     * @return int|string
     */
    public function getCreationMs()
    {
        return $this->creation_ms;
    }

    /**
     * The epoch milliseconds of the user's account creation.
     *
     * Generated from protobuf field <code>int64 creation_ms = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCreationMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->creation_ms = $var;

        return $this;
    }

    /**
     * The email address of the user.
     *
     * Generated from protobuf field <code>string email = 2;</code>
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * The email address of the user.
     *
     * Generated from protobuf field <code>string email = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setEmail($var)
    {
        GPBUtil::checkString($var, True);
        $this->email = $var;

        return $this;
    }

    /**
     * Whether the email has been verified to be accessible by the user (OTP or
     * similar).
     *
     * Generated from protobuf field <code>bool email_verified = 3;</code>
     * @return bool
     */
    public function getEmailVerified()
    {
        return $this->email_verified;
    }

    /**
     * Whether the email has been verified to be accessible by the user (OTP or
     * similar).
     *
     * Generated from protobuf field <code>bool email_verified = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setEmailVerified($var)
    {
        GPBUtil::checkBool($var);
        $this->email_verified = $var;

        return $this;
    }

    /**
     * The phone number of the user, with country code.
     *
     * Generated from protobuf field <code>string phone_number = 4;</code>
     * @return string
     */
    public function getPhoneNumber()
    {
        return $this->phone_number;
    }

    /**
     * The phone number of the user, with country code.
     *
     * Generated from protobuf field <code>string phone_number = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setPhoneNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->phone_number = $var;

        return $this;
    }

    /**
     * Whether the phone number has been verified to be accessible by the user
     * (OTP or similar).
     *
     * Generated from protobuf field <code>bool phone_verified = 5;</code>
     * @return bool
     */
    public function getPhoneVerified()
    {
        return $this->phone_verified;
    }

    /**
     * Whether the phone number has been verified to be accessible by the user
     * (OTP or similar).
     *
     * Generated from protobuf field <code>bool phone_verified = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setPhoneVerified($var)
    {
        GPBUtil::checkBool($var);
        $this->phone_verified = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(User::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_User::class);

