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

/**
 * Specifies the location of a transformation.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.TransformationLocation</code>
 */
class TransformationLocation extends \Google\Protobuf\Internal\Message
{
    /**
     * Information about the functionality of the container where this finding
     * occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationContainerType container_type = 3;</code>
     */
    private $container_type = 0;
    protected $location_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $finding_id
     *           For infotype transformations, link to the corresponding findings ID so
     *           that location information does not need to be duplicated. Each findings
     *           ID correlates to an entry in the findings output table, this table only
     *           gets created when users specify to save findings (add the save findings
     *           action to the request).
     *     @type \Google\Cloud\Dlp\V2\RecordTransformation $record_transformation
     *           For record transformations, provide a field and container information.
     *     @type int $container_type
     *           Information about the functionality of the container where this finding
     *           occurred, if available.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * For infotype transformations, link to the corresponding findings ID so
     * that location information does not need to be duplicated. Each findings
     * ID correlates to an entry in the findings output table, this table only
     * gets created when users specify to save findings (add the save findings
     * action to the request).
     *
     * Generated from protobuf field <code>string finding_id = 1;</code>
     * @return string
     */
    public function getFindingId()
    {
        return $this->readOneof(1);
    }

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

    /**
     * For infotype transformations, link to the corresponding findings ID so
     * that location information does not need to be duplicated. Each findings
     * ID correlates to an entry in the findings output table, this table only
     * gets created when users specify to save findings (add the save findings
     * action to the request).
     *
     * Generated from protobuf field <code>string finding_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setFindingId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * For record transformations, provide a field and container information.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordTransformation record_transformation = 2;</code>
     * @return \Google\Cloud\Dlp\V2\RecordTransformation|null
     */
    public function getRecordTransformation()
    {
        return $this->readOneof(2);
    }

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

    /**
     * For record transformations, provide a field and container information.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordTransformation record_transformation = 2;</code>
     * @param \Google\Cloud\Dlp\V2\RecordTransformation $var
     * @return $this
     */
    public function setRecordTransformation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordTransformation::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Information about the functionality of the container where this finding
     * occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationContainerType container_type = 3;</code>
     * @return int
     */
    public function getContainerType()
    {
        return $this->container_type;
    }

    /**
     * Information about the functionality of the container where this finding
     * occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.TransformationContainerType container_type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setContainerType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\TransformationContainerType::class);
        $this->container_type = $var;

        return $this;
    }

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

}

