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

/**
 * Requirements that must be true before a file store is scanned in discovery
 * for the first time. There is an AND relationship between the top-level
 * attributes.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DiscoveryFileStoreConditions</code>
 */
class DiscoveryFileStoreConditions extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. File store must have been created after this date. Used to avoid
     * backfilling.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_after = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $created_after = null;
    /**
     * Optional. Minimum age a file store must have. If set, the value must be 1
     * hour or greater.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_age = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $min_age = null;
    protected $conditions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $created_after
     *           Optional. File store must have been created after this date. Used to avoid
     *           backfilling.
     *     @type \Google\Protobuf\Duration $min_age
     *           Optional. Minimum age a file store must have. If set, the value must be 1
     *           hour or greater.
     *     @type \Google\Cloud\Dlp\V2\DiscoveryCloudStorageConditions $cloud_storage_conditions
     *           Optional. Cloud Storage conditions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. File store must have been created after this date. Used to avoid
     * backfilling.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_after = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAfter()
    {
        return $this->created_after;
    }

    public function hasCreatedAfter()
    {
        return isset($this->created_after);
    }

    public function clearCreatedAfter()
    {
        unset($this->created_after);
    }

    /**
     * Optional. File store must have been created after this date. Used to avoid
     * backfilling.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_after = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAfter($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_after = $var;

        return $this;
    }

    /**
     * Optional. Minimum age a file store must have. If set, the value must be 1
     * hour or greater.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_age = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getMinAge()
    {
        return $this->min_age;
    }

    public function hasMinAge()
    {
        return isset($this->min_age);
    }

    public function clearMinAge()
    {
        unset($this->min_age);
    }

    /**
     * Optional. Minimum age a file store must have. If set, the value must be 1
     * hour or greater.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_age = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setMinAge($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->min_age = $var;

        return $this;
    }

    /**
     * Optional. Cloud Storage conditions.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DiscoveryCloudStorageConditions cloud_storage_conditions = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dlp\V2\DiscoveryCloudStorageConditions|null
     */
    public function getCloudStorageConditions()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Optional. Cloud Storage conditions.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DiscoveryCloudStorageConditions cloud_storage_conditions = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dlp\V2\DiscoveryCloudStorageConditions $var
     * @return $this
     */
    public function setCloudStorageConditions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DiscoveryCloudStorageConditions::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

