<?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;

/**
 * Next free: 15
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.BfdStatus</code>
 */
class BfdStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer.
     * Check the BfdSessionInitializationMode enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string bfd_session_initialization_mode = 218156954;</code>
     */
    private $bfd_session_initialization_mode = null;
    /**
     * Unix timestamp of the most recent config update.
     *
     * Generated from protobuf field <code>optional int64 config_update_timestamp_micros = 457195569;</code>
     */
    private $config_update_timestamp_micros = null;
    /**
     * Control packet counts for the current BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561;</code>
     */
    private $control_packet_counts = null;
    /**
     * Inter-packet time interval statistics for control packets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649;</code>
     */
    private $control_packet_intervals;
    /**
     * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880
     * Check the LocalDiagnostic enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_diagnostic = 463737083;</code>
     */
    private $local_diagnostic = null;
    /**
     * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
     * Check the LocalState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_state = 149195453;</code>
     */
    private $local_state = null;
    /**
     * Negotiated transmit interval for control packets.
     *
     * Generated from protobuf field <code>optional uint32 negotiated_local_control_tx_interval_ms = 21768340;</code>
     */
    private $negotiated_local_control_tx_interval_ms = null;
    /**
     * The most recent Rx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729;</code>
     */
    private $rx_packet = null;
    /**
     * The most recent Tx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275;</code>
     */
    private $tx_packet = null;
    /**
     * Session uptime in milliseconds. Value will be 0 if session is not up.
     *
     * Generated from protobuf field <code>optional int64 uptime_ms = 125398365;</code>
     */
    private $uptime_ms = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $bfd_session_initialization_mode
     *           The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer.
     *           Check the BfdSessionInitializationMode enum for the list of possible values.
     *     @type int|string $config_update_timestamp_micros
     *           Unix timestamp of the most recent config update.
     *     @type \Google\Cloud\Compute\V1\BfdStatusPacketCounts $control_packet_counts
     *           Control packet counts for the current BFD session.
     *     @type array<\Google\Cloud\Compute\V1\PacketIntervals>|\Google\Protobuf\Internal\RepeatedField $control_packet_intervals
     *           Inter-packet time interval statistics for control packets.
     *     @type string $local_diagnostic
     *           The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880
     *           Check the LocalDiagnostic enum for the list of possible values.
     *     @type string $local_state
     *           The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
     *           Check the LocalState enum for the list of possible values.
     *     @type int $negotiated_local_control_tx_interval_ms
     *           Negotiated transmit interval for control packets.
     *     @type \Google\Cloud\Compute\V1\BfdPacket $rx_packet
     *           The most recent Rx control packet for this BFD session.
     *     @type \Google\Cloud\Compute\V1\BfdPacket $tx_packet
     *           The most recent Tx control packet for this BFD session.
     *     @type int|string $uptime_ms
     *           Session uptime in milliseconds. Value will be 0 if session is not up.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer.
     * Check the BfdSessionInitializationMode enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string bfd_session_initialization_mode = 218156954;</code>
     * @return string
     */
    public function getBfdSessionInitializationMode()
    {
        return isset($this->bfd_session_initialization_mode) ? $this->bfd_session_initialization_mode : '';
    }

    public function hasBfdSessionInitializationMode()
    {
        return isset($this->bfd_session_initialization_mode);
    }

    public function clearBfdSessionInitializationMode()
    {
        unset($this->bfd_session_initialization_mode);
    }

    /**
     * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer.
     * Check the BfdSessionInitializationMode enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string bfd_session_initialization_mode = 218156954;</code>
     * @param string $var
     * @return $this
     */
    public function setBfdSessionInitializationMode($var)
    {
        GPBUtil::checkString($var, True);
        $this->bfd_session_initialization_mode = $var;

        return $this;
    }

    /**
     * Unix timestamp of the most recent config update.
     *
     * Generated from protobuf field <code>optional int64 config_update_timestamp_micros = 457195569;</code>
     * @return int|string
     */
    public function getConfigUpdateTimestampMicros()
    {
        return isset($this->config_update_timestamp_micros) ? $this->config_update_timestamp_micros : 0;
    }

    public function hasConfigUpdateTimestampMicros()
    {
        return isset($this->config_update_timestamp_micros);
    }

    public function clearConfigUpdateTimestampMicros()
    {
        unset($this->config_update_timestamp_micros);
    }

    /**
     * Unix timestamp of the most recent config update.
     *
     * Generated from protobuf field <code>optional int64 config_update_timestamp_micros = 457195569;</code>
     * @param int|string $var
     * @return $this
     */
    public function setConfigUpdateTimestampMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->config_update_timestamp_micros = $var;

        return $this;
    }

    /**
     * Control packet counts for the current BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561;</code>
     * @return \Google\Cloud\Compute\V1\BfdStatusPacketCounts|null
     */
    public function getControlPacketCounts()
    {
        return $this->control_packet_counts;
    }

    public function hasControlPacketCounts()
    {
        return isset($this->control_packet_counts);
    }

    public function clearControlPacketCounts()
    {
        unset($this->control_packet_counts);
    }

    /**
     * Control packet counts for the current BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561;</code>
     * @param \Google\Cloud\Compute\V1\BfdStatusPacketCounts $var
     * @return $this
     */
    public function setControlPacketCounts($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdStatusPacketCounts::class);
        $this->control_packet_counts = $var;

        return $this;
    }

    /**
     * Inter-packet time interval statistics for control packets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getControlPacketIntervals()
    {
        return $this->control_packet_intervals;
    }

    /**
     * Inter-packet time interval statistics for control packets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649;</code>
     * @param array<\Google\Cloud\Compute\V1\PacketIntervals>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setControlPacketIntervals($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketIntervals::class);
        $this->control_packet_intervals = $arr;

        return $this;
    }

    /**
     * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880
     * Check the LocalDiagnostic enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_diagnostic = 463737083;</code>
     * @return string
     */
    public function getLocalDiagnostic()
    {
        return isset($this->local_diagnostic) ? $this->local_diagnostic : '';
    }

    public function hasLocalDiagnostic()
    {
        return isset($this->local_diagnostic);
    }

    public function clearLocalDiagnostic()
    {
        unset($this->local_diagnostic);
    }

    /**
     * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880
     * Check the LocalDiagnostic enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_diagnostic = 463737083;</code>
     * @param string $var
     * @return $this
     */
    public function setLocalDiagnostic($var)
    {
        GPBUtil::checkString($var, True);
        $this->local_diagnostic = $var;

        return $this;
    }

    /**
     * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
     * Check the LocalState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_state = 149195453;</code>
     * @return string
     */
    public function getLocalState()
    {
        return isset($this->local_state) ? $this->local_state : '';
    }

    public function hasLocalState()
    {
        return isset($this->local_state);
    }

    public function clearLocalState()
    {
        unset($this->local_state);
    }

    /**
     * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
     * Check the LocalState enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string local_state = 149195453;</code>
     * @param string $var
     * @return $this
     */
    public function setLocalState($var)
    {
        GPBUtil::checkString($var, True);
        $this->local_state = $var;

        return $this;
    }

    /**
     * Negotiated transmit interval for control packets.
     *
     * Generated from protobuf field <code>optional uint32 negotiated_local_control_tx_interval_ms = 21768340;</code>
     * @return int
     */
    public function getNegotiatedLocalControlTxIntervalMs()
    {
        return isset($this->negotiated_local_control_tx_interval_ms) ? $this->negotiated_local_control_tx_interval_ms : 0;
    }

    public function hasNegotiatedLocalControlTxIntervalMs()
    {
        return isset($this->negotiated_local_control_tx_interval_ms);
    }

    public function clearNegotiatedLocalControlTxIntervalMs()
    {
        unset($this->negotiated_local_control_tx_interval_ms);
    }

    /**
     * Negotiated transmit interval for control packets.
     *
     * Generated from protobuf field <code>optional uint32 negotiated_local_control_tx_interval_ms = 21768340;</code>
     * @param int $var
     * @return $this
     */
    public function setNegotiatedLocalControlTxIntervalMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->negotiated_local_control_tx_interval_ms = $var;

        return $this;
    }

    /**
     * The most recent Rx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729;</code>
     * @return \Google\Cloud\Compute\V1\BfdPacket|null
     */
    public function getRxPacket()
    {
        return $this->rx_packet;
    }

    public function hasRxPacket()
    {
        return isset($this->rx_packet);
    }

    public function clearRxPacket()
    {
        unset($this->rx_packet);
    }

    /**
     * The most recent Rx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729;</code>
     * @param \Google\Cloud\Compute\V1\BfdPacket $var
     * @return $this
     */
    public function setRxPacket($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdPacket::class);
        $this->rx_packet = $var;

        return $this;
    }

    /**
     * The most recent Tx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275;</code>
     * @return \Google\Cloud\Compute\V1\BfdPacket|null
     */
    public function getTxPacket()
    {
        return $this->tx_packet;
    }

    public function hasTxPacket()
    {
        return isset($this->tx_packet);
    }

    public function clearTxPacket()
    {
        unset($this->tx_packet);
    }

    /**
     * The most recent Tx control packet for this BFD session.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275;</code>
     * @param \Google\Cloud\Compute\V1\BfdPacket $var
     * @return $this
     */
    public function setTxPacket($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdPacket::class);
        $this->tx_packet = $var;

        return $this;
    }

    /**
     * Session uptime in milliseconds. Value will be 0 if session is not up.
     *
     * Generated from protobuf field <code>optional int64 uptime_ms = 125398365;</code>
     * @return int|string
     */
    public function getUptimeMs()
    {
        return isset($this->uptime_ms) ? $this->uptime_ms : 0;
    }

    public function hasUptimeMs()
    {
        return isset($this->uptime_ms);
    }

    public function clearUptimeMs()
    {
        unset($this->uptime_ms);
    }

    /**
     * Session uptime in milliseconds. Value will be 0 if session is not up.
     *
     * Generated from protobuf field <code>optional int64 uptime_ms = 125398365;</code>
     * @param int|string $var
     * @return $this
     */
    public function setUptimeMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->uptime_ms = $var;

        return $this;
    }

}

