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>