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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents a single validation error.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.ValidationError</code>
 */
class ValidationError extends \Google\Protobuf\Internal\Message
{
    /**
     * The severity of the error.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ValidationError.Severity severity = 1;</code>
     */
    private $severity = 0;
    /**
     * The names of the entries that the error is associated with.
     * Format:
     * - "projects/<Project ID>/agent", if the error is associated with the entire
     * agent.
     * - "projects/<Project ID>/agent/intents/<Intent ID>", if the error is
     * associated with certain intents.
     * - "projects/<Project
     * ID>/agent/intents/<Intent Id>/trainingPhrases/<Training Phrase ID>", if the
     * error is associated with certain intent training phrases.
     * - "projects/<Project ID>/agent/intents/<Intent Id>/parameters/<Parameter
     * ID>", if the error is associated with certain intent parameters.
     * - "projects/<Project ID>/agent/entities/<Entity ID>", if the error is
     * associated with certain entities.
     *
     * Generated from protobuf field <code>repeated string entries = 3;</code>
     */
    private $entries;
    /**
     * The detailed error message.
     *
     * Generated from protobuf field <code>string error_message = 4;</code>
     */
    private $error_message = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $severity
     *           The severity of the error.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $entries
     *           The names of the entries that the error is associated with.
     *           Format:
     *           - "projects/<Project ID>/agent", if the error is associated with the entire
     *           agent.
     *           - "projects/<Project ID>/agent/intents/<Intent ID>", if the error is
     *           associated with certain intents.
     *           - "projects/<Project
     *           ID>/agent/intents/<Intent Id>/trainingPhrases/<Training Phrase ID>", if the
     *           error is associated with certain intent training phrases.
     *           - "projects/<Project ID>/agent/intents/<Intent Id>/parameters/<Parameter
     *           ID>", if the error is associated with certain intent parameters.
     *           - "projects/<Project ID>/agent/entities/<Entity ID>", if the error is
     *           associated with certain entities.
     *     @type string $error_message
     *           The detailed error message.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\ValidationResult::initOnce();
        parent::__construct($data);
    }

    /**
     * The severity of the error.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ValidationError.Severity severity = 1;</code>
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * The severity of the error.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.ValidationError.Severity severity = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ValidationError\Severity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * The names of the entries that the error is associated with.
     * Format:
     * - "projects/<Project ID>/agent", if the error is associated with the entire
     * agent.
     * - "projects/<Project ID>/agent/intents/<Intent ID>", if the error is
     * associated with certain intents.
     * - "projects/<Project
     * ID>/agent/intents/<Intent Id>/trainingPhrases/<Training Phrase ID>", if the
     * error is associated with certain intent training phrases.
     * - "projects/<Project ID>/agent/intents/<Intent Id>/parameters/<Parameter
     * ID>", if the error is associated with certain intent parameters.
     * - "projects/<Project ID>/agent/entities/<Entity ID>", if the error is
     * associated with certain entities.
     *
     * Generated from protobuf field <code>repeated string entries = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEntries()
    {
        return $this->entries;
    }

    /**
     * The names of the entries that the error is associated with.
     * Format:
     * - "projects/<Project ID>/agent", if the error is associated with the entire
     * agent.
     * - "projects/<Project ID>/agent/intents/<Intent ID>", if the error is
     * associated with certain intents.
     * - "projects/<Project
     * ID>/agent/intents/<Intent Id>/trainingPhrases/<Training Phrase ID>", if the
     * error is associated with certain intent training phrases.
     * - "projects/<Project ID>/agent/intents/<Intent Id>/parameters/<Parameter
     * ID>", if the error is associated with certain intent parameters.
     * - "projects/<Project ID>/agent/entities/<Entity ID>", if the error is
     * associated with certain entities.
     *
     * Generated from protobuf field <code>repeated string entries = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEntries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->entries = $arr;

        return $this;
    }

    /**
     * The detailed error message.
     *
     * Generated from protobuf field <code>string error_message = 4;</code>
     * @return string
     */
    public function getErrorMessage()
    {
        return $this->error_message;
    }

    /**
     * The detailed error message.
     *
     * Generated from protobuf field <code>string error_message = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_message = $var;

        return $this;
    }

}

