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

/**
 * A pattern to match against one or more database resources. At least one
 * pattern must be specified. Regular expressions use RE2
 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
 * under the google/re2 repository on GitHub.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DatabaseResourceRegex</code>
 */
class DatabaseResourceRegex extends \Google\Protobuf\Internal\Message
{
    /**
     * For organizations, if unset, will match all projects. Has no effect
     * for configurations created within a project.
     *
     * Generated from protobuf field <code>string project_id_regex = 1;</code>
     */
    private $project_id_regex = '';
    /**
     * Regex to test the instance name against. If empty, all instances match.
     *
     * Generated from protobuf field <code>string instance_regex = 2;</code>
     */
    private $instance_regex = '';
    /**
     * Regex to test the database name against. If empty, all databases match.
     *
     * Generated from protobuf field <code>string database_regex = 3;</code>
     */
    private $database_regex = '';
    /**
     * Regex to test the database resource's name against. An example of a
     * database resource name is a table's name. Other database resource names
     * like view names could be included in the future. If empty, all database
     * resources match.
     *
     * Generated from protobuf field <code>string database_resource_name_regex = 4;</code>
     */
    private $database_resource_name_regex = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $project_id_regex
     *           For organizations, if unset, will match all projects. Has no effect
     *           for configurations created within a project.
     *     @type string $instance_regex
     *           Regex to test the instance name against. If empty, all instances match.
     *     @type string $database_regex
     *           Regex to test the database name against. If empty, all databases match.
     *     @type string $database_resource_name_regex
     *           Regex to test the database resource's name against. An example of a
     *           database resource name is a table's name. Other database resource names
     *           like view names could be included in the future. If empty, all database
     *           resources match.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * For organizations, if unset, will match all projects. Has no effect
     * for configurations created within a project.
     *
     * Generated from protobuf field <code>string project_id_regex = 1;</code>
     * @return string
     */
    public function getProjectIdRegex()
    {
        return $this->project_id_regex;
    }

    /**
     * For organizations, if unset, will match all projects. Has no effect
     * for configurations created within a project.
     *
     * Generated from protobuf field <code>string project_id_regex = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setProjectIdRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->project_id_regex = $var;

        return $this;
    }

    /**
     * Regex to test the instance name against. If empty, all instances match.
     *
     * Generated from protobuf field <code>string instance_regex = 2;</code>
     * @return string
     */
    public function getInstanceRegex()
    {
        return $this->instance_regex;
    }

    /**
     * Regex to test the instance name against. If empty, all instances match.
     *
     * Generated from protobuf field <code>string instance_regex = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setInstanceRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance_regex = $var;

        return $this;
    }

    /**
     * Regex to test the database name against. If empty, all databases match.
     *
     * Generated from protobuf field <code>string database_regex = 3;</code>
     * @return string
     */
    public function getDatabaseRegex()
    {
        return $this->database_regex;
    }

    /**
     * Regex to test the database name against. If empty, all databases match.
     *
     * Generated from protobuf field <code>string database_regex = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDatabaseRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->database_regex = $var;

        return $this;
    }

    /**
     * Regex to test the database resource's name against. An example of a
     * database resource name is a table's name. Other database resource names
     * like view names could be included in the future. If empty, all database
     * resources match.
     *
     * Generated from protobuf field <code>string database_resource_name_regex = 4;</code>
     * @return string
     */
    public function getDatabaseResourceNameRegex()
    {
        return $this->database_resource_name_regex;
    }

    /**
     * Regex to test the database resource's name against. An example of a
     * database resource name is a table's name. Other database resource names
     * like view names could be included in the future. If empty, all database
     * resources match.
     *
     * Generated from protobuf field <code>string database_resource_name_regex = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setDatabaseResourceNameRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->database_resource_name_regex = $var;

        return $this;
    }

}

