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

namespace Google\Cloud\ModelArmor\V1beta;

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

/**
 * Responsible AI Result.
 *
 * Generated from protobuf message <code>google.cloud.modelarmor.v1beta.RaiFilterResult</code>
 */
class RaiFilterResult extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Reports whether the RAI filter was successfully executed or
     * not.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterExecutionState execution_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $execution_state = 0;
    /**
     * Optional messages corresponding to the result.
     * A message can provide warnings or error details.
     * For example, if execution state is skipped then this field provides
     * related reason/explanation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.modelarmor.v1beta.MessageItem message_items = 2;</code>
     */
    private $message_items;
    /**
     * Output only. Overall filter match state for RAI.
     * Value is MATCH_FOUND if at least one RAI filter confidence level is
     * equal to or higher than the confidence level defined in configuration.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterMatchState match_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $match_state = 0;
    /**
     * The map of RAI filter results where key is RAI filter type - either of
     * "sexually_explicit", "hate_speech", "harassment", "dangerous".
     *
     * Generated from protobuf field <code>map<string, .google.cloud.modelarmor.v1beta.RaiFilterResult.RaiFilterTypeResult> rai_filter_type_results = 4;</code>
     */
    private $rai_filter_type_results;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $execution_state
     *           Output only. Reports whether the RAI filter was successfully executed or
     *           not.
     *     @type array<\Google\Cloud\ModelArmor\V1beta\MessageItem>|\Google\Protobuf\Internal\RepeatedField $message_items
     *           Optional messages corresponding to the result.
     *           A message can provide warnings or error details.
     *           For example, if execution state is skipped then this field provides
     *           related reason/explanation.
     *     @type int $match_state
     *           Output only. Overall filter match state for RAI.
     *           Value is MATCH_FOUND if at least one RAI filter confidence level is
     *           equal to or higher than the confidence level defined in configuration.
     *     @type array|\Google\Protobuf\Internal\MapField $rai_filter_type_results
     *           The map of RAI filter results where key is RAI filter type - either of
     *           "sexually_explicit", "hate_speech", "harassment", "dangerous".
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Modelarmor\V1Beta\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Reports whether the RAI filter was successfully executed or
     * not.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterExecutionState execution_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getExecutionState()
    {
        return $this->execution_state;
    }

    /**
     * Output only. Reports whether the RAI filter was successfully executed or
     * not.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterExecutionState execution_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setExecutionState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ModelArmor\V1beta\FilterExecutionState::class);
        $this->execution_state = $var;

        return $this;
    }

    /**
     * Optional messages corresponding to the result.
     * A message can provide warnings or error details.
     * For example, if execution state is skipped then this field provides
     * related reason/explanation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.modelarmor.v1beta.MessageItem message_items = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMessageItems()
    {
        return $this->message_items;
    }

    /**
     * Optional messages corresponding to the result.
     * A message can provide warnings or error details.
     * For example, if execution state is skipped then this field provides
     * related reason/explanation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.modelarmor.v1beta.MessageItem message_items = 2;</code>
     * @param array<\Google\Cloud\ModelArmor\V1beta\MessageItem>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMessageItems($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ModelArmor\V1beta\MessageItem::class);
        $this->message_items = $arr;

        return $this;
    }

    /**
     * Output only. Overall filter match state for RAI.
     * Value is MATCH_FOUND if at least one RAI filter confidence level is
     * equal to or higher than the confidence level defined in configuration.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterMatchState match_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getMatchState()
    {
        return $this->match_state;
    }

    /**
     * Output only. Overall filter match state for RAI.
     * Value is MATCH_FOUND if at least one RAI filter confidence level is
     * equal to or higher than the confidence level defined in configuration.
     *
     * Generated from protobuf field <code>.google.cloud.modelarmor.v1beta.FilterMatchState match_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setMatchState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ModelArmor\V1beta\FilterMatchState::class);
        $this->match_state = $var;

        return $this;
    }

    /**
     * The map of RAI filter results where key is RAI filter type - either of
     * "sexually_explicit", "hate_speech", "harassment", "dangerous".
     *
     * Generated from protobuf field <code>map<string, .google.cloud.modelarmor.v1beta.RaiFilterResult.RaiFilterTypeResult> rai_filter_type_results = 4;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getRaiFilterTypeResults()
    {
        return $this->rai_filter_type_results;
    }

    /**
     * The map of RAI filter results where key is RAI filter type - either of
     * "sexually_explicit", "hate_speech", "harassment", "dangerous".
     *
     * Generated from protobuf field <code>map<string, .google.cloud.modelarmor.v1beta.RaiFilterResult.RaiFilterTypeResult> rai_filter_type_results = 4;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setRaiFilterTypeResults($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ModelArmor\V1beta\RaiFilterResult\RaiFilterTypeResult::class);
        $this->rai_filter_type_results = $arr;

        return $this;
    }

}

