<?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.RouterBgpPeer</code>
 */
class RouterBgpPeer extends \Google\Protobuf\Internal\Message
{
    /**
     * User-specified flag to indicate which mode to use for advertisement.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode advertise_mode = 312134331;</code>
     */
    private $advertise_mode = null;
    /**
     * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options:
     * - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets.
     * - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
     * - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups advertised_groups = 21065526;</code>
     */
    private $advertised_groups;
    /**
     * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932;</code>
     */
    private $advertised_ip_ranges;
    /**
     * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.
     *
     * Generated from protobuf field <code>uint32 advertised_route_priority = 186486332;</code>
     */
    private $advertised_route_priority = null;
    /**
     * Name of the interface the BGP peer is associated with.
     *
     * Generated from protobuf field <code>string interface_name = 437854673;</code>
     */
    private $interface_name = null;
    /**
     * IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string ip_address = 406272220;</code>
     */
    private $ip_address = null;
    /**
     * [Output Only] The resource that configures and manages this BGP peer.
     * - MANAGED_BY_USER is the default value and can be managed by you or other users
     * - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.ManagementType management_type = 173703606;</code>
     */
    private $management_type = null;
    /**
     * Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     */
    private $name = null;
    /**
     * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
     *
     * Generated from protobuf field <code>uint32 peer_asn = 69573151;</code>
     */
    private $peer_asn = null;
    /**
     * IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string peer_ip_address = 207735769;</code>
     */
    private $peer_ip_address = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $advertise_mode
     *           User-specified flag to indicate which mode to use for advertisement.
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $advertised_groups
     *           User-specified list of prefix groups to advertise in custom mode, which can take one of the following options:
     *           - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets.
     *           - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
     *           - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.
     *     @type \Google\Cloud\Compute\V1\RouterAdvertisedIpRange[]|\Google\Protobuf\Internal\RepeatedField $advertised_ip_ranges
     *           User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
     *     @type int $advertised_route_priority
     *           The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.
     *     @type string $interface_name
     *           Name of the interface the BGP peer is associated with.
     *     @type string $ip_address
     *           IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
     *     @type int $management_type
     *           [Output Only] The resource that configures and manages this BGP peer.
     *           - MANAGED_BY_USER is the default value and can be managed by you or other users
     *           - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
     *     @type string $name
     *           Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *     @type int $peer_asn
     *           Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
     *     @type string $peer_ip_address
     *           IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * User-specified flag to indicate which mode to use for advertisement.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode advertise_mode = 312134331;</code>
     * @return int
     */
    public function getAdvertiseMode()
    {
        return isset($this->advertise_mode) ? $this->advertise_mode : 0;
    }

    public function hasAdvertiseMode()
    {
        return isset($this->advertise_mode);
    }

    public function clearAdvertiseMode()
    {
        unset($this->advertise_mode);
    }

    /**
     * User-specified flag to indicate which mode to use for advertisement.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode advertise_mode = 312134331;</code>
     * @param int $var
     * @return $this
     */
    public function setAdvertiseMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\RouterBgpPeer\AdvertiseMode::class);
        $this->advertise_mode = $var;

        return $this;
    }

    /**
     * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options:
     * - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets.
     * - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
     * - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups advertised_groups = 21065526;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAdvertisedGroups()
    {
        return $this->advertised_groups;
    }

    /**
     * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options:
     * - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets.
     * - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
     * - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups advertised_groups = 21065526;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAdvertisedGroups($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Compute\V1\RouterBgpPeer\AdvertisedGroups::class);
        $this->advertised_groups = $arr;

        return $this;
    }

    /**
     * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAdvertisedIpRanges()
    {
        return $this->advertised_ip_ranges;
    }

    /**
     * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932;</code>
     * @param \Google\Cloud\Compute\V1\RouterAdvertisedIpRange[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAdvertisedIpRanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterAdvertisedIpRange::class);
        $this->advertised_ip_ranges = $arr;

        return $this;
    }

    /**
     * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.
     *
     * Generated from protobuf field <code>uint32 advertised_route_priority = 186486332;</code>
     * @return int
     */
    public function getAdvertisedRoutePriority()
    {
        return isset($this->advertised_route_priority) ? $this->advertised_route_priority : 0;
    }

    public function hasAdvertisedRoutePriority()
    {
        return isset($this->advertised_route_priority);
    }

    public function clearAdvertisedRoutePriority()
    {
        unset($this->advertised_route_priority);
    }

    /**
     * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.
     *
     * Generated from protobuf field <code>uint32 advertised_route_priority = 186486332;</code>
     * @param int $var
     * @return $this
     */
    public function setAdvertisedRoutePriority($var)
    {
        GPBUtil::checkUint32($var);
        $this->advertised_route_priority = $var;

        return $this;
    }

    /**
     * Name of the interface the BGP peer is associated with.
     *
     * Generated from protobuf field <code>string interface_name = 437854673;</code>
     * @return string
     */
    public function getInterfaceName()
    {
        return isset($this->interface_name) ? $this->interface_name : '';
    }

    public function hasInterfaceName()
    {
        return isset($this->interface_name);
    }

    public function clearInterfaceName()
    {
        unset($this->interface_name);
    }

    /**
     * Name of the interface the BGP peer is associated with.
     *
     * Generated from protobuf field <code>string interface_name = 437854673;</code>
     * @param string $var
     * @return $this
     */
    public function setInterfaceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->interface_name = $var;

        return $this;
    }

    /**
     * IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string ip_address = 406272220;</code>
     * @return string
     */
    public function getIpAddress()
    {
        return isset($this->ip_address) ? $this->ip_address : '';
    }

    public function hasIpAddress()
    {
        return isset($this->ip_address);
    }

    public function clearIpAddress()
    {
        unset($this->ip_address);
    }

    /**
     * IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string ip_address = 406272220;</code>
     * @param string $var
     * @return $this
     */
    public function setIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip_address = $var;

        return $this;
    }

    /**
     * [Output Only] The resource that configures and manages this BGP peer.
     * - MANAGED_BY_USER is the default value and can be managed by you or other users
     * - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.ManagementType management_type = 173703606;</code>
     * @return int
     */
    public function getManagementType()
    {
        return isset($this->management_type) ? $this->management_type : 0;
    }

    public function hasManagementType()
    {
        return isset($this->management_type);
    }

    public function clearManagementType()
    {
        unset($this->management_type);
    }

    /**
     * [Output Only] The resource that configures and manages this BGP peer.
     * - MANAGED_BY_USER is the default value and can be managed by you or other users
     * - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.RouterBgpPeer.ManagementType management_type = 173703606;</code>
     * @param int $var
     * @return $this
     */
    public function setManagementType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\RouterBgpPeer\ManagementType::class);
        $this->management_type = $var;

        return $this;
    }

    /**
     * Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @return string
     */
    public function getName()
    {
        return isset($this->name) ? $this->name : '';
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    /**
     * Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
     *
     * Generated from protobuf field <code>uint32 peer_asn = 69573151;</code>
     * @return int
     */
    public function getPeerAsn()
    {
        return isset($this->peer_asn) ? $this->peer_asn : 0;
    }

    public function hasPeerAsn()
    {
        return isset($this->peer_asn);
    }

    public function clearPeerAsn()
    {
        unset($this->peer_asn);
    }

    /**
     * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
     *
     * Generated from protobuf field <code>uint32 peer_asn = 69573151;</code>
     * @param int $var
     * @return $this
     */
    public function setPeerAsn($var)
    {
        GPBUtil::checkUint32($var);
        $this->peer_asn = $var;

        return $this;
    }

    /**
     * IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string peer_ip_address = 207735769;</code>
     * @return string
     */
    public function getPeerIpAddress()
    {
        return isset($this->peer_ip_address) ? $this->peer_ip_address : '';
    }

    public function hasPeerIpAddress()
    {
        return isset($this->peer_ip_address);
    }

    public function clearPeerIpAddress()
    {
        unset($this->peer_ip_address);
    }

    /**
     * IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported.
     *
     * Generated from protobuf field <code>string peer_ip_address = 207735769;</code>
     * @param string $var
     * @return $this
     */
    public function setPeerIpAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->peer_ip_address = $var;

        return $this;
    }

}

