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

namespace Google\Cloud\NetworkServices\V1\WasmPlugin;

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

/**
 * Specifies the logging options for the activity performed by this
 * plugin. If logging is enabled, plugin logs are exported to
 * Cloud Logging.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.WasmPlugin.LogConfig</code>
 */
class LogConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Specifies whether to enable logging for activity by this
     * plugin.
     * Defaults to `false`.
     *
     * Generated from protobuf field <code>bool enable = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $enable = false;
    /**
     * Non-empty default. Configures the sampling rate of activity logs, where
     * `1.0` means all logged activity is reported and `0.0` means no activity
     * is reported. A floating point value between `0.0` and `1.0` indicates
     * that a percentage of log messages is stored.
     * The default value when logging is enabled is `1.0`. The value of the
     * field must be between `0` and `1` (inclusive).
     * This field can be specified only if logging is enabled for this plugin.
     *
     * Generated from protobuf field <code>float sample_rate = 2 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     */
    protected $sample_rate = 0.0;
    /**
     * Non-empty default. Specificies the lowest level of the plugin logs that
     * are exported to Cloud Logging. This setting relates to the logs generated
     * by using logging statements in your Wasm code.
     * This field is can be set only if logging is enabled for the plugin.
     * If the field is not provided when logging is enabled, it is set to
     * `INFO` by default.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig.LogLevel min_log_level = 3 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     */
    protected $min_log_level = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $enable
     *           Optional. Specifies whether to enable logging for activity by this
     *           plugin.
     *           Defaults to `false`.
     *     @type float $sample_rate
     *           Non-empty default. Configures the sampling rate of activity logs, where
     *           `1.0` means all logged activity is reported and `0.0` means no activity
     *           is reported. A floating point value between `0.0` and `1.0` indicates
     *           that a percentage of log messages is stored.
     *           The default value when logging is enabled is `1.0`. The value of the
     *           field must be between `0` and `1` (inclusive).
     *           This field can be specified only if logging is enabled for this plugin.
     *     @type int $min_log_level
     *           Non-empty default. Specificies the lowest level of the plugin logs that
     *           are exported to Cloud Logging. This setting relates to the logs generated
     *           by using logging statements in your Wasm code.
     *           This field is can be set only if logging is enabled for the plugin.
     *           If the field is not provided when logging is enabled, it is set to
     *           `INFO` by default.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\Extensibility::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Specifies whether to enable logging for activity by this
     * plugin.
     * Defaults to `false`.
     *
     * Generated from protobuf field <code>bool enable = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getEnable()
    {
        return $this->enable;
    }

    /**
     * Optional. Specifies whether to enable logging for activity by this
     * plugin.
     * Defaults to `false`.
     *
     * Generated from protobuf field <code>bool enable = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setEnable($var)
    {
        GPBUtil::checkBool($var);
        $this->enable = $var;

        return $this;
    }

    /**
     * Non-empty default. Configures the sampling rate of activity logs, where
     * `1.0` means all logged activity is reported and `0.0` means no activity
     * is reported. A floating point value between `0.0` and `1.0` indicates
     * that a percentage of log messages is stored.
     * The default value when logging is enabled is `1.0`. The value of the
     * field must be between `0` and `1` (inclusive).
     * This field can be specified only if logging is enabled for this plugin.
     *
     * Generated from protobuf field <code>float sample_rate = 2 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     * @return float
     */
    public function getSampleRate()
    {
        return $this->sample_rate;
    }

    /**
     * Non-empty default. Configures the sampling rate of activity logs, where
     * `1.0` means all logged activity is reported and `0.0` means no activity
     * is reported. A floating point value between `0.0` and `1.0` indicates
     * that a percentage of log messages is stored.
     * The default value when logging is enabled is `1.0`. The value of the
     * field must be between `0` and `1` (inclusive).
     * This field can be specified only if logging is enabled for this plugin.
     *
     * Generated from protobuf field <code>float sample_rate = 2 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     * @param float $var
     * @return $this
     */
    public function setSampleRate($var)
    {
        GPBUtil::checkFloat($var);
        $this->sample_rate = $var;

        return $this;
    }

    /**
     * Non-empty default. Specificies the lowest level of the plugin logs that
     * are exported to Cloud Logging. This setting relates to the logs generated
     * by using logging statements in your Wasm code.
     * This field is can be set only if logging is enabled for the plugin.
     * If the field is not provided when logging is enabled, it is set to
     * `INFO` by default.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig.LogLevel min_log_level = 3 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     * @return int
     */
    public function getMinLogLevel()
    {
        return $this->min_log_level;
    }

    /**
     * Non-empty default. Specificies the lowest level of the plugin logs that
     * are exported to Cloud Logging. This setting relates to the logs generated
     * by using logging statements in your Wasm code.
     * This field is can be set only if logging is enabled for the plugin.
     * If the field is not provided when logging is enabled, it is set to
     * `INFO` by default.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig.LogLevel min_log_level = 3 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT];</code>
     * @param int $var
     * @return $this
     */
    public function setMinLogLevel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\WasmPlugin\LogConfig\LogLevel::class);
        $this->min_log_level = $var;

        return $this;
    }

}


