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

namespace Google\Cloud\Dlp\V2\ImageTransformations;

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

/**
 * Configuration for determining how redaction of images should occur.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.ImageTransformations.ImageTransformation</code>
 */
class ImageTransformation extends \Google\Protobuf\Internal\Message
{
    /**
     * The color to use when redacting content from an image. If not
     * specified, the default is black.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Color redaction_color = 3;</code>
     */
    private $redaction_color = null;
    protected $target;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\SelectedInfoTypes $selected_info_types
     *           Apply transformation to the selected info_types.
     *     @type \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllInfoTypes $all_info_types
     *           Apply transformation to all findings not specified in other
     *           ImageTransformation's selected_info_types. Only one instance is allowed
     *           within the ImageTransformations message.
     *     @type \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllText $all_text
     *           Apply transformation to all text that doesn't match an infoType. Only
     *           one instance is allowed within the ImageTransformations message.
     *     @type \Google\Cloud\Dlp\V2\Color $redaction_color
     *           The color to use when redacting content from an image. If not
     *           specified, the default is black.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Apply transformation to the selected info_types.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.SelectedInfoTypes selected_info_types = 4;</code>
     * @return \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\SelectedInfoTypes|null
     */
    public function getSelectedInfoTypes()
    {
        return $this->readOneof(4);
    }

    public function hasSelectedInfoTypes()
    {
        return $this->hasOneof(4);
    }

    /**
     * Apply transformation to the selected info_types.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.SelectedInfoTypes selected_info_types = 4;</code>
     * @param \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\SelectedInfoTypes $var
     * @return $this
     */
    public function setSelectedInfoTypes($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\SelectedInfoTypes::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Apply transformation to all findings not specified in other
     * ImageTransformation's selected_info_types. Only one instance is allowed
     * within the ImageTransformations message.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.AllInfoTypes all_info_types = 5;</code>
     * @return \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllInfoTypes|null
     */
    public function getAllInfoTypes()
    {
        return $this->readOneof(5);
    }

    public function hasAllInfoTypes()
    {
        return $this->hasOneof(5);
    }

    /**
     * Apply transformation to all findings not specified in other
     * ImageTransformation's selected_info_types. Only one instance is allowed
     * within the ImageTransformations message.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.AllInfoTypes all_info_types = 5;</code>
     * @param \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllInfoTypes $var
     * @return $this
     */
    public function setAllInfoTypes($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllInfoTypes::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Apply transformation to all text that doesn't match an infoType. Only
     * one instance is allowed within the ImageTransformations message.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.AllText all_text = 6;</code>
     * @return \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllText|null
     */
    public function getAllText()
    {
        return $this->readOneof(6);
    }

    public function hasAllText()
    {
        return $this->hasOneof(6);
    }

    /**
     * Apply transformation to all text that doesn't match an infoType. Only
     * one instance is allowed within the ImageTransformations message.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations.ImageTransformation.AllText all_text = 6;</code>
     * @param \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllText $var
     * @return $this
     */
    public function setAllText($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ImageTransformations\ImageTransformation\AllText::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * The color to use when redacting content from an image. If not
     * specified, the default is black.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Color redaction_color = 3;</code>
     * @return \Google\Cloud\Dlp\V2\Color|null
     */
    public function getRedactionColor()
    {
        return $this->redaction_color;
    }

    public function hasRedactionColor()
    {
        return isset($this->redaction_color);
    }

    public function clearRedactionColor()
    {
        unset($this->redaction_color);
    }

    /**
     * The color to use when redacting content from an image. If not
     * specified, the default is black.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Color redaction_color = 3;</code>
     * @param \Google\Cloud\Dlp\V2\Color $var
     * @return $this
     */
    public function setRedactionColor($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Color::class);
        $this->redaction_color = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getTarget()
    {
        return $this->whichOneof("target");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ImageTransformation::class, \Google\Cloud\Dlp\V2\ImageTransformations_ImageTransformation::class);

