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

namespace Google\Cloud\BareMetalSolution\V2;

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

/**
 * Each logical interface represents a logical abstraction of the underlying
 * physical interface (for eg. bond, nic) of the instance. Each logical
 * interface can effectively map to multiple network-IP pairs and still be
 * mapped to one underlying physical interface.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.LogicalInterface</code>
 */
class LogicalInterface extends \Google\Protobuf\Internal\Message
{
    /**
     * List of logical network interfaces within a logical interface.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1;</code>
     */
    private $logical_network_interfaces;
    /**
     * Interface name. This is of syntax <bond><bond_mode> or <nic> and
     * forms part of the network template name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    private $name = '';
    /**
     * The index of the logical interface mapping to the index of the hardware
     * bond or nic on the chosen network template.
     *
     * Generated from protobuf field <code>int32 interface_index = 3;</code>
     */
    private $interface_index = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface>|\Google\Protobuf\Internal\RepeatedField $logical_network_interfaces
     *           List of logical network interfaces within a logical interface.
     *     @type string $name
     *           Interface name. This is of syntax <bond><bond_mode> or <nic> and
     *           forms part of the network template name.
     *     @type int $interface_index
     *           The index of the logical interface mapping to the index of the hardware
     *           bond or nic on the chosen network template.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce();
        parent::__construct($data);
    }

    /**
     * List of logical network interfaces within a logical interface.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLogicalNetworkInterfaces()
    {
        return $this->logical_network_interfaces;
    }

    /**
     * List of logical network interfaces within a logical interface.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface logical_network_interfaces = 1;</code>
     * @param array<\Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLogicalNetworkInterfaces($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\LogicalInterface\LogicalNetworkInterface::class);
        $this->logical_network_interfaces = $arr;

        return $this;
    }

    /**
     * Interface name. This is of syntax <bond><bond_mode> or <nic> and
     * forms part of the network template name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Interface name. This is of syntax <bond><bond_mode> or <nic> and
     * forms part of the network template name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The index of the logical interface mapping to the index of the hardware
     * bond or nic on the chosen network template.
     *
     * Generated from protobuf field <code>int32 interface_index = 3;</code>
     * @return int
     */
    public function getInterfaceIndex()
    {
        return $this->interface_index;
    }

    /**
     * The index of the logical interface mapping to the index of the hardware
     * bond or nic on the chosen network template.
     *
     * Generated from protobuf field <code>int32 interface_index = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setInterfaceIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->interface_index = $var;

        return $this;
    }

}

