<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Deprecated; use `InspectionRuleSet` instead. Rule for modifying a
 * `CustomInfoType` to alter behavior under certain circumstances, depending
 * on the specific details of the rule. Not supported for the `surrogate_type`
 * custom infoType.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.CustomInfoType.DetectionRule</code>
 */
class DetectionRule extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule\HotwordRule $hotword_rule
     *           Hotword-based detection rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Storage::initOnce();
        parent::__construct($data);
    }

    /**
     * Hotword-based detection rule.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
     * @return \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule\HotwordRule
     */
    public function getHotwordRule()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Hotword-based detection rule.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
     * @param \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule\HotwordRule $var
     * @return $this
     */
    public function setHotwordRule($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType\DetectionRule\HotwordRule::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DetectionRule::class, \Google\Cloud\Dlp\V2\CustomInfoType_DetectionRule::class);

