<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The configuration that controls how the data will change.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DeidentifyConfig</code>
 */
class DeidentifyConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Mode for handling transformation errors. If left unspecified, the default
     * mode is `TransformationErrorHandling.ThrowError`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationErrorHandling transformation_error_handling = 3;</code>
     */
    private $transformation_error_handling = null;
    protected $transformation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\InfoTypeTransformations $info_type_transformations
     *           Treat the dataset as free-form text and apply the same free text
     *           transformation everywhere.
     *     @type \Google\Cloud\Dlp\V2\RecordTransformations $record_transformations
     *           Treat the dataset as structured. Transformations can be applied to
     *           specific locations within structured datasets, such as transforming
     *           a column within a table.
     *     @type \Google\Cloud\Dlp\V2\ImageTransformations $image_transformations
     *           Treat the dataset as an image and redact.
     *     @type \Google\Cloud\Dlp\V2\TransformationErrorHandling $transformation_error_handling
     *           Mode for handling transformation errors. If left unspecified, the default
     *           mode is `TransformationErrorHandling.ThrowError`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     * @return \Google\Cloud\Dlp\V2\InfoTypeTransformations|null
     */
    public function getInfoTypeTransformations()
    {
        return $this->readOneof(1);
    }

    public function hasInfoTypeTransformations()
    {
        return $this->hasOneof(1);
    }

    /**
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     * @param \Google\Cloud\Dlp\V2\InfoTypeTransformations $var
     * @return $this
     */
    public function setInfoTypeTransformations($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\InfoTypeTransformations::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     * @return \Google\Cloud\Dlp\V2\RecordTransformations|null
     */
    public function getRecordTransformations()
    {
        return $this->readOneof(2);
    }

    public function hasRecordTransformations()
    {
        return $this->hasOneof(2);
    }

    /**
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     * @param \Google\Cloud\Dlp\V2\RecordTransformations $var
     * @return $this
     */
    public function setRecordTransformations($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordTransformations::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Treat the dataset as an image and redact.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations image_transformations = 4;</code>
     * @return \Google\Cloud\Dlp\V2\ImageTransformations|null
     */
    public function getImageTransformations()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Treat the dataset as an image and redact.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ImageTransformations image_transformations = 4;</code>
     * @param \Google\Cloud\Dlp\V2\ImageTransformations $var
     * @return $this
     */
    public function setImageTransformations($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ImageTransformations::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Mode for handling transformation errors. If left unspecified, the default
     * mode is `TransformationErrorHandling.ThrowError`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationErrorHandling transformation_error_handling = 3;</code>
     * @return \Google\Cloud\Dlp\V2\TransformationErrorHandling|null
     */
    public function getTransformationErrorHandling()
    {
        return $this->transformation_error_handling;
    }

    public function hasTransformationErrorHandling()
    {
        return isset($this->transformation_error_handling);
    }

    public function clearTransformationErrorHandling()
    {
        unset($this->transformation_error_handling);
    }

    /**
     * Mode for handling transformation errors. If left unspecified, the default
     * mode is `TransformationErrorHandling.ThrowError`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationErrorHandling transformation_error_handling = 3;</code>
     * @param \Google\Cloud\Dlp\V2\TransformationErrorHandling $var
     * @return $this
     */
    public function setTransformationErrorHandling($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\TransformationErrorHandling::class);
        $this->transformation_error_handling = $var;

        return $this;
    }

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

}

