structs: Migrate from namedtuple to dataclass

This lets us do some typing for the attributes, and specify the default
values in a much more user-friendly way.

This can be done now since we’re on Python 3.7!
2 jobs for typing
Status Name Job ID Coverage
failed run-test #16432

skipped run-build #16433
Name Stage Failure
run-test Test There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log