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

/**
 * Metadata Location
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.MetadataLocation</code>
 */
class MetadataLocation extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of metadata containing the finding.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.MetadataType type = 1;</code>
     */
    private $type = 0;
    protected $label;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Type of metadata containing the finding.
     *     @type \Google\Cloud\Dlp\V2\StorageMetadataLabel $storage_label
     *           Storage metadata.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Type of metadata containing the finding.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.MetadataType type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

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

        return $this;
    }

    /**
     * Storage metadata.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.StorageMetadataLabel storage_label = 3;</code>
     * @return \Google\Cloud\Dlp\V2\StorageMetadataLabel|null
     */
    public function getStorageLabel()
    {
        return $this->readOneof(3);
    }

    public function hasStorageLabel()
    {
        return $this->hasOneof(3);
    }

    /**
     * Storage metadata.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.StorageMetadataLabel storage_label = 3;</code>
     * @param \Google\Cloud\Dlp\V2\StorageMetadataLabel $var
     * @return $this
     */
    public function setStorageLabel($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StorageMetadataLabel::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

