<?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;

/**
 * A flattened description of a `PrimitiveTransformation` or
 * `RecordSuppression`.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.TransformationDescription</code>
 */
class TransformationDescription extends \Google\Protobuf\Internal\Message
{
    /**
     * The transformation type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationType type = 1;</code>
     */
    private $type = 0;
    /**
     * A description of the transformation. This is empty for a
     * RECORD_SUPPRESSION, or is the output of calling toString() on the
     * `PrimitiveTransformation` protocol buffer message for any other type of
     * transformation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     */
    private $description = '';
    /**
     * A human-readable string representation of the `RecordCondition`
     * corresponding to this transformation. Set if a `RecordCondition` was used
     * to determine whether or not to apply this transformation.
     * Examples:
     *     * (age_field > 85)
     *     * (age_field <= 18)
     *     * (zip_field exists)
     *     * (zip_field == 01234) && (city_field != "Springville")
     *     * (zip_field == 01234) && (age_field <= 18) && (city_field exists)
     *
     * Generated from protobuf field <code>string condition = 3;</code>
     */
    private $condition = '';
    /**
     * Set if the transformation was limited to a specific `InfoType`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.InfoType info_type = 4;</code>
     */
    private $info_type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           The transformation type.
     *     @type string $description
     *           A description of the transformation. This is empty for a
     *           RECORD_SUPPRESSION, or is the output of calling toString() on the
     *           `PrimitiveTransformation` protocol buffer message for any other type of
     *           transformation.
     *     @type string $condition
     *           A human-readable string representation of the `RecordCondition`
     *           corresponding to this transformation. Set if a `RecordCondition` was used
     *           to determine whether or not to apply this transformation.
     *           Examples:
     *               * (age_field > 85)
     *               * (age_field <= 18)
     *               * (zip_field exists)
     *               * (zip_field == 01234) && (city_field != "Springville")
     *               * (zip_field == 01234) && (age_field <= 18) && (city_field exists)
     *     @type \Google\Cloud\Dlp\V2\InfoType $info_type
     *           Set if the transformation was limited to a specific `InfoType`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * The transformation type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationType type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The transformation type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationType type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\TransformationType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * A description of the transformation. This is empty for a
     * RECORD_SUPPRESSION, or is the output of calling toString() on the
     * `PrimitiveTransformation` protocol buffer message for any other type of
     * transformation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * A description of the transformation. This is empty for a
     * RECORD_SUPPRESSION, or is the output of calling toString() on the
     * `PrimitiveTransformation` protocol buffer message for any other type of
     * transformation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * A human-readable string representation of the `RecordCondition`
     * corresponding to this transformation. Set if a `RecordCondition` was used
     * to determine whether or not to apply this transformation.
     * Examples:
     *     * (age_field > 85)
     *     * (age_field <= 18)
     *     * (zip_field exists)
     *     * (zip_field == 01234) && (city_field != "Springville")
     *     * (zip_field == 01234) && (age_field <= 18) && (city_field exists)
     *
     * Generated from protobuf field <code>string condition = 3;</code>
     * @return string
     */
    public function getCondition()
    {
        return $this->condition;
    }

    /**
     * A human-readable string representation of the `RecordCondition`
     * corresponding to this transformation. Set if a `RecordCondition` was used
     * to determine whether or not to apply this transformation.
     * Examples:
     *     * (age_field > 85)
     *     * (age_field <= 18)
     *     * (zip_field exists)
     *     * (zip_field == 01234) && (city_field != "Springville")
     *     * (zip_field == 01234) && (age_field <= 18) && (city_field exists)
     *
     * Generated from protobuf field <code>string condition = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCondition($var)
    {
        GPBUtil::checkString($var, True);
        $this->condition = $var;

        return $this;
    }

    /**
     * Set if the transformation was limited to a specific `InfoType`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.InfoType info_type = 4;</code>
     * @return \Google\Cloud\Dlp\V2\InfoType|null
     */
    public function getInfoType()
    {
        return $this->info_type;
    }

    public function hasInfoType()
    {
        return isset($this->info_type);
    }

    public function clearInfoType()
    {
        unset($this->info_type);
    }

    /**
     * Set if the transformation was limited to a specific `InfoType`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.InfoType info_type = 4;</code>
     * @param \Google\Cloud\Dlp\V2\InfoType $var
     * @return $this
     */
    public function setInfoType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\InfoType::class);
        $this->info_type = $var;

        return $this;
    }

}

