#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum ESteamDatagramMsgID {
    Invalid = 0,
    RouterPingRequest = 1,
    RouterPingReply = 2,
    GameserverPingRequest = 3,
    GameserverSessionRequest = 5,
    GameserverSessionEstablished = 6,
    NoSession = 7,
    Diagnostic = 8,
    DataClientToRouter = 9,
    DataRouterToServer = 10,
    DataServerToRouter = 11,
    DataRouterToClient = 12,
    Stats = 13,
    ClientPingSampleRequest = 14,
    ClientPingSampleReply = 15,
    ClientToRouterSwitchedPrimary = 16,
    RelayHealth = 17,
    ConnectRequest = 18,
    ConnectOK = 19,
    ConnectionClosed = 20,
    NoConnection = 21,
    TicketDecryptRequest = 22,
    TicketDecryptReply = 23,
    P2PSessionRequest = 24,
    P2PSessionEstablished = 25,
    P2PStatsClient = 26,
    P2PStatsRelay = 27,
    P2PBadRoute = 28,
    GameserverPingReply = 29,
    LegacyGameserverRegistration = 30,
    SetSecondaryAddressRequest = 31,
    SetSecondaryAddressResult = 32,
    RelayToRelayPingRequest = 33,
    RelayToRelayPingReply = 34,
}

impl ESteamDatagramMsgID {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::RouterPingRequest as i32 => Some(Self::RouterPingRequest),
            x if x == Self::RouterPingReply as i32 => Some(Self::RouterPingReply),
            x if x == Self::GameserverPingRequest as i32 => Some(Self::GameserverPingRequest),
            x if x == Self::GameserverSessionRequest as i32 => Some(Self::GameserverSessionRequest),
            x if x == Self::GameserverSessionEstablished as i32 => Some(Self::GameserverSessionEstablished),
            x if x == Self::NoSession as i32 => Some(Self::NoSession),
            x if x == Self::Diagnostic as i32 => Some(Self::Diagnostic),
            x if x == Self::DataClientToRouter as i32 => Some(Self::DataClientToRouter),
            x if x == Self::DataRouterToServer as i32 => Some(Self::DataRouterToServer),
            x if x == Self::DataServerToRouter as i32 => Some(Self::DataServerToRouter),
            x if x == Self::DataRouterToClient as i32 => Some(Self::DataRouterToClient),
            x if x == Self::Stats as i32 => Some(Self::Stats),
            x if x == Self::ClientPingSampleRequest as i32 => Some(Self::ClientPingSampleRequest),
            x if x == Self::ClientPingSampleReply as i32 => Some(Self::ClientPingSampleReply),
            x if x == Self::ClientToRouterSwitchedPrimary as i32 => Some(Self::ClientToRouterSwitchedPrimary),
            x if x == Self::RelayHealth as i32 => Some(Self::RelayHealth),
            x if x == Self::ConnectRequest as i32 => Some(Self::ConnectRequest),
            x if x == Self::ConnectOK as i32 => Some(Self::ConnectOK),
            x if x == Self::ConnectionClosed as i32 => Some(Self::ConnectionClosed),
            x if x == Self::NoConnection as i32 => Some(Self::NoConnection),
            x if x == Self::TicketDecryptRequest as i32 => Some(Self::TicketDecryptRequest),
            x if x == Self::TicketDecryptReply as i32 => Some(Self::TicketDecryptReply),
            x if x == Self::P2PSessionRequest as i32 => Some(Self::P2PSessionRequest),
            x if x == Self::P2PSessionEstablished as i32 => Some(Self::P2PSessionEstablished),
            x if x == Self::P2PStatsClient as i32 => Some(Self::P2PStatsClient),
            x if x == Self::P2PStatsRelay as i32 => Some(Self::P2PStatsRelay),
            x if x == Self::P2PBadRoute as i32 => Some(Self::P2PBadRoute),
            x if x == Self::GameserverPingReply as i32 => Some(Self::GameserverPingReply),
            x if x == Self::LegacyGameserverRegistration as i32 => Some(Self::LegacyGameserverRegistration),
            x if x == Self::SetSecondaryAddressRequest as i32 => Some(Self::SetSecondaryAddressRequest),
            x if x == Self::SetSecondaryAddressResult as i32 => Some(Self::SetSecondaryAddressResult),
            x if x == Self::RelayToRelayPingRequest as i32 => Some(Self::RelayToRelayPingRequest),
            x if x == Self::RelayToRelayPingReply as i32 => Some(Self::RelayToRelayPingReply),
            _ => None,
        }
    }
}
