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

namespace Google\Cloud\Compute\V1;

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

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.ExchangedPeeringRoute</code>
 */
class ExchangedPeeringRoute extends \Google\Protobuf\Internal\Message
{
    /**
     * The destination range of the route.
     *
     * Generated from protobuf field <code>string dest_range = 381327712;</code>
     */
    private $dest_range = null;
    /**
     * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict.
     *
     * Generated from protobuf field <code>bool imported = 114502404;</code>
     */
    private $imported = null;
    /**
     * The region of peering route next hop, only applies to dynamic routes.
     *
     * Generated from protobuf field <code>string next_hop_region = 122577014;</code>
     */
    private $next_hop_region = null;
    /**
     * The priority of the peering route.
     *
     * Generated from protobuf field <code>uint32 priority = 445151652;</code>
     */
    private $priority = null;
    /**
     * The type of the peering route.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ExchangedPeeringRoute.Type type = 3575610;</code>
     */
    private $type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $dest_range
     *           The destination range of the route.
     *     @type bool $imported
     *           True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict.
     *     @type string $next_hop_region
     *           The region of peering route next hop, only applies to dynamic routes.
     *     @type int $priority
     *           The priority of the peering route.
     *     @type int $type
     *           The type of the peering route.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The destination range of the route.
     *
     * Generated from protobuf field <code>string dest_range = 381327712;</code>
     * @return string
     */
    public function getDestRange()
    {
        return isset($this->dest_range) ? $this->dest_range : '';
    }

    public function hasDestRange()
    {
        return isset($this->dest_range);
    }

    public function clearDestRange()
    {
        unset($this->dest_range);
    }

    /**
     * The destination range of the route.
     *
     * Generated from protobuf field <code>string dest_range = 381327712;</code>
     * @param string $var
     * @return $this
     */
    public function setDestRange($var)
    {
        GPBUtil::checkString($var, True);
        $this->dest_range = $var;

        return $this;
    }

    /**
     * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict.
     *
     * Generated from protobuf field <code>bool imported = 114502404;</code>
     * @return bool
     */
    public function getImported()
    {
        return isset($this->imported) ? $this->imported : false;
    }

    public function hasImported()
    {
        return isset($this->imported);
    }

    public function clearImported()
    {
        unset($this->imported);
    }

    /**
     * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict.
     *
     * Generated from protobuf field <code>bool imported = 114502404;</code>
     * @param bool $var
     * @return $this
     */
    public function setImported($var)
    {
        GPBUtil::checkBool($var);
        $this->imported = $var;

        return $this;
    }

    /**
     * The region of peering route next hop, only applies to dynamic routes.
     *
     * Generated from protobuf field <code>string next_hop_region = 122577014;</code>
     * @return string
     */
    public function getNextHopRegion()
    {
        return isset($this->next_hop_region) ? $this->next_hop_region : '';
    }

    public function hasNextHopRegion()
    {
        return isset($this->next_hop_region);
    }

    public function clearNextHopRegion()
    {
        unset($this->next_hop_region);
    }

    /**
     * The region of peering route next hop, only applies to dynamic routes.
     *
     * Generated from protobuf field <code>string next_hop_region = 122577014;</code>
     * @param string $var
     * @return $this
     */
    public function setNextHopRegion($var)
    {
        GPBUtil::checkString($var, True);
        $this->next_hop_region = $var;

        return $this;
    }

    /**
     * The priority of the peering route.
     *
     * Generated from protobuf field <code>uint32 priority = 445151652;</code>
     * @return int
     */
    public function getPriority()
    {
        return isset($this->priority) ? $this->priority : 0;
    }

    public function hasPriority()
    {
        return isset($this->priority);
    }

    public function clearPriority()
    {
        unset($this->priority);
    }

    /**
     * The priority of the peering route.
     *
     * Generated from protobuf field <code>uint32 priority = 445151652;</code>
     * @param int $var
     * @return $this
     */
    public function setPriority($var)
    {
        GPBUtil::checkUint32($var);
        $this->priority = $var;

        return $this;
    }

    /**
     * The type of the peering route.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ExchangedPeeringRoute.Type type = 3575610;</code>
     * @return int
     */
    public function getType()
    {
        return isset($this->type) ? $this->type : 0;
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * The type of the peering route.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ExchangedPeeringRoute.Type type = 3575610;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\ExchangedPeeringRoute\Type::class);
        $this->type = $var;

        return $this;
    }

}

