Measurement of prompt D0, D+, D*+, and \( {\mathrm{D}}_{\mathrm{S}}^{+} \) production in p–Pb collisions at \( \sqrt{{\mathrm{s}}_{\mathrm{NN}}} \) = 5.02 TeV