longValueOrNull

fun JsonElement.longValueOrNull(vararg keys: String): Long?

Navigates to the nested element at keys and returns its Long value, or null if it is missing, JSON null, or not an integer in range. Extension function on JsonElement.