<?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 VRF.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.VRF</code>
 */
class VRF extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the VRF.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The possible state of VRF.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF.State state = 5;</code>
     */
    private $state = 0;
    /**
     * The QOS policy applied to this VRF.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6;</code>
     */
    private $qos_policy = null;
    /**
     * The list of VLAN attachments for the VRF.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7;</code>
     */
    private $vlan_attachments;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the VRF.
     *     @type int $state
     *           The possible state of VRF.
     *     @type \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $qos_policy
     *           The QOS policy applied to this VRF.
     *     @type array<\Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment>|\Google\Protobuf\Internal\RepeatedField $vlan_attachments
     *           The list of VLAN attachments for the VRF.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Network::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the VRF.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * The QOS policy applied to this VRF.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6;</code>
     * @return \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy|null
     */
    public function getQosPolicy()
    {
        return $this->qos_policy;
    }

    public function hasQosPolicy()
    {
        return isset($this->qos_policy);
    }

    public function clearQosPolicy()
    {
        unset($this->qos_policy);
    }

    /**
     * The QOS policy applied to this VRF.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VRF.QosPolicy qos_policy = 6;</code>
     * @param \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy $var
     * @return $this
     */
    public function setQosPolicy($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\VRF\QosPolicy::class);
        $this->qos_policy = $var;

        return $this;
    }

    /**
     * The list of VLAN attachments for the VRF.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getVlanAttachments()
    {
        return $this->vlan_attachments;
    }

    /**
     * The list of VLAN attachments for the VRF.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VRF.VlanAttachment vlan_attachments = 7;</code>
     * @param array<\Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setVlanAttachments($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VRF\VlanAttachment::class);
        $this->vlan_attachments = $arr;

        return $this;
    }

}

