<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * 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>
     */
    protected $name = '';
    /**
     * An identifier for the `Network`, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 10;</code>
     */
    protected $id = '';
    /**
     * The type of this network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Network.Type type = 2;</code>
     */
    protected $type = 0;
    /**
     * IP address configured.
     *
     * Generated from protobuf field <code>string ip_address = 3;</code>
     */
    protected $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>
     */
    protected $state = 0;
    /**
     * The vlan id of the Network.
     *
     * Generated from protobuf field <code>string vlan_id = 7;</code>
     */
    protected $vlan_id = '';
    /**
     * The cidr of the Network.
     *
     * Generated from protobuf field <code>string cidr = 8;</code>
     */
    protected $cidr = '';
    /**
     * The vrf for the Network.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF vrf = 9;</code>
     */
    protected $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>
     */
    protected $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;
    /**
     * Output only. Pod name.
     *
     * Generated from protobuf field <code>string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $pod = '';
    /**
     * Input only. List of mount points to attach the network to.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $mount_points;
    /**
     * Whether network uses standard frames or jumbo ones.
     *
     * Generated from protobuf field <code>bool jumbo_frames_enabled = 16;</code>
     */
    protected $jumbo_frames_enabled = false;
    /**
     * Output only. Gateway ip address.
     *
     * Generated from protobuf field <code>string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $gateway_ip = '';

    /**
     * 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 string[] $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 \Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation[] $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.
     *     @type string $pod
     *           Output only. Pod name.
     *     @type \Google\Cloud\BareMetalSolution\V2\NetworkMountPoint[] $mount_points
     *           Input only. List of mount points to attach the network to.
     *     @type bool $jumbo_frames_enabled
     *           Whether network uses standard frames or jumbo ones.
     *     @type string $gateway_ip
     *           Output only. Gateway ip address.
     * }
     */
    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 RepeatedField<string>
     */
    public function getMacAddress()
    {
        return $this->mac_address;
    }

    /**
     * List of physical interfaces.
     *
     * Generated from protobuf field <code>repeated string mac_address = 4;</code>
     * @param string[] $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 RepeatedField<\Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation>
     */
    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 \Google\Cloud\BareMetalSolution\V2\NetworkAddressReservation[] $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;
    }

    /**
     * Output only. Pod name.
     *
     * Generated from protobuf field <code>string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPod()
    {
        return $this->pod;
    }

    /**
     * Output only. Pod name.
     *
     * Generated from protobuf field <code>string pod = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPod($var)
    {
        GPBUtil::checkString($var, True);
        $this->pod = $var;

        return $this;
    }

    /**
     * Input only. List of mount points to attach the network to.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return RepeatedField<\Google\Cloud\BareMetalSolution\V2\NetworkMountPoint>
     */
    public function getMountPoints()
    {
        return $this->mount_points;
    }

    /**
     * Input only. List of mount points to attach the network to.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.NetworkMountPoint mount_points = 15 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Cloud\BareMetalSolution\V2\NetworkMountPoint[] $var
     * @return $this
     */
    public function setMountPoints($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\NetworkMountPoint::class);
        $this->mount_points = $arr;

        return $this;
    }

    /**
     * Whether network uses standard frames or jumbo ones.
     *
     * Generated from protobuf field <code>bool jumbo_frames_enabled = 16;</code>
     * @return bool
     */
    public function getJumboFramesEnabled()
    {
        return $this->jumbo_frames_enabled;
    }

    /**
     * Whether network uses standard frames or jumbo ones.
     *
     * Generated from protobuf field <code>bool jumbo_frames_enabled = 16;</code>
     * @param bool $var
     * @return $this
     */
    public function setJumboFramesEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->jumbo_frames_enabled = $var;

        return $this;
    }

    /**
     * Output only. Gateway ip address.
     *
     * Generated from protobuf field <code>string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getGatewayIp()
    {
        return $this->gateway_ip;
    }

    /**
     * Output only. Gateway ip address.
     *
     * Generated from protobuf field <code>string gateway_ip = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setGatewayIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->gateway_ip = $var;

        return $this;
    }

}

