<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/edgenetwork/v1/resources.proto

namespace Google\Cloud\EdgeNetwork\V1;

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

/**
 * Message describing Router object
 *
 * Generated from protobuf message <code>google.cloud.edgenetwork.v1.Router</code>
 */
class Router extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The canonical resource name of the router.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $name = '';
    /**
     * Output only. The time when the router was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time when the router was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Labels associated with this resource.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</code>
     */
    private $labels;
    /**
     * Optional. A free-text description of the resource. Max length 1024
     * characters.
     *
     * Generated from protobuf field <code>string description = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Required. The canonical name of the network to which this router belongs.
     * The name is in the form of
     * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
     *
     * Generated from protobuf field <code>string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $network = '';
    /**
     * Router interfaces.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7;</code>
     */
    private $interface;
    /**
     * BGP peers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8;</code>
     */
    private $bgp_peer;
    /**
     * BGP information specific to this router.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.Router.Bgp bgp = 9;</code>
     */
    protected $bgp = null;
    /**
     * Output only. Current stage of the resource to the device by config push.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Optional. A list of CIDRs in IP/Length format to advertise northbound as
     * static routes from this router.
     *
     * Generated from protobuf field <code>repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $route_advertisements;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The canonical resource name of the router.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time when the router was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time when the router was last updated.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Labels associated with this resource.
     *     @type string $description
     *           Optional. A free-text description of the resource. Max length 1024
     *           characters.
     *     @type string $network
     *           Required. The canonical name of the network to which this router belongs.
     *           The name is in the form of
     *           `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
     *     @type \Google\Cloud\EdgeNetwork\V1\Router\PBInterface[] $interface
     *           Router interfaces.
     *     @type \Google\Cloud\EdgeNetwork\V1\Router\BgpPeer[] $bgp_peer
     *           BGP peers.
     *     @type \Google\Cloud\EdgeNetwork\V1\Router\Bgp $bgp
     *           BGP information specific to this router.
     *     @type int $state
     *           Output only. Current stage of the resource to the device by config push.
     *     @type string[] $route_advertisements
     *           Optional. A list of CIDRs in IP/Length format to advertise northbound as
     *           static routes from this router.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The canonical resource name of the router.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The canonical resource name of the router.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The time when the router was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time when the router was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time when the router was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The time when the router was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Labels associated with this resource.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels associated with this resource.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</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;
    }

    /**
     * Optional. A free-text description of the resource. Max length 1024
     * characters.
     *
     * Generated from protobuf field <code>string description = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A free-text description of the resource. Max length 1024
     * characters.
     *
     * Generated from protobuf field <code>string description = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Required. The canonical name of the network to which this router belongs.
     * The name is in the form of
     * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
     *
     * Generated from protobuf field <code>string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getNetwork()
    {
        return $this->network;
    }

    /**
     * Required. The canonical name of the network to which this router belongs.
     * The name is in the form of
     * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
     *
     * Generated from protobuf field <code>string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * Router interfaces.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7;</code>
     * @return RepeatedField<\Google\Cloud\EdgeNetwork\V1\Router\PBInterface>
     */
    public function getInterface()
    {
        return $this->interface;
    }

    /**
     * Router interfaces.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7;</code>
     * @param \Google\Cloud\EdgeNetwork\V1\Router\PBInterface[] $var
     * @return $this
     */
    public function setInterface($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Router\PBInterface::class);
        $this->interface = $arr;

        return $this;
    }

    /**
     * BGP peers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8;</code>
     * @return RepeatedField<\Google\Cloud\EdgeNetwork\V1\Router\BgpPeer>
     */
    public function getBgpPeer()
    {
        return $this->bgp_peer;
    }

    /**
     * BGP peers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8;</code>
     * @param \Google\Cloud\EdgeNetwork\V1\Router\BgpPeer[] $var
     * @return $this
     */
    public function setBgpPeer($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Router\BgpPeer::class);
        $this->bgp_peer = $arr;

        return $this;
    }

    /**
     * BGP information specific to this router.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.Router.Bgp bgp = 9;</code>
     * @return \Google\Cloud\EdgeNetwork\V1\Router\Bgp|null
     */
    public function getBgp()
    {
        return $this->bgp;
    }

    public function hasBgp()
    {
        return isset($this->bgp);
    }

    public function clearBgp()
    {
        unset($this->bgp);
    }

    /**
     * BGP information specific to this router.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.Router.Bgp bgp = 9;</code>
     * @param \Google\Cloud\EdgeNetwork\V1\Router\Bgp $var
     * @return $this
     */
    public function setBgp($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Router\Bgp::class);
        $this->bgp = $var;

        return $this;
    }

    /**
     * Output only. Current stage of the resource to the device by config push.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. Current stage of the resource to the device by config push.
     *
     * Generated from protobuf field <code>.google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\ResourceState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Optional. A list of CIDRs in IP/Length format to advertise northbound as
     * static routes from this router.
     *
     * Generated from protobuf field <code>repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getRouteAdvertisements()
    {
        return $this->route_advertisements;
    }

    /**
     * Optional. A list of CIDRs in IP/Length format to advertise northbound as
     * static routes from this router.
     *
     * Generated from protobuf field <code>repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setRouteAdvertisements($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->route_advertisements = $arr;

        return $this;
    }

}

