2021-03-25 16:32:00 +00:00
|
|
|
{{#if endpoint.hasSuccessResponse}}
|
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
{{className}}::{{className}}(ApiClient *apiClient)
|
2021-03-25 16:32:00 +00:00
|
|
|
: {{supportNamespace}}::HttpLoader<{{dtoNamespace}}::{{endpoint.resultType}}, {{endpoint.parameterType}}>(apiClient) {}
|
|
|
|
|
|
|
|
QString {{className}}::path(const {{endpoint.parameterType}} ¶ms) const {
|
|
|
|
Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings
|
|
|
|
|
|
|
|
return {{pathStringInterpolation "params"}};
|
|
|
|
}
|
|
|
|
|
|
|
|
QUrlQuery {{className}}::query(const {{endpoint.parameterType}} ¶ms) const {
|
|
|
|
Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings
|
|
|
|
|
|
|
|
QUrlQuery result;
|
|
|
|
|
|
|
|
{{#each endpoint.requiredQueryParameters as |p|}}
|
|
|
|
result.addQueryItem("{{p.name}}", params.{{p.type.name}}());
|
|
|
|
|
|
|
|
{{/each}}
|
|
|
|
|
|
|
|
// Optional parameters
|
|
|
|
|
|
|
|
{{#each endpoint.optionalQueryParameters as |p|}}
|
|
|
|
if (!params.{{p.type.name}}Null()) {
|
|
|
|
result.addQueryItem("{{p.name}}", Support::toString(params.{{p.type.name}}()));
|
|
|
|
}
|
|
|
|
|
|
|
|
{{/each}}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
{{/if}}
|