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

namespace Google\Cloud\NetworkServices\V1\HttpRoute;

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

/**
 * Specifications to match a query parameter in the request.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch</code>
 */
class QueryParameterMatch extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the query parameter to match.
     *
     * Generated from protobuf field <code>string query_parameter = 1;</code>
     */
    protected $query_parameter = '';
    protected $MatchType;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $exact_match
     *           The value of the query parameter must exactly match the contents of
     *           exact_match.
     *           Only one of exact_match, regex_match, or present_match must be set.
     *     @type string $regex_match
     *           The value of the query parameter must match the regular expression
     *           specified by regex_match. For regular expression grammar, please see
     *           https://github.com/google/re2/wiki/Syntax
     *           Only one of exact_match, regex_match, or present_match must be set.
     *     @type bool $present_match
     *           Specifies that the QueryParameterMatcher matches if request contains
     *           query parameter, irrespective of whether the parameter has a value or
     *           not.
     *           Only one of exact_match, regex_match, or present_match must be set.
     *     @type string $query_parameter
     *           The name of the query parameter to match.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce();
        parent::__construct($data);
    }

    /**
     * The value of the query parameter must exactly match the contents of
     * exact_match.
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>string exact_match = 2;</code>
     * @return string
     */
    public function getExactMatch()
    {
        return $this->readOneof(2);
    }

    public function hasExactMatch()
    {
        return $this->hasOneof(2);
    }

    /**
     * The value of the query parameter must exactly match the contents of
     * exact_match.
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>string exact_match = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setExactMatch($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The value of the query parameter must match the regular expression
     * specified by regex_match. For regular expression grammar, please see
     * https://github.com/google/re2/wiki/Syntax
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>string regex_match = 3;</code>
     * @return string
     */
    public function getRegexMatch()
    {
        return $this->readOneof(3);
    }

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

    /**
     * The value of the query parameter must match the regular expression
     * specified by regex_match. For regular expression grammar, please see
     * https://github.com/google/re2/wiki/Syntax
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>string regex_match = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRegexMatch($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Specifies that the QueryParameterMatcher matches if request contains
     * query parameter, irrespective of whether the parameter has a value or
     * not.
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>bool present_match = 4;</code>
     * @return bool
     */
    public function getPresentMatch()
    {
        return $this->readOneof(4);
    }

    public function hasPresentMatch()
    {
        return $this->hasOneof(4);
    }

    /**
     * Specifies that the QueryParameterMatcher matches if request contains
     * query parameter, irrespective of whether the parameter has a value or
     * not.
     * Only one of exact_match, regex_match, or present_match must be set.
     *
     * Generated from protobuf field <code>bool present_match = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setPresentMatch($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * The name of the query parameter to match.
     *
     * Generated from protobuf field <code>string query_parameter = 1;</code>
     * @return string
     */
    public function getQueryParameter()
    {
        return $this->query_parameter;
    }

    /**
     * The name of the query parameter to match.
     *
     * Generated from protobuf field <code>string query_parameter = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setQueryParameter($var)
    {
        GPBUtil::checkString($var, True);
        $this->query_parameter = $var;

        return $this;
    }

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

}


