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

namespace Google\Cloud\Compute\V1;

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

/**
 * The available logging options for this subnetwork.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.SubnetworkLogConfig</code>
 */
class SubnetworkLogConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection.
     * Check the AggregationInterval enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string aggregation_interval = 174919042;</code>
     */
    private $aggregation_interval = null;
    /**
     * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.
     *
     * Generated from protobuf field <code>optional bool enable = 311764355;</code>
     */
    private $enable = null;
    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.
     *
     * Generated from protobuf field <code>optional string filter_expr = 183374428;</code>
     */
    private $filter_expr = null;
    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
     *
     * Generated from protobuf field <code>optional float flow_sampling = 530150360;</code>
     */
    private $flow_sampling = null;
    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA.
     * Check the Metadata enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string metadata = 86866735;</code>
     */
    private $metadata = null;
    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.
     *
     * Generated from protobuf field <code>repeated string metadata_fields = 378461641;</code>
     */
    private $metadata_fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $aggregation_interval
     *           Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection.
     *           Check the AggregationInterval enum for the list of possible values.
     *     @type bool $enable
     *           Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.
     *     @type string $filter_expr
     *           Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.
     *     @type float $flow_sampling
     *           Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
     *     @type string $metadata
     *           Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA.
     *           Check the Metadata enum for the list of possible values.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $metadata_fields
     *           Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection.
     * Check the AggregationInterval enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string aggregation_interval = 174919042;</code>
     * @return string
     */
    public function getAggregationInterval()
    {
        return isset($this->aggregation_interval) ? $this->aggregation_interval : '';
    }

    public function hasAggregationInterval()
    {
        return isset($this->aggregation_interval);
    }

    public function clearAggregationInterval()
    {
        unset($this->aggregation_interval);
    }

    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection.
     * Check the AggregationInterval enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string aggregation_interval = 174919042;</code>
     * @param string $var
     * @return $this
     */
    public function setAggregationInterval($var)
    {
        GPBUtil::checkString($var, True);
        $this->aggregation_interval = $var;

        return $this;
    }

    /**
     * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.
     *
     * Generated from protobuf field <code>optional bool enable = 311764355;</code>
     * @return bool
     */
    public function getEnable()
    {
        return isset($this->enable) ? $this->enable : false;
    }

    public function hasEnable()
    {
        return isset($this->enable);
    }

    public function clearEnable()
    {
        unset($this->enable);
    }

    /**
     * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.
     *
     * Generated from protobuf field <code>optional bool enable = 311764355;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnable($var)
    {
        GPBUtil::checkBool($var);
        $this->enable = $var;

        return $this;
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.
     *
     * Generated from protobuf field <code>optional string filter_expr = 183374428;</code>
     * @return string
     */
    public function getFilterExpr()
    {
        return isset($this->filter_expr) ? $this->filter_expr : '';
    }

    public function hasFilterExpr()
    {
        return isset($this->filter_expr);
    }

    public function clearFilterExpr()
    {
        unset($this->filter_expr);
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.
     *
     * Generated from protobuf field <code>optional string filter_expr = 183374428;</code>
     * @param string $var
     * @return $this
     */
    public function setFilterExpr($var)
    {
        GPBUtil::checkString($var, True);
        $this->filter_expr = $var;

        return $this;
    }

    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
     *
     * Generated from protobuf field <code>optional float flow_sampling = 530150360;</code>
     * @return float
     */
    public function getFlowSampling()
    {
        return isset($this->flow_sampling) ? $this->flow_sampling : 0.0;
    }

    public function hasFlowSampling()
    {
        return isset($this->flow_sampling);
    }

    public function clearFlowSampling()
    {
        unset($this->flow_sampling);
    }

    /**
     * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.
     *
     * Generated from protobuf field <code>optional float flow_sampling = 530150360;</code>
     * @param float $var
     * @return $this
     */
    public function setFlowSampling($var)
    {
        GPBUtil::checkFloat($var);
        $this->flow_sampling = $var;

        return $this;
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA.
     * Check the Metadata enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string metadata = 86866735;</code>
     * @return string
     */
    public function getMetadata()
    {
        return isset($this->metadata) ? $this->metadata : '';
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA.
     * Check the Metadata enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string metadata = 86866735;</code>
     * @param string $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->metadata = $var;

        return $this;
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.
     *
     * Generated from protobuf field <code>repeated string metadata_fields = 378461641;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMetadataFields()
    {
        return $this->metadata_fields;
    }

    /**
     * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.
     *
     * Generated from protobuf field <code>repeated string metadata_fields = 378461641;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMetadataFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->metadata_fields = $arr;

        return $this;
    }

}

