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

namespace Google\Cloud\BareMetalSolution\V2\LogicalInterface;

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

/**
 * Each logical network interface is effectively a network and IP pair.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface</code>
 */
class LogicalNetworkInterface extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the network
     *
     * Generated from protobuf field <code>string network = 1;</code>
     */
    private $network = '';
    /**
     * IP address in the network
     *
     * Generated from protobuf field <code>string ip_address = 2;</code>
     */
    private $ip_address = '';
    /**
     * Whether this interface is the default gateway for the instance. Only
     * one interface can be the default gateway for the instance.
     *
     * Generated from protobuf field <code>bool default_gateway = 3;</code>
     */
    private $default_gateway = false;
    /**
     * Type of network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.Type network_type = 4;</code>
     */
    private $network_type = 0;
    /**
     * An identifier for the `Network`, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     */
    private $id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $network
     *           Name of the network
     *     @type string $ip_address
     *           IP address in the network
     *     @type bool $default_gateway
     *           Whether this interface is the default gateway for the instance. Only
     *           one interface can be the default gateway for the instance.
     *     @type int $network_type
     *           Type of network.
     *     @type string $id
     *           An identifier for the `Network`, generated by the backend.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the network
     *
     * Generated from protobuf field <code>string network = 1;</code>
     * @return string
     */
    public function getNetwork()
    {
        return $this->network;
    }

    /**
     * Name of the network
     *
     * Generated from protobuf field <code>string network = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * IP address in the network
     *
     * Generated from protobuf field <code>string ip_address = 2;</code>
     * @return string
     */
    public function getIpAddress()
    {
        return $this->ip_address;
    }

    /**
     * IP address in the network
     *
     * Generated from protobuf field <code>string ip_address = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip_address = $var;

        return $this;
    }

    /**
     * Whether this interface is the default gateway for the instance. Only
     * one interface can be the default gateway for the instance.
     *
     * Generated from protobuf field <code>bool default_gateway = 3;</code>
     * @return bool
     */
    public function getDefaultGateway()
    {
        return $this->default_gateway;
    }

    /**
     * Whether this interface is the default gateway for the instance. Only
     * one interface can be the default gateway for the instance.
     *
     * Generated from protobuf field <code>bool default_gateway = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setDefaultGateway($var)
    {
        GPBUtil::checkBool($var);
        $this->default_gateway = $var;

        return $this;
    }

    /**
     * Type of network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.Type network_type = 4;</code>
     * @return int
     */
    public function getNetworkType()
    {
        return $this->network_type;
    }

    /**
     * Type of network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.Type network_type = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setNetworkType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Network\Type::class);
        $this->network_type = $var;

        return $this;
    }

    /**
     * An identifier for the `Network`, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * An identifier for the `Network`, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LogicalNetworkInterface::class, \Google\Cloud\BareMetalSolution\V2\LogicalInterface_LogicalNetworkInterface::class);

