<?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;

/**
 * Contains information of NAT Mappings provided by a NAT Rule.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings</code>
 */
class VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings extends \Google\Protobuf\Internal\Message
{
    /**
     * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string drain_nat_ip_port_ranges = 395440577;</code>
     */
    private $drain_nat_ip_port_ranges;
    /**
     * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string nat_ip_port_ranges = 531830810;</code>
     */
    private $nat_ip_port_ranges;
    /**
     * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_drain_nat_ports = 335532793;</code>
     */
    protected $num_total_drain_nat_ports = null;
    /**
     * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_nat_ports = 299904384;</code>
     */
    protected $num_total_nat_ports = null;
    /**
     * Rule number of the NAT Rule.
     *
     * Generated from protobuf field <code>optional int32 rule_number = 535211500;</code>
     */
    protected $rule_number = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $drain_nat_ip_port_ranges
     *           List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $nat_ip_port_ranges
     *           A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *     @type int $num_total_drain_nat_ports
     *           Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.
     *     @type int $num_total_nat_ports
     *           Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.
     *     @type int $rule_number
     *           Rule number of the NAT Rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string drain_nat_ip_port_ranges = 395440577;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDrainNatIpPortRanges()
    {
        return $this->drain_nat_ip_port_ranges;
    }

    /**
     * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string drain_nat_ip_port_ranges = 395440577;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDrainNatIpPortRanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->drain_nat_ip_port_ranges = $arr;

        return $this;
    }

    /**
     * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string nat_ip_port_ranges = 531830810;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNatIpPortRanges()
    {
        return $this->nat_ip_port_ranges;
    }

    /**
     * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
     *
     * Generated from protobuf field <code>repeated string nat_ip_port_ranges = 531830810;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNatIpPortRanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->nat_ip_port_ranges = $arr;

        return $this;
    }

    /**
     * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_drain_nat_ports = 335532793;</code>
     * @return int
     */
    public function getNumTotalDrainNatPorts()
    {
        return isset($this->num_total_drain_nat_ports) ? $this->num_total_drain_nat_ports : 0;
    }

    public function hasNumTotalDrainNatPorts()
    {
        return isset($this->num_total_drain_nat_ports);
    }

    public function clearNumTotalDrainNatPorts()
    {
        unset($this->num_total_drain_nat_ports);
    }

    /**
     * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_drain_nat_ports = 335532793;</code>
     * @param int $var
     * @return $this
     */
    public function setNumTotalDrainNatPorts($var)
    {
        GPBUtil::checkInt32($var);
        $this->num_total_drain_nat_ports = $var;

        return $this;
    }

    /**
     * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_nat_ports = 299904384;</code>
     * @return int
     */
    public function getNumTotalNatPorts()
    {
        return isset($this->num_total_nat_ports) ? $this->num_total_nat_ports : 0;
    }

    public function hasNumTotalNatPorts()
    {
        return isset($this->num_total_nat_ports);
    }

    public function clearNumTotalNatPorts()
    {
        unset($this->num_total_nat_ports);
    }

    /**
     * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.
     *
     * Generated from protobuf field <code>optional int32 num_total_nat_ports = 299904384;</code>
     * @param int $var
     * @return $this
     */
    public function setNumTotalNatPorts($var)
    {
        GPBUtil::checkInt32($var);
        $this->num_total_nat_ports = $var;

        return $this;
    }

    /**
     * Rule number of the NAT Rule.
     *
     * Generated from protobuf field <code>optional int32 rule_number = 535211500;</code>
     * @return int
     */
    public function getRuleNumber()
    {
        return isset($this->rule_number) ? $this->rule_number : 0;
    }

    public function hasRuleNumber()
    {
        return isset($this->rule_number);
    }

    public function clearRuleNumber()
    {
        unset($this->rule_number);
    }

    /**
     * Rule number of the NAT Rule.
     *
     * Generated from protobuf field <code>optional int32 rule_number = 535211500;</code>
     * @param int $var
     * @return $this
     */
    public function setRuleNumber($var)
    {
        GPBUtil::checkInt32($var);
        $this->rule_number = $var;

        return $this;
    }

}

