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

namespace Google\Cloud\DiscoveryEngine\V1\RecrawlUrisResponse\FailureInfo;

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

/**
 * Details about why crawling failed for a particular CorpusType, e.g.,
 * DESKTOP and MOBILE crawling may fail for different reasons.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason</code>
 */
class FailureReason extends \Google\Protobuf\Internal\Message
{
    /**
     * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1;</code>
     */
    protected $corpus_type = 0;
    /**
     * Reason why the URI was not crawled.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     */
    protected $error_message = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $corpus_type
     *           DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
     *     @type string $error_message
     *           Reason why the URI was not crawled.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\SiteSearchEngineService::initOnce();
        parent::__construct($data);
    }

    /**
     * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1;</code>
     * @return int
     */
    public function getCorpusType()
    {
        return $this->corpus_type;
    }

    /**
     * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCorpusType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\RecrawlUrisResponse\FailureInfo\FailureReason\CorpusType::class);
        $this->corpus_type = $var;

        return $this;
    }

    /**
     * Reason why the URI was not crawled.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     * @return string
     */
    public function getErrorMessage()
    {
        return $this->error_message;
    }

    /**
     * Reason why the URI was not crawled.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_message = $var;

        return $this;
    }

}

