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

/**
 * StoredInfoType resource message that contains information about the current
 * version and any pending updates.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.StoredInfoType</code>
 */
class StoredInfoType extends \Google\Protobuf\Internal\Message
{
    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Current version of the stored info type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2;</code>
     */
    private $current_version = null;
    /**
     * Pending versions of the stored info type. Empty if no versions are
     * pending.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3;</code>
     */
    private $pending_versions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Resource name.
     *     @type \Google\Cloud\Dlp\V2\StoredInfoTypeVersion $current_version
     *           Current version of the stored info type.
     *     @type \Google\Cloud\Dlp\V2\StoredInfoTypeVersion[]|\Google\Protobuf\Internal\RepeatedField $pending_versions
     *           Pending versions of the stored info type. Empty if no versions are
     *           pending.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Current version of the stored info type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2;</code>
     * @return \Google\Cloud\Dlp\V2\StoredInfoTypeVersion|null
     */
    public function getCurrentVersion()
    {
        return isset($this->current_version) ? $this->current_version : null;
    }

    public function hasCurrentVersion()
    {
        return isset($this->current_version);
    }

    public function clearCurrentVersion()
    {
        unset($this->current_version);
    }

    /**
     * Current version of the stored info type.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2;</code>
     * @param \Google\Cloud\Dlp\V2\StoredInfoTypeVersion $var
     * @return $this
     */
    public function setCurrentVersion($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
        $this->current_version = $var;

        return $this;
    }

    /**
     * Pending versions of the stored info type. Empty if no versions are
     * pending.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPendingVersions()
    {
        return $this->pending_versions;
    }

    /**
     * Pending versions of the stored info type. Empty if no versions are
     * pending.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3;</code>
     * @param \Google\Cloud\Dlp\V2\StoredInfoTypeVersion[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPendingVersions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\StoredInfoTypeVersion::class);
        $this->pending_versions = $arr;

        return $this;
    }

}

