Nonautonomous lump-periodic and analytical solutions to the ( $$\varvec{3+1}$$ 3 + 1 )-dimensional generalized Kadomtsev–Petviashvili equation