aboutsummaryrefslogtreecommitdiff
path: root/jobs/{{base}}.h.mustache
blob: ad8a2f1f777ec512397090fda24d5d7ec3d9c54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{#@filePartial}}preamble{{/@filePartial}}

#pragma once

{{#operations}}#include "../basejob.h"
{{/operations}}
{{#imports}}#include {{.}}
{{/imports}}
{{#models}}#include "jobs/converters.h"
{{/models}}
namespace QMatrixClient
{
{{#models}}    // Data structures
{{#    model}}
    struct {{classname}}
    {
        {{#vars}}{{datatype}} {{name}};
        {{/vars}}
        operator QJsonValue() const;
    };

    template <> struct FromJson<{{classname}}>
    {
        {{classname}} operator()(QJsonValue jv);
    };
{{/    model}}
{{/models}}
{{#operations}}    // Operations
{{#    operation}}
    class {{camelCaseOperationId}}Job : public BaseJob
    {
        public:
            explicit {{camelCaseOperationId}}Job({{#allParams}}{{#avoidCopy?}}const {{dataType}}&{{/avoidCopy?}}{{^avoidCopy?}}{{dataType}}{{/avoidCopy?}} {{paramName}}{{^required?}} = {{defaultValue}}{{^defaultValue}}{}{{/defaultValue}}{{/required?}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{#        responses}}{{#normalResponse?}}{{#properties?}}
            ~{{camelCaseOperationId}}Job() override;

            {{#properties}}const {{dataType}}& {{paramName}}() const;
            {{/properties}}
        protected:
            {{^returnFile}}Status parseJson(const QJsonDocument& data) override;{{/returnFile}}
            {{#returnFile?}}Status parseReply(QByteArray data) override;{{/returnFile?}}
        private:
            class Private;
            Private* d;{{/properties?}}{{/normalResponse?}}{{/responses}}
    };{{/operation}}
{{/operations}}
} // namespace QMatrixClient