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

namespace Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores;

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

/**
 * Image Quality Defects
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect</code>
 */
class DetectedDefect extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the defect type. Supported values are:
     * - `quality/defect_blurry`
     * - `quality/defect_noisy`
     * - `quality/defect_dark`
     * - `quality/defect_faint`
     * - `quality/defect_text_too_small`
     * - `quality/defect_document_cutoff`
     * - `quality/defect_text_cutoff`
     * - `quality/defect_glare`
     *
     * Generated from protobuf field <code>string type = 1;</code>
     */
    private $type = '';
    /**
     * Confidence of detected defect. Range `[0, 1]` where 1 indicates
     * strong confidence of that the defect exists.
     *
     * Generated from protobuf field <code>float confidence = 2;</code>
     */
    private $confidence = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $type
     *           Name of the defect type. Supported values are:
     *           - `quality/defect_blurry`
     *           - `quality/defect_noisy`
     *           - `quality/defect_dark`
     *           - `quality/defect_faint`
     *           - `quality/defect_text_too_small`
     *           - `quality/defect_document_cutoff`
     *           - `quality/defect_text_cutoff`
     *           - `quality/defect_glare`
     *     @type float $confidence
     *           Confidence of detected defect. Range `[0, 1]` where 1 indicates
     *           strong confidence of that the defect exists.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the defect type. Supported values are:
     * - `quality/defect_blurry`
     * - `quality/defect_noisy`
     * - `quality/defect_dark`
     * - `quality/defect_faint`
     * - `quality/defect_text_too_small`
     * - `quality/defect_document_cutoff`
     * - `quality/defect_text_cutoff`
     * - `quality/defect_glare`
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Name of the defect type. Supported values are:
     * - `quality/defect_blurry`
     * - `quality/defect_noisy`
     * - `quality/defect_dark`
     * - `quality/defect_faint`
     * - `quality/defect_text_too_small`
     * - `quality/defect_document_cutoff`
     * - `quality/defect_text_cutoff`
     * - `quality/defect_glare`
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * Confidence of detected defect. Range `[0, 1]` where 1 indicates
     * strong confidence of that the defect exists.
     *
     * Generated from protobuf field <code>float confidence = 2;</code>
     * @return float
     */
    public function getConfidence()
    {
        return $this->confidence;
    }

    /**
     * Confidence of detected defect. Range `[0, 1]` where 1 indicates
     * strong confidence of that the defect exists.
     *
     * Generated from protobuf field <code>float confidence = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setConfidence($var)
    {
        GPBUtil::checkFloat($var);
        $this->confidence = $var;

        return $this;
    }

}


