Copied!
<?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;

/**
 * The request message to annotate an Assessment.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest</code>
 */
class AnnotateAssessmentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the Assessment, in the format
     * `projects/{project}/assessments/{assessment}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. The annotation that is assigned to the Event. This field can be
     * left empty to provide reasons that apply to an event without concluding
     * whether the event is legitimate or fraudulent.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $annotation = 0;
    /**
     * Optional. Reasons for the annotation that are assigned to the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $reasons;
    /**
     * Optional. A stable account identifier to apply to the assessment. This is
     * an alternative to setting `account_id` in `CreateAssessment`, for example
     * when a stable account identifier is not yet known in the initial request.
     *
     * Generated from protobuf field <code>string account_id = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $account_id = '';
    /**
     * Optional. A stable hashed account identifier to apply to the assessment.
     * This is an alternative to setting `hashed_account_id` in
     * `CreateAssessment`, for example when a stable account identifier is not yet
     * known in the initial request.
     *
     * Generated from protobuf field <code>bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $hashed_account_id = '';
    /**
     * Optional. If the assessment is part of a payment transaction, provide
     * details on payment lifecycle events that occur in the transaction.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $transaction_event = null;
    /**
     * Optional. If using an external multi-factor authentication provider,
     * provide phone authentication details for fraud detection purposes.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEvent phone_authentication_event = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $phone_authentication_event = null;

    /**
     * @param string $name       Required. The resource name of the Assessment, in the format
     *                           `projects/{project}/assessments/{assessment}`. Please see
     *                           {@see RecaptchaEnterpriseServiceClient::assessmentName()} for help formatting this field.
     * @param int    $annotation Optional. The annotation that is assigned to the Event. This field can be
     *                           left empty to provide reasons that apply to an event without concluding
     *                           whether the event is legitimate or fraudulent.
     *                           For allowed values, use constants defined on {@see \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation}
     *
     * @return \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest
     *
     * @experimental
     */
    public static function build(string $name, int $annotation): self
    {
        return (new self())
            ->setName($name)
            ->setAnnotation($annotation);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The resource name of the Assessment, in the format
     *           `projects/{project}/assessments/{assessment}`.
     *     @type int $annotation
     *           Optional. The annotation that is assigned to the Event. This field can be
     *           left empty to provide reasons that apply to an event without concluding
     *           whether the event is legitimate or fraudulent.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $reasons
     *           Optional. Reasons for the annotation that are assigned to the event.
     *     @type string $account_id
     *           Optional. A stable account identifier to apply to the assessment. This is
     *           an alternative to setting `account_id` in `CreateAssessment`, for example
     *           when a stable account identifier is not yet known in the initial request.
     *     @type string $hashed_account_id
     *           Optional. A stable hashed account identifier to apply to the assessment.
     *           This is an alternative to setting `hashed_account_id` in
     *           `CreateAssessment`, for example when a stable account identifier is not yet
     *           known in the initial request.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $transaction_event
     *           Optional. If the assessment is part of a payment transaction, provide
     *           details on payment lifecycle events that occur in the transaction.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\PhoneAuthenticationEvent $phone_authentication_event
     *           Optional. If using an external multi-factor authentication provider,
     *           provide phone authentication details for fraud detection purposes.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the Assessment, in the format
     * `projects/{project}/assessments/{assessment}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The resource name of the Assessment, in the format
     * `projects/{project}/assessments/{assessment}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The annotation that is assigned to the Event. This field can be
     * left empty to provide reasons that apply to an event without concluding
     * whether the event is legitimate or fraudulent.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getAnnotation()
    {
        return $this->annotation;
    }

    /**
     * Optional. The annotation that is assigned to the Event. This field can be
     * left empty to provide reasons that apply to an event without concluding
     * whether the event is legitimate or fraudulent.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setAnnotation($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Annotation::class);
        $this->annotation = $var;

        return $this;
    }

    /**
     * Optional. Reasons for the annotation that are assigned to the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getReasons()
    {
        return $this->reasons;
    }

    /**
     * Optional. Reasons for the annotation that are assigned to the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setReasons($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest\Reason::class);
        $this->reasons = $arr;

        return $this;
    }

    /**
     * Optional. A stable account identifier to apply to the assessment. This is
     * an alternative to setting `account_id` in `CreateAssessment`, for example
     * when a stable account identifier is not yet known in the initial request.
     *
     * Generated from protobuf field <code>string account_id = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAccountId()
    {
        return $this->account_id;
    }

    /**
     * Optional. A stable account identifier to apply to the assessment. This is
     * an alternative to setting `account_id` in `CreateAssessment`, for example
     * when a stable account identifier is not yet known in the initial request.
     *
     * Generated from protobuf field <code>string account_id = 7 [(.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. A stable hashed account identifier to apply to the assessment.
     * This is an alternative to setting `hashed_account_id` in
     * `CreateAssessment`, for example when a stable account identifier is not yet
     * known in the initial request.
     *
     * Generated from protobuf field <code>bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getHashedAccountId()
    {
        return $this->hashed_account_id;
    }

    /**
     * Optional. A stable hashed account identifier to apply to the assessment.
     * This is an alternative to setting `hashed_account_id` in
     * `CreateAssessment`, for example when a stable account identifier is not yet
     * known in the initial request.
     *
     * Generated from protobuf field <code>bytes hashed_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setHashedAccountId($var)
    {
        GPBUtil::checkString($var, False);
        $this->hashed_account_id = $var;

        return $this;
    }

    /**
     * Optional. If the assessment is part of a payment transaction, provide
     * details on payment lifecycle events that occur in the transaction.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent|null
     */
    public function getTransactionEvent()
    {
        return $this->transaction_event;
    }

    public function hasTransactionEvent()
    {
        return isset($this->transaction_event);
    }

    public function clearTransactionEvent()
    {
        unset($this->transaction_event);
    }

    /**
     * Optional. If the assessment is part of a payment transaction, provide
     * details on payment lifecycle events that occur in the transaction.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TransactionEvent transaction_event = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent $var
     * @return $this
     */
    public function setTransactionEvent($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TransactionEvent::class);
        $this->transaction_event = $var;

        return $this;
    }

    /**
     * Optional. If using an external multi-factor authentication provider,
     * provide phone authentication details for fraud detection purposes.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEvent phone_authentication_event = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\PhoneAuthenticationEvent|null
     */
    public function getPhoneAuthenticationEvent()
    {
        return $this->phone_authentication_event;
    }

    public function hasPhoneAuthenticationEvent()
    {
        return isset($this->phone_authentication_event);
    }

    public function clearPhoneAuthenticationEvent()
    {
        unset($this->phone_authentication_event);
    }

    /**
     * Optional. If using an external multi-factor authentication provider,
     * provide phone authentication details for fraud detection purposes.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEvent phone_authentication_event = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\PhoneAuthenticationEvent $var
     * @return $this
     */
    public function setPhoneAuthenticationEvent($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\PhoneAuthenticationEvent::class);
        $this->phone_authentication_event = $var;

        return $this;
    }

}

© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration