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

namespace Google\Cloud\ContactCenterInsights\V1;

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

/**
 * The data for a phrase match rule.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.PhraseMatchRule</code>
 */
class PhraseMatchRule extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The phrase to be matched.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $query = '';
    /**
     * Specifies whether the phrase must be missing from the transcript segment or
     * present in the transcript segment.
     *
     * Generated from protobuf field <code>bool negated = 2;</code>
     */
    private $negated = false;
    /**
     * Provides additional information about the rule that specifies how to apply
     * the rule.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.PhraseMatchRuleConfig config = 3;</code>
     */
    private $config = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $query
     *           Required. The phrase to be matched.
     *     @type bool $negated
     *           Specifies whether the phrase must be missing from the transcript segment or
     *           present in the transcript segment.
     *     @type \Google\Cloud\ContactCenterInsights\V1\PhraseMatchRuleConfig $config
     *           Provides additional information about the rule that specifies how to apply
     *           the rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The phrase to be matched.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Required. The phrase to be matched.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * Specifies whether the phrase must be missing from the transcript segment or
     * present in the transcript segment.
     *
     * Generated from protobuf field <code>bool negated = 2;</code>
     * @return bool
     */
    public function getNegated()
    {
        return $this->negated;
    }

    /**
     * Specifies whether the phrase must be missing from the transcript segment or
     * present in the transcript segment.
     *
     * Generated from protobuf field <code>bool negated = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setNegated($var)
    {
        GPBUtil::checkBool($var);
        $this->negated = $var;

        return $this;
    }

    /**
     * Provides additional information about the rule that specifies how to apply
     * the rule.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.PhraseMatchRuleConfig config = 3;</code>
     * @return \Google\Cloud\ContactCenterInsights\V1\PhraseMatchRuleConfig|null
     */
    public function getConfig()
    {
        return $this->config;
    }

    public function hasConfig()
    {
        return isset($this->config);
    }

    public function clearConfig()
    {
        unset($this->config);
    }

    /**
     * Provides additional information about the rule that specifies how to apply
     * the rule.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.PhraseMatchRuleConfig config = 3;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\PhraseMatchRuleConfig $var
     * @return $this
     */
    public function setConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\PhraseMatchRuleConfig::class);
        $this->config = $var;

        return $this;
    }

}

