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

namespace Google\Cloud\SecurityCenter\V1;

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

/**
 * Defines the properties in a custom module configuration for Security
 * Health Analytics. Use the custom module configuration to create custom
 * detectors that generate custom findings for resources that you specify.
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v1.CustomConfig</code>
 */
class CustomConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * The CEL expression to evaluate to produce findings. When the expression
     * evaluates to true against a resource, a finding is generated.
     *
     * Generated from protobuf field <code>.google.type.Expr predicate = 1;</code>
     */
    private $predicate = null;
    /**
     * Custom output properties.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec custom_output = 2;</code>
     */
    private $custom_output = null;
    /**
     * The resource types that the custom module operates on. Each custom module
     * can specify up to 5 resource types.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector resource_selector = 3;</code>
     */
    private $resource_selector = null;
    /**
     * The severity to assign to findings generated by the module.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.Severity severity = 4;</code>
     */
    private $severity = 0;
    /**
     * Text that describes the vulnerability or misconfiguration that the custom
     * module detects. This explanation is returned with each finding instance to
     * help investigators understand the detected issue. The text must be enclosed
     * in quotation marks.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     */
    private $description = '';
    /**
     * An explanation of the recommended steps that security teams can take to
     * resolve the detected issue. This explanation is returned with each finding
     * generated by this module in the `nextSteps` property of the finding JSON.
     *
     * Generated from protobuf field <code>string recommendation = 6;</code>
     */
    private $recommendation = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Expr $predicate
     *           The CEL expression to evaluate to produce findings. When the expression
     *           evaluates to true against a resource, a finding is generated.
     *     @type \Google\Cloud\SecurityCenter\V1\CustomConfig\CustomOutputSpec $custom_output
     *           Custom output properties.
     *     @type \Google\Cloud\SecurityCenter\V1\CustomConfig\ResourceSelector $resource_selector
     *           The resource types that the custom module operates on. Each custom module
     *           can specify up to 5 resource types.
     *     @type int $severity
     *           The severity to assign to findings generated by the module.
     *     @type string $description
     *           Text that describes the vulnerability or misconfiguration that the custom
     *           module detects. This explanation is returned with each finding instance to
     *           help investigators understand the detected issue. The text must be enclosed
     *           in quotation marks.
     *     @type string $recommendation
     *           An explanation of the recommended steps that security teams can take to
     *           resolve the detected issue. This explanation is returned with each finding
     *           generated by this module in the `nextSteps` property of the finding JSON.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V1\SecurityHealthAnalyticsCustomConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The CEL expression to evaluate to produce findings. When the expression
     * evaluates to true against a resource, a finding is generated.
     *
     * Generated from protobuf field <code>.google.type.Expr predicate = 1;</code>
     * @return \Google\Type\Expr|null
     */
    public function getPredicate()
    {
        return $this->predicate;
    }

    public function hasPredicate()
    {
        return isset($this->predicate);
    }

    public function clearPredicate()
    {
        unset($this->predicate);
    }

    /**
     * The CEL expression to evaluate to produce findings. When the expression
     * evaluates to true against a resource, a finding is generated.
     *
     * Generated from protobuf field <code>.google.type.Expr predicate = 1;</code>
     * @param \Google\Type\Expr $var
     * @return $this
     */
    public function setPredicate($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Expr::class);
        $this->predicate = $var;

        return $this;
    }

    /**
     * Custom output properties.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec custom_output = 2;</code>
     * @return \Google\Cloud\SecurityCenter\V1\CustomConfig\CustomOutputSpec|null
     */
    public function getCustomOutput()
    {
        return $this->custom_output;
    }

    public function hasCustomOutput()
    {
        return isset($this->custom_output);
    }

    public function clearCustomOutput()
    {
        unset($this->custom_output);
    }

    /**
     * Custom output properties.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec custom_output = 2;</code>
     * @param \Google\Cloud\SecurityCenter\V1\CustomConfig\CustomOutputSpec $var
     * @return $this
     */
    public function setCustomOutput($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\CustomConfig\CustomOutputSpec::class);
        $this->custom_output = $var;

        return $this;
    }

    /**
     * The resource types that the custom module operates on. Each custom module
     * can specify up to 5 resource types.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector resource_selector = 3;</code>
     * @return \Google\Cloud\SecurityCenter\V1\CustomConfig\ResourceSelector|null
     */
    public function getResourceSelector()
    {
        return $this->resource_selector;
    }

    public function hasResourceSelector()
    {
        return isset($this->resource_selector);
    }

    public function clearResourceSelector()
    {
        unset($this->resource_selector);
    }

    /**
     * The resource types that the custom module operates on. Each custom module
     * can specify up to 5 resource types.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector resource_selector = 3;</code>
     * @param \Google\Cloud\SecurityCenter\V1\CustomConfig\ResourceSelector $var
     * @return $this
     */
    public function setResourceSelector($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\CustomConfig\ResourceSelector::class);
        $this->resource_selector = $var;

        return $this;
    }

    /**
     * The severity to assign to findings generated by the module.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.Severity severity = 4;</code>
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * The severity to assign to findings generated by the module.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1.CustomConfig.Severity severity = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\SecurityCenter\V1\CustomConfig\Severity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * Text that describes the vulnerability or misconfiguration that the custom
     * module detects. This explanation is returned with each finding instance to
     * help investigators understand the detected issue. The text must be enclosed
     * in quotation marks.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Text that describes the vulnerability or misconfiguration that the custom
     * module detects. This explanation is returned with each finding instance to
     * help investigators understand the detected issue. The text must be enclosed
     * in quotation marks.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * An explanation of the recommended steps that security teams can take to
     * resolve the detected issue. This explanation is returned with each finding
     * generated by this module in the `nextSteps` property of the finding JSON.
     *
     * Generated from protobuf field <code>string recommendation = 6;</code>
     * @return string
     */
    public function getRecommendation()
    {
        return $this->recommendation;
    }

    /**
     * An explanation of the recommended steps that security teams can take to
     * resolve the detected issue. This explanation is returned with each finding
     * generated by this module in the `nextSteps` property of the finding JSON.
     *
     * Generated from protobuf field <code>string recommendation = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setRecommendation($var)
    {
        GPBUtil::checkString($var, True);
        $this->recommendation = $var;

        return $this;
    }

}

