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

/**
 * A Network.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.Network</code>
 */
class Network extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name of this `Network`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/networks/{network}`
     *
     * Generated from protobuf field <code>string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * An identifier for the `Network`, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 10;</code>
     */
    private $id = '';
    /**
     * The type of this network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.Type type = 2;</code>
     */
    private $type = 0;
    /**
     * IP address configured.
     *
     * Generated from protobuf field <code>string ip_address = 3;</code>
     */
    private $ip_address = '';
    /**
     * List of physical interfaces.
     *
     * Generated from protobuf field <code>repeated string mac_address = 4;</code>
     */
    private $mac_address;
    /**
     * The Network state.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.State state = 6;</code>
     */
    private $state = 0;
    /**
     * The vlan id of the Network.
     *
     * Generated from protobuf field <code>string vlan_id = 7;</code>
     */
    private $vlan_id = '';
    /**
     * The cidr of the Network.
     *
     * Generated from protobuf field <code>string cidr = 8;</code>
     */
    private $cidr = '';
    /**
     * The vrf for the Network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF vrf = 9;</code>
     */
    private $vrf = null;
    /**
     * Labels as key value pairs.
     *
     * Generated from protobuf field <code>map<string, string> labels = 11;</code>
     */
    private $labels;
    /**
     * IP range for reserved for services (e.g. NFS).
     *
     * Generated from protobuf field <code>string services_cidr = 12;</code>
     */
    private $services_cidr = '';
    /**
     * List of IP address reservations in this network.
     * When updating this field, an error will be generated if a reservation
     * conflicts with an IP address already allocated to a physical server.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;</code>
     */
    private $reservations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The resource name of this `Network`.
     *           Resource names are schemeless URIs that follow the conventions in
     *           https://cloud.google.com/apis/design/resource_names.
     *           Format:
     *           `projects/{project}/locations/{location}/networks/{network}`
     *     @type string $id
     *           An identifier for the `Network`, generated by the backend.
     *     @type int $type
     *           The type of this network.
     *     @type string $ip_address
     *           IP address configured.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $mac_address
     *           List of physical interfaces.
     *     @type int $state
     *           The Network state.
     *     @type string $vlan_id
     *           The vlan id of the Network.
     *     @type string $cidr
     *           The cidr of the Network.
     *     @type \Google\Cloud\BareMetalSolution\V2\VRF $vrf
     *           The vrf for the Network.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Labels as key value pairs.
     *     @type string $services_cidr
     *           IP range for reserved for services (e.g. NFS).
     *     @type array<\Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation>|\Google\Protobuf\Internal\RepeatedField $reservations
     *           List of IP address reservations in this network.
     *           When updating this field, an error will be generated if a reservation
     *           conflicts with an IP address already allocated to a physical server.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name of this `Network`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/networks/{network}`
     *
     * Generated from protobuf field <code>string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The resource name of this `Network`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/networks/{network}`
     *
     * Generated from protobuf field <code>string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * IP address configured.
     *
     * Generated from protobuf field <code>string ip_address = 3;</code>
     * @return string
     */
    public function getIpAddress()
    {
        return $this->ip_address;
    }

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

        return $this;
    }

    /**
     * List of physical interfaces.
     *
     * Generated from protobuf field <code>repeated string mac_address = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMacAddress()
    {
        return $this->mac_address;
    }

    /**
     * List of physical interfaces.
     *
     * Generated from protobuf field <code>repeated string mac_address = 4;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMacAddress($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->mac_address = $arr;

        return $this;
    }

    /**
     * The Network state.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.State state = 6;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The Network state.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.State state = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\Network\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The vlan id of the Network.
     *
     * Generated from protobuf field <code>string vlan_id = 7;</code>
     * @return string
     */
    public function getVlanId()
    {
        return $this->vlan_id;
    }

    /**
     * The vlan id of the Network.
     *
     * Generated from protobuf field <code>string vlan_id = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setVlanId($var)
    {
        GPBUtil::checkString($var, True);
        $this->vlan_id = $var;

        return $this;
    }

    /**
     * The cidr of the Network.
     *
     * Generated from protobuf field <code>string cidr = 8;</code>
     * @return string
     */
    public function getCidr()
    {
        return $this->cidr;
    }

    /**
     * The cidr of the Network.
     *
     * Generated from protobuf field <code>string cidr = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setCidr($var)
    {
        GPBUtil::checkString($var, True);
        $this->cidr = $var;

        return $this;
    }

    /**
     * The vrf for the Network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF vrf = 9;</code>
     * @return \Google\Cloud\BareMetalSolution\V2\VRF|null
     */
    public function getVrf()
    {
        return $this->vrf;
    }

    public function hasVrf()
    {
        return isset($this->vrf);
    }

    public function clearVrf()
    {
        unset($this->vrf);
    }

    /**
     * The vrf for the Network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF vrf = 9;</code>
     * @param \Google\Cloud\BareMetalSolution\V2\VRF $var
     * @return $this
     */
    public function setVrf($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VRF::class);
        $this->vrf = $var;

        return $this;
    }

    /**
     * Labels as key value pairs.
     *
     * Generated from protobuf field <code>map<string, string> labels = 11;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels as key value pairs.
     *
     * Generated from protobuf field <code>map<string, string> labels = 11;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * IP range for reserved for services (e.g. NFS).
     *
     * Generated from protobuf field <code>string services_cidr = 12;</code>
     * @return string
     */
    public function getServicesCidr()
    {
        return $this->services_cidr;
    }

    /**
     * IP range for reserved for services (e.g. NFS).
     *
     * Generated from protobuf field <code>string services_cidr = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setServicesCidr($var)
    {
        GPBUtil::checkString($var, True);
        $this->services_cidr = $var;

        return $this;
    }

    /**
     * List of IP address reservations in this network.
     * When updating this field, an error will be generated if a reservation
     * conflicts with an IP address already allocated to a physical server.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getReservations()
    {
        return $this->reservations;
    }

    /**
     * List of IP address reservations in this network.
     * When updating this field, an error will be generated if a reservation
     * conflicts with an IP address already allocated to a physical server.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;</code>
     * @param array<\Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setReservations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation::class);
        $this->reservations = $arr;

        return $this;
    }

}

