diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-18 18:42:02 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-18 18:42:02 +0900 |
commit | f3a251404c00787b650e618fb5c257162507c18b (patch) | |
tree | a801eb5f444a8b2b3f8d93d2b64e22785bbf3f97 /lib/application-service/definitions/protocol.h | |
parent | 5e6b4bb975fa9697a6aca001629c65db506a437f (diff) | |
download | libquotient-f3a251404c00787b650e618fb5c257162507c18b.tar.gz libquotient-f3a251404c00787b650e618fb5c257162507c18b.zip |
csapi: third_party_lookup.* and its dependencies in application-service/
As per the latest API definitions.
Diffstat (limited to 'lib/application-service/definitions/protocol.h')
-rw-r--r-- | lib/application-service/definitions/protocol.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/application-service/definitions/protocol.h b/lib/application-service/definitions/protocol.h new file mode 100644 index 00000000..d4124779 --- /dev/null +++ b/lib/application-service/definitions/protocol.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#pragma once + + +#include <QtCore/QJsonObject> +#include <QtCore/QVector> +#include "converters.h" + +#include "converters.h" + +namespace QMatrixClient +{ + // Data structures + + /// Definition of valid values for a field. + struct FieldType + { + /// A regular expression for validation of a field's value. + QString regexp; + /// An placeholder serving as a valid example of the field value. + QString placeholder; + }; + + QJsonObject toJson(const FieldType& pod); + + template <> struct FromJson<FieldType> + { + FieldType operator()(const QJsonValue& jv); + }; + + /// All location or user fields should have an entry here. + struct FieldTypes + { + /// Definition of valid values for a field. + Omittable<FieldType> fieldname; + }; + + QJsonObject toJson(const FieldTypes& pod); + + template <> struct FromJson<FieldTypes> + { + FieldTypes operator()(const QJsonValue& jv); + }; + + struct Protocol + { + /// Fields used to identify a third party user. + QStringList userFields; + /// Fields used to identify a third party location. + QStringList locationFields; + /// An icon representing the third party protocol. + QString icon; + /// All location or user fields should have an entry here. + Omittable<FieldTypes> fieldTypes; + /// A list of objects representing independent instances of configuration. + /// For instance multiple networks on IRC if multiple are bridged by the + /// same bridge. + QVector<QJsonObject> instances; + }; + + QJsonObject toJson(const Protocol& pod); + + template <> struct FromJson<Protocol> + { + Protocol operator()(const QJsonValue& jv); + }; + +} // namespace QMatrixClient |