BaseApi: add getters to match the existing setters


... and use them in the api-body.mustache.

This commit is a pre-requisite for moving the BaseApi member
variables into a private class.

I chose to return std::optional<QString> for the apiKey()
setter, because the code did not really distinguish between
a null and and empty API key, so I needed some way to know that
the key name does not exist in the map.

For response and request compression, this commit also changes
the names of the setters.

Note: this commit keeps a direct m_networkFactory access in
{{classname}}::{{nickname}}WithDataImpl() methods, because it
will be refactored in a follow-up patch, together with the
usage of m_serverConfigs and m_serverIndices.

Found in API review.

Task-number: QTBUG-142312
Pick-to: 6.11
Change-Id: I95f44a23894859bee12c4a2c696230589ae02301
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitfd9bbae094397708fb66d30a0b9d78a7985752de
parent189dd89cde8485be44fc5ec1a946e5f1a99e94c4
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 8 Jan 2026 19:22:28 +0100