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

namespace Google\Cloud\RecaptchaEnterprise\V1;

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

/**
 * User information associated with a request protected by reCAPTCHA Enterprise.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.UserInfo</code>
 */
class UserInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Creation time for this account associated with this user. Leave
     * blank for non logged-in actions, guest checkout, or when there is no
     * account associated with the current user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $create_account_time = null;
    /**
     * Optional. For logged-in requests or login/registration requests, the unique
     * account identifier associated with this user. You can use the username if
     * it is stable (meaning it is the same for every request associated with the
     * same user), or any stable user ID of your choice. Leave blank for non
     * logged-in actions or guest checkout.
     *
     * Generated from protobuf field <code>string account_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $account_id = '';
    /**
     * Optional. Identifiers associated with this user or request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $user_ids;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $create_account_time
     *           Optional. Creation time for this account associated with this user. Leave
     *           blank for non logged-in actions, guest checkout, or when there is no
     *           account associated with the current user.
     *     @type string $account_id
     *           Optional. For logged-in requests or login/registration requests, the unique
     *           account identifier associated with this user. You can use the username if
     *           it is stable (meaning it is the same for every request associated with the
     *           same user), or any stable user ID of your choice. Leave blank for non
     *           logged-in actions or guest checkout.
     *     @type array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $user_ids
     *           Optional. Identifiers associated with this user or request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Creation time for this account associated with this user. Leave
     * blank for non logged-in actions, guest checkout, or when there is no
     * account associated with the current user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateAccountTime()
    {
        return $this->create_account_time;
    }

    public function hasCreateAccountTime()
    {
        return isset($this->create_account_time);
    }

    public function clearCreateAccountTime()
    {
        unset($this->create_account_time);
    }

    /**
     * Optional. Creation time for this account associated with this user. Leave
     * blank for non logged-in actions, guest checkout, or when there is no
     * account associated with the current user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_account_time = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateAccountTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_account_time = $var;

        return $this;
    }

    /**
     * Optional. For logged-in requests or login/registration requests, the unique
     * account identifier associated with this user. You can use the username if
     * it is stable (meaning it is the same for every request associated with the
     * same user), or any stable user ID of your choice. Leave blank for non
     * logged-in actions or guest checkout.
     *
     * Generated from protobuf field <code>string account_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAccountId()
    {
        return $this->account_id;
    }

    /**
     * Optional. For logged-in requests or login/registration requests, the unique
     * account identifier associated with this user. You can use the username if
     * it is stable (meaning it is the same for every request associated with the
     * same user), or any stable user ID of your choice. Leave blank for non
     * logged-in actions or guest checkout.
     *
     * Generated from protobuf field <code>string account_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAccountId($var)
    {
        GPBUtil::checkString($var, True);
        $this->account_id = $var;

        return $this;
    }

    /**
     * Optional. Identifiers associated with this user or request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUserIds()
    {
        return $this->user_ids;
    }

    /**
     * Optional. Identifiers associated with this user or request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.UserId user_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\RecaptchaEnterprise\V1\UserId>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUserIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\UserId::class);
        $this->user_ids = $arr;

        return $this;
    }

}

