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

/**
 * L2 Interconnect Attachment related configuration.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.InterconnectAttachmentL2Forwarding</code>
 */
class InterconnectAttachmentL2Forwarding extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. A map of VLAN tags to appliances and optional inner mapping
     * rules. If VLANs are not explicitly mapped to any appliance, the
     * defaultApplianceIpAddress is used.
     * Each VLAN tag can be a single number or a range of numbers in the range
     * of 1 to 4094, e.g., "1" or "4001-4094". Non-empty and non-overlapping
     * VLAN tag ranges are enforced, and violating operations will be rejected.
     * The VLAN tags in the Ethernet header must use an ethertype value of
     * 0x88A8 or 0x8100.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingApplianceMapping> appliance_mappings = 374529975;</code>
     */
    private $appliance_mappings;
    /**
     * Optional. A single IPv4 or IPv6 address used as the default destination
     * IP when there is no VLAN mapping result found.
     * Unset field (null-value) indicates the unmatched packet should be
     * dropped.
     *
     * Generated from protobuf field <code>optional string default_appliance_ip_address = 536490476;</code>
     */
    protected $default_appliance_ip_address = null;
    /**
     * Optional. It represents the structure of a Geneve (Generic Network
     * Virtualization Encapsulation) header, as defined in RFC8926. It encapsulates packets from various
     * protocols (e.g., Ethernet, IPv4, IPv6) for use in network virtualization
     * environments.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingGeneveHeader geneve_header = 118688424;</code>
     */
    protected $geneve_header = null;
    /**
     * Required. Resource URL of the network to which this attachment belongs.
     *
     * Generated from protobuf field <code>optional string network = 232872494;</code>
     */
    protected $network = null;
    /**
     * Required. A single IPv4 or IPv6 address. This address will be used as the
     * source IP address for packets sent to the appliances, and must be used as
     * the destination IP address for packets that should be sent out through
     * this attachment.
     *
     * Generated from protobuf field <code>optional string tunnel_endpoint_ip_address = 468740975;</code>
     */
    protected $tunnel_endpoint_ip_address = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $appliance_mappings
     *           Optional. A map of VLAN tags to appliances and optional inner mapping
     *           rules. If VLANs are not explicitly mapped to any appliance, the
     *           defaultApplianceIpAddress is used.
     *           Each VLAN tag can be a single number or a range of numbers in the range
     *           of 1 to 4094, e.g., "1" or "4001-4094". Non-empty and non-overlapping
     *           VLAN tag ranges are enforced, and violating operations will be rejected.
     *           The VLAN tags in the Ethernet header must use an ethertype value of
     *           0x88A8 or 0x8100.
     *     @type string $default_appliance_ip_address
     *           Optional. A single IPv4 or IPv6 address used as the default destination
     *           IP when there is no VLAN mapping result found.
     *           Unset field (null-value) indicates the unmatched packet should be
     *           dropped.
     *     @type \Google\Cloud\Compute\V1\InterconnectAttachmentL2ForwardingGeneveHeader $geneve_header
     *           Optional. It represents the structure of a Geneve (Generic Network
     *           Virtualization Encapsulation) header, as defined in RFC8926. It encapsulates packets from various
     *           protocols (e.g., Ethernet, IPv4, IPv6) for use in network virtualization
     *           environments.
     *     @type string $network
     *           Required. Resource URL of the network to which this attachment belongs.
     *     @type string $tunnel_endpoint_ip_address
     *           Required. A single IPv4 or IPv6 address. This address will be used as the
     *           source IP address for packets sent to the appliances, and must be used as
     *           the destination IP address for packets that should be sent out through
     *           this attachment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. A map of VLAN tags to appliances and optional inner mapping
     * rules. If VLANs are not explicitly mapped to any appliance, the
     * defaultApplianceIpAddress is used.
     * Each VLAN tag can be a single number or a range of numbers in the range
     * of 1 to 4094, e.g., "1" or "4001-4094". Non-empty and non-overlapping
     * VLAN tag ranges are enforced, and violating operations will be rejected.
     * The VLAN tags in the Ethernet header must use an ethertype value of
     * 0x88A8 or 0x8100.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingApplianceMapping> appliance_mappings = 374529975;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getApplianceMappings()
    {
        return $this->appliance_mappings;
    }

    /**
     * Optional. A map of VLAN tags to appliances and optional inner mapping
     * rules. If VLANs are not explicitly mapped to any appliance, the
     * defaultApplianceIpAddress is used.
     * Each VLAN tag can be a single number or a range of numbers in the range
     * of 1 to 4094, e.g., "1" or "4001-4094". Non-empty and non-overlapping
     * VLAN tag ranges are enforced, and violating operations will be rejected.
     * The VLAN tags in the Ethernet header must use an ethertype value of
     * 0x88A8 or 0x8100.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingApplianceMapping> appliance_mappings = 374529975;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setApplianceMappings($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectAttachmentL2ForwardingApplianceMapping::class);
        $this->appliance_mappings = $arr;

        return $this;
    }

    /**
     * Optional. A single IPv4 or IPv6 address used as the default destination
     * IP when there is no VLAN mapping result found.
     * Unset field (null-value) indicates the unmatched packet should be
     * dropped.
     *
     * Generated from protobuf field <code>optional string default_appliance_ip_address = 536490476;</code>
     * @return string
     */
    public function getDefaultApplianceIpAddress()
    {
        return isset($this->default_appliance_ip_address) ? $this->default_appliance_ip_address : '';
    }

    public function hasDefaultApplianceIpAddress()
    {
        return isset($this->default_appliance_ip_address);
    }

    public function clearDefaultApplianceIpAddress()
    {
        unset($this->default_appliance_ip_address);
    }

    /**
     * Optional. A single IPv4 or IPv6 address used as the default destination
     * IP when there is no VLAN mapping result found.
     * Unset field (null-value) indicates the unmatched packet should be
     * dropped.
     *
     * Generated from protobuf field <code>optional string default_appliance_ip_address = 536490476;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultApplianceIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_appliance_ip_address = $var;

        return $this;
    }

    /**
     * Optional. It represents the structure of a Geneve (Generic Network
     * Virtualization Encapsulation) header, as defined in RFC8926. It encapsulates packets from various
     * protocols (e.g., Ethernet, IPv4, IPv6) for use in network virtualization
     * environments.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingGeneveHeader geneve_header = 118688424;</code>
     * @return \Google\Cloud\Compute\V1\InterconnectAttachmentL2ForwardingGeneveHeader|null
     */
    public function getGeneveHeader()
    {
        return $this->geneve_header;
    }

    public function hasGeneveHeader()
    {
        return isset($this->geneve_header);
    }

    public function clearGeneveHeader()
    {
        unset($this->geneve_header);
    }

    /**
     * Optional. It represents the structure of a Geneve (Generic Network
     * Virtualization Encapsulation) header, as defined in RFC8926. It encapsulates packets from various
     * protocols (e.g., Ethernet, IPv4, IPv6) for use in network virtualization
     * environments.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.InterconnectAttachmentL2ForwardingGeneveHeader geneve_header = 118688424;</code>
     * @param \Google\Cloud\Compute\V1\InterconnectAttachmentL2ForwardingGeneveHeader $var
     * @return $this
     */
    public function setGeneveHeader($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachmentL2ForwardingGeneveHeader::class);
        $this->geneve_header = $var;

        return $this;
    }

    /**
     * Required. Resource URL of the network to which this attachment belongs.
     *
     * Generated from protobuf field <code>optional string network = 232872494;</code>
     * @return string
     */
    public function getNetwork()
    {
        return isset($this->network) ? $this->network : '';
    }

    public function hasNetwork()
    {
        return isset($this->network);
    }

    public function clearNetwork()
    {
        unset($this->network);
    }

    /**
     * Required. Resource URL of the network to which this attachment belongs.
     *
     * Generated from protobuf field <code>optional string network = 232872494;</code>
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * Required. A single IPv4 or IPv6 address. This address will be used as the
     * source IP address for packets sent to the appliances, and must be used as
     * the destination IP address for packets that should be sent out through
     * this attachment.
     *
     * Generated from protobuf field <code>optional string tunnel_endpoint_ip_address = 468740975;</code>
     * @return string
     */
    public function getTunnelEndpointIpAddress()
    {
        return isset($this->tunnel_endpoint_ip_address) ? $this->tunnel_endpoint_ip_address : '';
    }

    public function hasTunnelEndpointIpAddress()
    {
        return isset($this->tunnel_endpoint_ip_address);
    }

    public function clearTunnelEndpointIpAddress()
    {
        unset($this->tunnel_endpoint_ip_address);
    }

    /**
     * Required. A single IPv4 or IPv6 address. This address will be used as the
     * source IP address for packets sent to the appliances, and must be used as
     * the destination IP address for packets that should be sent out through
     * this attachment.
     *
     * Generated from protobuf field <code>optional string tunnel_endpoint_ip_address = 468740975;</code>
     * @param string $var
     * @return $this
     */
    public function setTunnelEndpointIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->tunnel_endpoint_ip_address = $var;

        return $this;
    }

}

