<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/storage.proto

namespace Google\Cloud\Dlp\V2\CustomInfoType;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Configuration for a custom infoType that detects key-value pairs in the
 * metadata matching the specified regular expressions.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.CustomInfoType.MetadataKeyValueExpression</code>
 */
class MetadataKeyValueExpression extends \Google\Protobuf\Internal\Message
{
    /**
     * The regular expression for the key. Key should be
     * non-empty.
     *
     * Generated from protobuf field <code>string key_regex = 1;</code>
     */
    protected $key_regex = '';
    /**
     * The regular expression for the value. Value should be non-empty.
     *
     * Generated from protobuf field <code>string value_regex = 2;</code>
     */
    protected $value_regex = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key_regex
     *           The regular expression for the key. Key should be
     *           non-empty.
     *     @type string $value_regex
     *           The regular expression for the value. Value should be non-empty.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Storage::initOnce();
        parent::__construct($data);
    }

    /**
     * The regular expression for the key. Key should be
     * non-empty.
     *
     * Generated from protobuf field <code>string key_regex = 1;</code>
     * @return string
     */
    public function getKeyRegex()
    {
        return $this->key_regex;
    }

    /**
     * The regular expression for the key. Key should be
     * non-empty.
     *
     * Generated from protobuf field <code>string key_regex = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKeyRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_regex = $var;

        return $this;
    }

    /**
     * The regular expression for the value. Value should be non-empty.
     *
     * Generated from protobuf field <code>string value_regex = 2;</code>
     * @return string
     */
    public function getValueRegex()
    {
        return $this->value_regex;
    }

    /**
     * The regular expression for the value. Value should be non-empty.
     *
     * Generated from protobuf field <code>string value_regex = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setValueRegex($var)
    {
        GPBUtil::checkString($var, True);
        $this->value_regex = $var;

        return $this;
    }

}

