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

namespace Google\Cloud\Dlp\V2;

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

/**
 * The rule to exclude image findings based on spatial relationships with
 * other image findings. For example, exclude an image finding if it overlaps
 * with another image finding.
 * This rule is silently ignored if the content being inspected is not an image.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.ExcludeByImageFindings</code>
 */
class ExcludeByImageFindings extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of image-supported infoTypes—excluding [document
     *  infoTypes](https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference#documents)—to
     *  be used as context for the exclusion rule. A finding is excluded if
     *  its bounding box has the specified spatial relationship (defined by
     *  `image_containment_type`) with a finding of an infoType in this list.
     *  For example, if `InspectionRuleSet.info_types` includes
     *  `OBJECT_TYPE/PERSON` and this `exclusion_rule` specifies `info_types` as
     *  `OBJECT_TYPE/PERSON/PASSPORT` with `image_containment_type` set to
     *  `encloses`, then `OBJECT_TYPE/PERSON` findings will be excluded if they
     *  are fully contained within the bounding box of an
     *  `OBJECT_TYPE/PERSON/PASSPORT` finding.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.InfoType info_types = 1;</code>
     */
    private $info_types;
    /**
     * Specifies the required spatial relationship between the bounding boxes
     * of the target finding and the context infoType findings.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageContainmentType image_containment_type = 2;</code>
     */
    protected $image_containment_type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\InfoType[] $info_types
     *           A list of image-supported infoTypes—excluding [document
     *            infoTypes](https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference#documents)—to
     *            be used as context for the exclusion rule. A finding is excluded if
     *            its bounding box has the specified spatial relationship (defined by
     *            `image_containment_type`) with a finding of an infoType in this list.
     *            For example, if `InspectionRuleSet.info_types` includes
     *            `OBJECT_TYPE/PERSON` and this `exclusion_rule` specifies `info_types` as
     *            `OBJECT_TYPE/PERSON/PASSPORT` with `image_containment_type` set to
     *            `encloses`, then `OBJECT_TYPE/PERSON` findings will be excluded if they
     *            are fully contained within the bounding box of an
     *            `OBJECT_TYPE/PERSON/PASSPORT` finding.
     *     @type \Google\Cloud\Dlp\V2\ImageContainmentType $image_containment_type
     *           Specifies the required spatial relationship between the bounding boxes
     *           of the target finding and the context infoType findings.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of image-supported infoTypes—excluding [document
     *  infoTypes](https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference#documents)—to
     *  be used as context for the exclusion rule. A finding is excluded if
     *  its bounding box has the specified spatial relationship (defined by
     *  `image_containment_type`) with a finding of an infoType in this list.
     *  For example, if `InspectionRuleSet.info_types` includes
     *  `OBJECT_TYPE/PERSON` and this `exclusion_rule` specifies `info_types` as
     *  `OBJECT_TYPE/PERSON/PASSPORT` with `image_containment_type` set to
     *  `encloses`, then `OBJECT_TYPE/PERSON` findings will be excluded if they
     *  are fully contained within the bounding box of an
     *  `OBJECT_TYPE/PERSON/PASSPORT` finding.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.InfoType info_types = 1;</code>
     * @return RepeatedField<\Google\Cloud\Dlp\V2\InfoType>
     */
    public function getInfoTypes()
    {
        return $this->info_types;
    }

    /**
     * A list of image-supported infoTypes—excluding [document
     *  infoTypes](https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference#documents)—to
     *  be used as context for the exclusion rule. A finding is excluded if
     *  its bounding box has the specified spatial relationship (defined by
     *  `image_containment_type`) with a finding of an infoType in this list.
     *  For example, if `InspectionRuleSet.info_types` includes
     *  `OBJECT_TYPE/PERSON` and this `exclusion_rule` specifies `info_types` as
     *  `OBJECT_TYPE/PERSON/PASSPORT` with `image_containment_type` set to
     *  `encloses`, then `OBJECT_TYPE/PERSON` findings will be excluded if they
     *  are fully contained within the bounding box of an
     *  `OBJECT_TYPE/PERSON/PASSPORT` finding.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.InfoType info_types = 1;</code>
     * @param \Google\Cloud\Dlp\V2\InfoType[] $var
     * @return $this
     */
    public function setInfoTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\InfoType::class);
        $this->info_types = $arr;

        return $this;
    }

    /**
     * Specifies the required spatial relationship between the bounding boxes
     * of the target finding and the context infoType findings.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageContainmentType image_containment_type = 2;</code>
     * @return \Google\Cloud\Dlp\V2\ImageContainmentType|null
     */
    public function getImageContainmentType()
    {
        return $this->image_containment_type;
    }

    public function hasImageContainmentType()
    {
        return isset($this->image_containment_type);
    }

    public function clearImageContainmentType()
    {
        unset($this->image_containment_type);
    }

    /**
     * Specifies the required spatial relationship between the bounding boxes
     * of the target finding and the context infoType findings.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageContainmentType image_containment_type = 2;</code>
     * @param \Google\Cloud\Dlp\V2\ImageContainmentType $var
     * @return $this
     */
    public function setImageContainmentType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ImageContainmentType::class);
        $this->image_containment_type = $var;

        return $this;
    }

}

