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

namespace Google\Cloud\GkeHub\ConfigManagement\V1;

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

/**
 * Configuration for Policy Controller
 *
 * Generated from protobuf message <code>google.cloud.gkehub.configmanagement.v1.PolicyController</code>
 */
class PolicyController extends \Google\Protobuf\Internal\Message
{
    /**
     * Enables the installation of Policy Controller.
     * If false, the rest of PolicyController fields take no
     * effect.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     */
    protected $enabled = false;
    /**
     * Installs the default template library along with Policy Controller.
     *
     * Generated from protobuf field <code>optional bool template_library_installed = 2;</code>
     */
    protected $template_library_installed = null;
    /**
     * Sets the interval for Policy Controller Audit Scans (in seconds).
     * When set to 0, this disables audit functionality altogether.
     *
     * Generated from protobuf field <code>optional int64 audit_interval_seconds = 3;</code>
     */
    protected $audit_interval_seconds = null;
    /**
     * The set of namespaces that are excluded from Policy Controller checks.
     * Namespaces do not need to currently exist on the cluster.
     *
     * Generated from protobuf field <code>repeated string exemptable_namespaces = 4;</code>
     */
    private $exemptable_namespaces;
    /**
     * Enables the ability to use Constraint Templates that reference to objects
     * other than the object currently being evaluated.
     *
     * Generated from protobuf field <code>bool referential_rules_enabled = 5;</code>
     */
    protected $referential_rules_enabled = false;
    /**
     * Logs all denies and dry run failures.
     *
     * Generated from protobuf field <code>bool log_denies_enabled = 6;</code>
     */
    protected $log_denies_enabled = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $enabled
     *           Enables the installation of Policy Controller.
     *           If false, the rest of PolicyController fields take no
     *           effect.
     *     @type bool $template_library_installed
     *           Installs the default template library along with Policy Controller.
     *     @type int|string $audit_interval_seconds
     *           Sets the interval for Policy Controller Audit Scans (in seconds).
     *           When set to 0, this disables audit functionality altogether.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $exemptable_namespaces
     *           The set of namespaces that are excluded from Policy Controller checks.
     *           Namespaces do not need to currently exist on the cluster.
     *     @type bool $referential_rules_enabled
     *           Enables the ability to use Constraint Templates that reference to objects
     *           other than the object currently being evaluated.
     *     @type bool $log_denies_enabled
     *           Logs all denies and dry run failures.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkehub\V1\Configmanagement\Configmanagement::initOnce();
        parent::__construct($data);
    }

    /**
     * Enables the installation of Policy Controller.
     * If false, the rest of PolicyController fields take no
     * effect.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @return bool
     */
    public function getEnabled()
    {
        return $this->enabled;
    }

    /**
     * Enables the installation of Policy Controller.
     * If false, the rest of PolicyController fields take no
     * effect.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->enabled = $var;

        return $this;
    }

    /**
     * Installs the default template library along with Policy Controller.
     *
     * Generated from protobuf field <code>optional bool template_library_installed = 2;</code>
     * @return bool
     */
    public function getTemplateLibraryInstalled()
    {
        return isset($this->template_library_installed) ? $this->template_library_installed : false;
    }

    public function hasTemplateLibraryInstalled()
    {
        return isset($this->template_library_installed);
    }

    public function clearTemplateLibraryInstalled()
    {
        unset($this->template_library_installed);
    }

    /**
     * Installs the default template library along with Policy Controller.
     *
     * Generated from protobuf field <code>optional bool template_library_installed = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setTemplateLibraryInstalled($var)
    {
        GPBUtil::checkBool($var);
        $this->template_library_installed = $var;

        return $this;
    }

    /**
     * Sets the interval for Policy Controller Audit Scans (in seconds).
     * When set to 0, this disables audit functionality altogether.
     *
     * Generated from protobuf field <code>optional int64 audit_interval_seconds = 3;</code>
     * @return int|string
     */
    public function getAuditIntervalSeconds()
    {
        return isset($this->audit_interval_seconds) ? $this->audit_interval_seconds : 0;
    }

    public function hasAuditIntervalSeconds()
    {
        return isset($this->audit_interval_seconds);
    }

    public function clearAuditIntervalSeconds()
    {
        unset($this->audit_interval_seconds);
    }

    /**
     * Sets the interval for Policy Controller Audit Scans (in seconds).
     * When set to 0, this disables audit functionality altogether.
     *
     * Generated from protobuf field <code>optional int64 audit_interval_seconds = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAuditIntervalSeconds($var)
    {
        GPBUtil::checkInt64($var);
        $this->audit_interval_seconds = $var;

        return $this;
    }

    /**
     * The set of namespaces that are excluded from Policy Controller checks.
     * Namespaces do not need to currently exist on the cluster.
     *
     * Generated from protobuf field <code>repeated string exemptable_namespaces = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExemptableNamespaces()
    {
        return $this->exemptable_namespaces;
    }

    /**
     * The set of namespaces that are excluded from Policy Controller checks.
     * Namespaces do not need to currently exist on the cluster.
     *
     * Generated from protobuf field <code>repeated string exemptable_namespaces = 4;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExemptableNamespaces($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->exemptable_namespaces = $arr;

        return $this;
    }

    /**
     * Enables the ability to use Constraint Templates that reference to objects
     * other than the object currently being evaluated.
     *
     * Generated from protobuf field <code>bool referential_rules_enabled = 5;</code>
     * @return bool
     */
    public function getReferentialRulesEnabled()
    {
        return $this->referential_rules_enabled;
    }

    /**
     * Enables the ability to use Constraint Templates that reference to objects
     * other than the object currently being evaluated.
     *
     * Generated from protobuf field <code>bool referential_rules_enabled = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setReferentialRulesEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->referential_rules_enabled = $var;

        return $this;
    }

    /**
     * Logs all denies and dry run failures.
     *
     * Generated from protobuf field <code>bool log_denies_enabled = 6;</code>
     * @return bool
     */
    public function getLogDeniesEnabled()
    {
        return $this->log_denies_enabled;
    }

    /**
     * Logs all denies and dry run failures.
     *
     * Generated from protobuf field <code>bool log_denies_enabled = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setLogDeniesEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->log_denies_enabled = $var;

        return $this;
    }

}

