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

/**
 * The cadence at which to update data profiles when a schema is modified.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DiscoverySchemaModifiedCadence</code>
 */
class DiscoverySchemaModifiedCadence extends \Google\Protobuf\Internal\Message
{
    /**
     * The type of events to consider when deciding if the table's schema
     * has been modified and should have the profile updated. Defaults to
     * NEW_COLUMNS.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.BigQuerySchemaModification types = 1;</code>
     */
    private $types;
    /**
     * How frequently profiles may be updated when schemas are
     * modified. Defaults to monthly.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2;</code>
     */
    protected $frequency = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $types
     *           The type of events to consider when deciding if the table's schema
     *           has been modified and should have the profile updated. Defaults to
     *           NEW_COLUMNS.
     *     @type int $frequency
     *           How frequently profiles may be updated when schemas are
     *           modified. Defaults to monthly.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * The type of events to consider when deciding if the table's schema
     * has been modified and should have the profile updated. Defaults to
     * NEW_COLUMNS.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.BigQuerySchemaModification types = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTypes()
    {
        return $this->types;
    }

    /**
     * The type of events to consider when deciding if the table's schema
     * has been modified and should have the profile updated. Defaults to
     * NEW_COLUMNS.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.BigQuerySchemaModification types = 1;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\BigQuerySchemaModification::class);
        $this->types = $arr;

        return $this;
    }

    /**
     * How frequently profiles may be updated when schemas are
     * modified. Defaults to monthly.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2;</code>
     * @return int
     */
    public function getFrequency()
    {
        return $this->frequency;
    }

    /**
     * How frequently profiles may be updated when schemas are
     * modified. Defaults to monthly.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileUpdateFrequency frequency = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setFrequency($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\DataProfileUpdateFrequency::class);
        $this->frequency = $var;

        return $this;
    }

}

