<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recommender/v1/recommendation.proto

namespace Google\Cloud\Recommender\V1;

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

/**
 * Contains various matching options for values for a GCP resource field.
 *
 * Generated from protobuf message <code>google.cloud.recommender.v1.ValueMatcher</code>
 */
class ValueMatcher extends \Google\Protobuf\Internal\Message
{
    protected $match_variant;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $matches_pattern
     *           To be used for full regex matching. The regular expression is using the
     *           Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be
     *           used with RE2::FullMatch
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * To be used for full regex matching. The regular expression is using the
     * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be
     * used with RE2::FullMatch
     *
     * Generated from protobuf field <code>string matches_pattern = 1;</code>
     * @return string
     */
    public function getMatchesPattern()
    {
        return $this->readOneof(1);
    }

    public function hasMatchesPattern()
    {
        return $this->hasOneof(1);
    }

    /**
     * To be used for full regex matching. The regular expression is using the
     * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be
     * used with RE2::FullMatch
     *
     * Generated from protobuf field <code>string matches_pattern = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setMatchesPattern($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

