// This is an auto-generated file.
// Any changes to this file will be overwritten

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT int version();

class Ancestor;
class PartMetaData;
class CachePolicy;
class HelloResponse;
class LoginCommand;
class LoginResponse;
class LogoutCommand;
class LogoutResponse;
class TransactionCommand;
class TransactionResponse;
class CreateItemCommand;
class CreateItemResponse;
class CopyItemsCommand;
class CopyItemsResponse;
class DeleteItemsCommand;
class DeleteItemsResponse;
class FetchRelationsCommand;
class FetchRelationsResponse;
class FetchTagsCommand;
class FetchTagsResponse;
class FetchItemsCommand;
class FetchItemsResponse;
class LinkItemsCommand;
class LinkItemsResponse;
class ModifyItemsCommand;
class ModifyItemsResponse;
class MoveItemsCommand;
class MoveItemsResponse;
class CreateCollectionCommand;
class CreateCollectionResponse;
class CopyCollectionCommand;
class CopyCollectionResponse;
class DeleteCollectionCommand;
class DeleteCollectionResponse;
class FetchCollectionStatsCommand;
class FetchCollectionStatsResponse;
class FetchCollectionsCommand;
class FetchCollectionsResponse;
class ModifyCollectionCommand;
class ModifyCollectionResponse;
class MoveCollectionCommand;
class MoveCollectionResponse;
class SearchCommand;
class SearchResponse;
class SearchResultCommand;
class SearchResultResponse;
class StoreSearchCommand;
class StoreSearchResponse;
class CreateTagCommand;
class CreateTagResponse;
class DeleteTagCommand;
class DeleteTagResponse;
class ModifyTagCommand;
class ModifyTagResponse;
class ModifyRelationCommand;
class ModifyRelationResponse;
class RemoveRelationsCommand;
class RemoveRelationsResponse;
class SelectResourceCommand;
class SelectResourceResponse;
class StreamPayloadCommand;
class StreamPayloadResponse;
class ItemChangeNotification;
class CollectionChangeNotification;
class TagChangeNotification;
class RelationChangeNotification;
class CreateSubscriptionCommand;
class CreateSubscriptionResponse;
class ModifySubscriptionCommand;
class ModifySubscriptionResponse;
class SubscriptionChangeNotification;
class DebugChangeNotification;

} // namespace Protocol
} // namespace Akonadi

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const Ancestor &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, Ancestor &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Ancestor &obj);

using AncestorPtr = QSharedPointer<Ancestor>;

class AKONADIPRIVATE_EXPORT Ancestor
{

public:
    enum Depth {
        NoAncestor,
        ParentAncestor,
        AllAncestors,
    };
    explicit Ancestor();
    explicit Ancestor(qint64 id, const QString &remoteId = QString());
    Ancestor(const Ancestor &other);
    ~Ancestor();

    Ancestor &operator=(const Ancestor &other);
    bool operator==(const Ancestor &other) const;
    inline bool operator!=(const Ancestor &other) const { return !operator==(other); }
    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString name() const { return mName; }
    inline void setName(const QString &name) { mName = name; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

protected:
    qint64 mId;
    QString mRemoteId;
    QString mName;
    Akonadi::Protocol::Attributes mAttributes;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::Ancestor &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::Ancestor &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::Ancestor &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::Ancestor)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const PartMetaData &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, PartMetaData &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const PartMetaData &obj);

using PartMetaDataPtr = QSharedPointer<PartMetaData>;

class AKONADIPRIVATE_EXPORT PartMetaData
{

public:
    enum StorageType {
        Internal,
        External,
        Foreign,
    };
    explicit PartMetaData();
    explicit PartMetaData(const QByteArray &name, qint64 size, int version = 0, const PartMetaData::StorageType &storageType = Internal);
    PartMetaData(const PartMetaData &other);
    ~PartMetaData();

    PartMetaData &operator=(const PartMetaData &other);
    bool operator==(const PartMetaData &other) const;
    inline bool operator!=(const PartMetaData &other) const { return !operator==(other); }
    inline QByteArray name() const { return mName; }
    inline void setName(const QByteArray &name) { mName = name; }

    inline qint64 size() const { return mSize; }
    inline void setSize(qint64 size) { mSize = size; }

    inline int version() const { return mVersion; }
    inline void setVersion(int version) { mVersion = version; }

    inline PartMetaData::StorageType storageType() const { return mStorageType; }
    inline void setStorageType(const PartMetaData::StorageType &storageType) { mStorageType = storageType; }

protected:
    qint64 mSize;
    QByteArray mName;
    int mVersion;
    PartMetaData::StorageType mStorageType;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::PartMetaData &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::PartMetaData &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::PartMetaData &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::PartMetaData)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CachePolicy &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CachePolicy &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CachePolicy &obj);

using CachePolicyPtr = QSharedPointer<CachePolicy>;

class AKONADIPRIVATE_EXPORT CachePolicy
{

public:
    explicit CachePolicy();
    CachePolicy(const CachePolicy &other);
    ~CachePolicy();

    CachePolicy &operator=(const CachePolicy &other);
    bool operator==(const CachePolicy &other) const;
    inline bool operator!=(const CachePolicy &other) const { return !operator==(other); }
    inline bool inherit() const { return mInherit; }
    inline void setInherit(bool inherit) { mInherit = inherit; }

    inline int checkInterval() const { return mCheckInterval; }
    inline void setCheckInterval(int checkInterval) { mCheckInterval = checkInterval; }

    inline int cacheTimeout() const { return mCacheTimeout; }
    inline void setCacheTimeout(int cacheTimeout) { mCacheTimeout = cacheTimeout; }

    inline bool syncOnDemand() const { return mSyncOnDemand; }
    inline void setSyncOnDemand(bool syncOnDemand) { mSyncOnDemand = syncOnDemand; }

    inline QStringList localParts() const { return mLocalParts; }
    inline void setLocalParts(const QStringList &localParts) { mLocalParts = localParts; }

protected:
    int mCheckInterval;
    int mCacheTimeout;
    QStringList mLocalParts;
    bool mInherit;
    bool mSyncOnDemand;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CachePolicy &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CachePolicy &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CachePolicy &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CachePolicy)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const HelloResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, HelloResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const HelloResponse &obj);

using HelloResponsePtr = QSharedPointer<HelloResponse>;

class AKONADIPRIVATE_EXPORT HelloResponse : public Response
{

public:
    explicit HelloResponse();
    HelloResponse(const HelloResponse &other);
    ~HelloResponse();

    HelloResponse &operator=(const HelloResponse &other);
    bool operator==(const HelloResponse &other) const;
    inline bool operator!=(const HelloResponse &other) const { return !operator==(other); }
    inline QString serverName() const { return mServerName; }
    inline void setServerName(const QString &serverName) { mServerName = serverName; }

    inline QString message() const { return mMessage; }
    inline void setMessage(const QString &message) { mMessage = message; }

    inline int protocolVersion() const { return mProtocolVersion; }
    inline void setProtocolVersion(int protocolVersion) { mProtocolVersion = protocolVersion; }

    inline uint generation() const { return mGeneration; }
    inline void setGeneration(uint generation) { mGeneration = generation; }

protected:
    QString mServerName;
    QString mMessage;
    int mProtocolVersion;
    uint mGeneration;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::HelloResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::HelloResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::HelloResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::HelloResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::HelloResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LoginCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LoginCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LoginCommand &obj);

using LoginCommandPtr = QSharedPointer<LoginCommand>;

class AKONADIPRIVATE_EXPORT LoginCommand : public Command
{

public:
    explicit LoginCommand();
    explicit LoginCommand(const QByteArray &sessionId);
    LoginCommand(const LoginCommand &other);
    ~LoginCommand();

    LoginCommand &operator=(const LoginCommand &other);
    bool operator==(const LoginCommand &other) const;
    inline bool operator!=(const LoginCommand &other) const { return !operator==(other); }
    inline QByteArray sessionId() const { return mSessionId; }
    inline void setSessionId(const QByteArray &sessionId) { mSessionId = sessionId; }

protected:
    QByteArray mSessionId;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LoginCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LoginCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LoginCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LoginCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::LoginCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LoginResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LoginResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LoginResponse &obj);

using LoginResponsePtr = QSharedPointer<LoginResponse>;

class AKONADIPRIVATE_EXPORT LoginResponse : public Response
{

public:
    explicit LoginResponse();
    LoginResponse(const LoginResponse &other);
    ~LoginResponse();

    LoginResponse &operator=(const LoginResponse &other);
    bool operator==(const LoginResponse &other) const;
    inline bool operator!=(const LoginResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LoginResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LoginResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LoginResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LoginResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::LoginResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LogoutCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LogoutCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LogoutCommand &obj);

using LogoutCommandPtr = QSharedPointer<LogoutCommand>;

class AKONADIPRIVATE_EXPORT LogoutCommand : public Command
{

public:
    explicit LogoutCommand();
    LogoutCommand(const LogoutCommand &other);
    ~LogoutCommand();

    LogoutCommand &operator=(const LogoutCommand &other);
    bool operator==(const LogoutCommand &other) const;
    inline bool operator!=(const LogoutCommand &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LogoutCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LogoutCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LogoutCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LogoutCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::LogoutCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LogoutResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LogoutResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LogoutResponse &obj);

using LogoutResponsePtr = QSharedPointer<LogoutResponse>;

class AKONADIPRIVATE_EXPORT LogoutResponse : public Response
{

public:
    explicit LogoutResponse();
    LogoutResponse(const LogoutResponse &other);
    ~LogoutResponse();

    LogoutResponse &operator=(const LogoutResponse &other);
    bool operator==(const LogoutResponse &other) const;
    inline bool operator!=(const LogoutResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LogoutResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LogoutResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LogoutResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LogoutResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::LogoutResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const TransactionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, TransactionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const TransactionCommand &obj);

using TransactionCommandPtr = QSharedPointer<TransactionCommand>;

class AKONADIPRIVATE_EXPORT TransactionCommand : public Command
{

public:
    enum Mode {
        Invalid = 0,
        Begin,
        Commit,
        Rollback,
    };
    explicit TransactionCommand();
    explicit TransactionCommand(const TransactionCommand::Mode &mode);
    TransactionCommand(const TransactionCommand &other);
    ~TransactionCommand();

    TransactionCommand &operator=(const TransactionCommand &other);
    bool operator==(const TransactionCommand &other) const;
    inline bool operator!=(const TransactionCommand &other) const { return !operator==(other); }
    inline TransactionCommand::Mode mode() const { return mMode; }
    inline void setMode(const TransactionCommand::Mode &mode) { mMode = mode; }

protected:
    TransactionCommand::Mode mMode;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::TransactionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::TransactionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::TransactionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::TransactionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::TransactionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const TransactionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, TransactionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const TransactionResponse &obj);

using TransactionResponsePtr = QSharedPointer<TransactionResponse>;

class AKONADIPRIVATE_EXPORT TransactionResponse : public Response
{

public:
    explicit TransactionResponse();
    TransactionResponse(const TransactionResponse &other);
    ~TransactionResponse();

    TransactionResponse &operator=(const TransactionResponse &other);
    bool operator==(const TransactionResponse &other) const;
    inline bool operator!=(const TransactionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::TransactionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::TransactionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::TransactionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::TransactionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::TransactionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateItemCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateItemCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateItemCommand &obj);

using CreateItemCommandPtr = QSharedPointer<CreateItemCommand>;

class AKONADIPRIVATE_EXPORT CreateItemCommand : public Command
{

public:
    enum MergeMode {
        None = 0,
        GID = 1,
        RemoteID = 2,
        Silent = 4,
    };
    Q_DECLARE_FLAGS(MergeModes, MergeMode)

    explicit CreateItemCommand();
    CreateItemCommand(const CreateItemCommand &other);
    ~CreateItemCommand();

    CreateItemCommand &operator=(const CreateItemCommand &other);
    bool operator==(const CreateItemCommand &other) const;
    inline bool operator!=(const CreateItemCommand &other) const { return !operator==(other); }
    inline CreateItemCommand::MergeModes mergeModes() const { return mMergeModes; }
    inline void setMergeModes(const CreateItemCommand::MergeModes &mergeModes) { mMergeModes = mergeModes; }

    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

    inline qint64 itemSize() const { return mItemSize; }
    inline void setItemSize(qint64 itemSize) { mItemSize = itemSize; }

    inline QString mimeType() const { return mMimeType; }
    inline void setMimeType(const QString &mimeType) { mMimeType = mimeType; }

    inline QString gid() const { return mGid; }
    inline void setGid(const QString &gid) { mGid = gid; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString remoteRevision() const { return mRemoteRevision; }
    inline void setRemoteRevision(const QString &remoteRevision) { mRemoteRevision = remoteRevision; }

    inline QDateTime dateTime() const { return mDateTime; }
    inline void setDateTime(const QDateTime &dateTime) { mDateTime = dateTime; }

    inline QSet<QByteArray> flags() const { return mFlags; }
    inline void setFlags(const QSet<QByteArray> &flags) { mFlags = flags; }

    inline QSet<QByteArray> addedFlags() const { return mAddedFlags; }
    inline void setAddedFlags(const QSet<QByteArray> &addedFlags) { mAddedFlags = addedFlags; }

    inline QSet<QByteArray> removedFlags() const { return mRemovedFlags; }
    inline void setRemovedFlags(const QSet<QByteArray> &removedFlags) { mRemovedFlags = removedFlags; }

    inline Scope tags() const { return mTags; }
    inline void setTags(const Scope &tags) { mTags = tags; }

    inline Scope addedTags() const { return mAddedTags; }
    inline void setAddedTags(const Scope &addedTags) { mAddedTags = addedTags; }

    inline Scope removedTags() const { return mRemovedTags; }
    inline void setRemovedTags(const Scope &removedTags) { mRemovedTags = removedTags; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

    inline QSet<QByteArray> parts() const { return mParts; }
    inline void setParts(const QSet<QByteArray> &parts) { mParts = parts; }

    inline bool flagsOverwritten() const { return mFlagsOverwritten; }
    inline void setFlagsOverwritten(bool flagsOverwritten) { mFlagsOverwritten = flagsOverwritten; }

protected:
    qint64 mItemSize;
    Scope mCollection;
    QSet<QByteArray> mParts;
    Akonadi::Protocol::Attributes mAttributes;
    Scope mRemovedTags;
    Scope mAddedTags;
    Scope mTags;
    QSet<QByteArray> mRemovedFlags;
    QSet<QByteArray> mAddedFlags;
    QSet<QByteArray> mFlags;
    QDateTime mDateTime;
    QString mRemoteRevision;
    QString mRemoteId;
    QString mGid;
    QString mMimeType;
    CreateItemCommand::MergeModes mMergeModes;
    bool mFlagsOverwritten;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateItemCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateItemCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateItemCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateItemCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateItemCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateItemResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateItemResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateItemResponse &obj);

using CreateItemResponsePtr = QSharedPointer<CreateItemResponse>;

class AKONADIPRIVATE_EXPORT CreateItemResponse : public Response
{

public:
    explicit CreateItemResponse();
    CreateItemResponse(const CreateItemResponse &other);
    ~CreateItemResponse();

    CreateItemResponse &operator=(const CreateItemResponse &other);
    bool operator==(const CreateItemResponse &other) const;
    inline bool operator!=(const CreateItemResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateItemResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateItemResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateItemResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateItemResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateItemResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CopyItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CopyItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CopyItemsCommand &obj);

using CopyItemsCommandPtr = QSharedPointer<CopyItemsCommand>;

class AKONADIPRIVATE_EXPORT CopyItemsCommand : public Command
{

public:
    explicit CopyItemsCommand();
    explicit CopyItemsCommand(const Scope &items, const Scope &destination);
    CopyItemsCommand(const CopyItemsCommand &other);
    ~CopyItemsCommand();

    CopyItemsCommand &operator=(const CopyItemsCommand &other);
    bool operator==(const CopyItemsCommand &other) const;
    inline bool operator!=(const CopyItemsCommand &other) const { return !operator==(other); }
    inline Scope items() const { return mItems; }
    inline void setItems(const Scope &items) { mItems = items; }

    inline Scope destination() const { return mDestination; }
    inline void setDestination(const Scope &destination) { mDestination = destination; }

protected:
    Scope mItems;
    Scope mDestination;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CopyItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CopyItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CopyItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CopyItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CopyItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CopyItemsResponse &obj);

using CopyItemsResponsePtr = QSharedPointer<CopyItemsResponse>;

class AKONADIPRIVATE_EXPORT CopyItemsResponse : public Response
{

public:
    explicit CopyItemsResponse();
    CopyItemsResponse(const CopyItemsResponse &other);
    ~CopyItemsResponse();

    CopyItemsResponse &operator=(const CopyItemsResponse &other);
    bool operator==(const CopyItemsResponse &other) const;
    inline bool operator!=(const CopyItemsResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CopyItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CopyItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CopyItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteItemsCommand &obj);

using DeleteItemsCommandPtr = QSharedPointer<DeleteItemsCommand>;

class AKONADIPRIVATE_EXPORT DeleteItemsCommand : public Command
{

public:
    explicit DeleteItemsCommand();
    explicit DeleteItemsCommand(const Scope &items, const Akonadi::Protocol::ScopeContext &scopeContext = ScopeContext());
    DeleteItemsCommand(const DeleteItemsCommand &other);
    ~DeleteItemsCommand();

    DeleteItemsCommand &operator=(const DeleteItemsCommand &other);
    bool operator==(const DeleteItemsCommand &other) const;
    inline bool operator!=(const DeleteItemsCommand &other) const { return !operator==(other); }
    inline Scope items() const { return mItems; }
    inline void setItems(const Scope &items) { mItems = items; }

    inline Akonadi::Protocol::ScopeContext scopeContext() const { return mScopeContext; }
    inline void setScopeContext(const Akonadi::Protocol::ScopeContext &scopeContext) { mScopeContext = scopeContext; }

protected:
    Scope mItems;
    Akonadi::Protocol::ScopeContext mScopeContext;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteItemsResponse &obj);

using DeleteItemsResponsePtr = QSharedPointer<DeleteItemsResponse>;

class AKONADIPRIVATE_EXPORT DeleteItemsResponse : public Response
{

public:
    explicit DeleteItemsResponse();
    DeleteItemsResponse(const DeleteItemsResponse &other);
    ~DeleteItemsResponse();

    DeleteItemsResponse &operator=(const DeleteItemsResponse &other);
    bool operator==(const DeleteItemsResponse &other) const;
    inline bool operator!=(const DeleteItemsResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchRelationsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchRelationsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchRelationsCommand &obj);

using FetchRelationsCommandPtr = QSharedPointer<FetchRelationsCommand>;

class AKONADIPRIVATE_EXPORT FetchRelationsCommand : public Command
{

public:
    explicit FetchRelationsCommand();
    explicit FetchRelationsCommand(qint64 left, qint64 right, const QVector<QByteArray> &types = QVector<QByteArray>(), const QString &resource = QString());
    explicit FetchRelationsCommand(qint64 side, const QVector<QByteArray> &types = QVector<QByteArray>(), const QString &resource = QString());
    FetchRelationsCommand(const FetchRelationsCommand &other);
    ~FetchRelationsCommand();

    FetchRelationsCommand &operator=(const FetchRelationsCommand &other);
    bool operator==(const FetchRelationsCommand &other) const;
    inline bool operator!=(const FetchRelationsCommand &other) const { return !operator==(other); }
    inline qint64 left() const { return mLeft; }
    inline void setLeft(qint64 left) { mLeft = left; }

    inline qint64 right() const { return mRight; }
    inline void setRight(qint64 right) { mRight = right; }

    inline qint64 side() const { return mSide; }
    inline void setSide(qint64 side) { mSide = side; }

    inline QVector<QByteArray> types() const { return mTypes; }
    inline void setTypes(const QVector<QByteArray> &types) { mTypes = types; }

    inline QString resource() const { return mResource; }
    inline void setResource(const QString &resource) { mResource = resource; }

protected:
    qint64 mLeft;
    qint64 mRight;
    qint64 mSide;
    QVector<QByteArray> mTypes;
    QString mResource;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchRelationsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchRelationsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchRelationsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchRelationsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchRelationsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchRelationsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchRelationsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchRelationsResponse &obj);

using FetchRelationsResponsePtr = QSharedPointer<FetchRelationsResponse>;

class AKONADIPRIVATE_EXPORT FetchRelationsResponse : public Response
{

public:
    explicit FetchRelationsResponse();
    explicit FetchRelationsResponse(qint64 left, const QByteArray &leftMimeType, qint64 right, const QByteArray &rightMimeType, const QByteArray &type, const QByteArray &remoteId = QByteArray());
    FetchRelationsResponse(const FetchRelationsResponse &other);
    ~FetchRelationsResponse();

    FetchRelationsResponse &operator=(const FetchRelationsResponse &other);
    bool operator==(const FetchRelationsResponse &other) const;
    inline bool operator!=(const FetchRelationsResponse &other) const { return !operator==(other); }
    inline qint64 left() const { return mLeft; }
    inline void setLeft(qint64 left) { mLeft = left; }

    inline QByteArray leftMimeType() const { return mLeftMimeType; }
    inline void setLeftMimeType(const QByteArray &leftMimeType) { mLeftMimeType = leftMimeType; }

    inline qint64 right() const { return mRight; }
    inline void setRight(qint64 right) { mRight = right; }

    inline QByteArray rightMimeType() const { return mRightMimeType; }
    inline void setRightMimeType(const QByteArray &rightMimeType) { mRightMimeType = rightMimeType; }

    inline QByteArray type() const { return mType; }
    inline void setType(const QByteArray &type) { mType = type; }

    inline QByteArray remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QByteArray &remoteId) { mRemoteId = remoteId; }

protected:
    qint64 mLeft;
    qint64 mRight;
    QByteArray mLeftMimeType;
    QByteArray mRightMimeType;
    QByteArray mType;
    QByteArray mRemoteId;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchRelationsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchRelationsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchRelationsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchRelationsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchRelationsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchTagsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchTagsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchTagsCommand &obj);

using FetchTagsCommandPtr = QSharedPointer<FetchTagsCommand>;

class AKONADIPRIVATE_EXPORT FetchTagsCommand : public Command
{

public:
    explicit FetchTagsCommand();
    explicit FetchTagsCommand(const Scope &scope);
    FetchTagsCommand(const FetchTagsCommand &other);
    ~FetchTagsCommand();

    FetchTagsCommand &operator=(const FetchTagsCommand &other);
    bool operator==(const FetchTagsCommand &other) const;
    inline bool operator!=(const FetchTagsCommand &other) const { return !operator==(other); }
    inline Scope scope() const { return mScope; }
    inline void setScope(const Scope &scope) { mScope = scope; }

    inline QSet<QByteArray> attributes() const { return mAttributes; }
    inline void setAttributes(const QSet<QByteArray> &attributes) { mAttributes = attributes; }

    inline bool idOnly() const { return mIdOnly; }
    inline void setIdOnly(bool idOnly) { mIdOnly = idOnly; }

protected:
    Scope mScope;
    QSet<QByteArray> mAttributes;
    bool mIdOnly;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchTagsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchTagsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchTagsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchTagsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchTagsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchTagsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchTagsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchTagsResponse &obj);

using FetchTagsResponsePtr = QSharedPointer<FetchTagsResponse>;

class AKONADIPRIVATE_EXPORT FetchTagsResponse : public Response
{

public:
    explicit FetchTagsResponse();
    explicit FetchTagsResponse(qint64 id);
    explicit FetchTagsResponse(qint64 id, const QByteArray &gid, const QByteArray &type, const QByteArray &remoteId = QByteArray(), qint64 parentId = 0, const Akonadi::Protocol::Attributes &attributes = Attributes());
    FetchTagsResponse(const FetchTagsResponse &other);
    ~FetchTagsResponse();

    FetchTagsResponse &operator=(const FetchTagsResponse &other);
    bool operator==(const FetchTagsResponse &other) const;
    inline bool operator!=(const FetchTagsResponse &other) const { return !operator==(other); }
    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline qint64 parentId() const { return mParentId; }
    inline void setParentId(qint64 parentId) { mParentId = parentId; }

    inline QByteArray gid() const { return mGid; }
    inline void setGid(const QByteArray &gid) { mGid = gid; }

    inline QByteArray type() const { return mType; }
    inline void setType(const QByteArray &type) { mType = type; }

    inline QByteArray remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QByteArray &remoteId) { mRemoteId = remoteId; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

protected:
    qint64 mId;
    qint64 mParentId;
    QByteArray mGid;
    QByteArray mType;
    QByteArray mRemoteId;
    Akonadi::Protocol::Attributes mAttributes;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchTagsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchTagsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchTagsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchTagsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchTagsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchItemsCommand &obj);

using FetchItemsCommandPtr = QSharedPointer<FetchItemsCommand>;

class AKONADIPRIVATE_EXPORT FetchItemsCommand : public Command
{

public:
    explicit FetchItemsCommand();
    explicit FetchItemsCommand(const Scope &scope, const Akonadi::Protocol::ScopeContext &scopeContext = ScopeContext(), const Akonadi::Protocol::FetchScope &fetchScope = FetchScope());
    FetchItemsCommand(const FetchItemsCommand &other);
    ~FetchItemsCommand();

    FetchItemsCommand &operator=(const FetchItemsCommand &other);
    bool operator==(const FetchItemsCommand &other) const;
    inline bool operator!=(const FetchItemsCommand &other) const { return !operator==(other); }
    inline Scope scope() const { return mScope; }
    inline void setScope(const Scope &scope) { mScope = scope; }

    inline Akonadi::Protocol::ScopeContext scopeContext() const { return mScopeContext; }
    inline void setScopeContext(const Akonadi::Protocol::ScopeContext &scopeContext) { mScopeContext = scopeContext; }

    inline Akonadi::Protocol::FetchScope fetchScope() const { return mFetchScope; }
    inline void setFetchScope(const Akonadi::Protocol::FetchScope &fetchScope) { mFetchScope = fetchScope; }

protected:
    Scope mScope;
    Akonadi::Protocol::ScopeContext mScopeContext;
    Akonadi::Protocol::FetchScope mFetchScope;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchItemsResponse &obj);

using FetchItemsResponsePtr = QSharedPointer<FetchItemsResponse>;

class AKONADIPRIVATE_EXPORT FetchItemsResponse : public Response
{

public:
    explicit FetchItemsResponse();
    explicit FetchItemsResponse(qint64 id);
    FetchItemsResponse(const FetchItemsResponse &other);
    ~FetchItemsResponse();

    FetchItemsResponse &operator=(const FetchItemsResponse &other);
    bool operator==(const FetchItemsResponse &other) const;
    inline bool operator!=(const FetchItemsResponse &other) const { return !operator==(other); }
    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline int revision() const { return mRevision; }
    inline void setRevision(int revision) { mRevision = revision; }

    inline qint64 parentId() const { return mParentId; }
    inline void setParentId(qint64 parentId) { mParentId = parentId; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString remoteRevision() const { return mRemoteRevision; }
    inline void setRemoteRevision(const QString &remoteRevision) { mRemoteRevision = remoteRevision; }

    inline QString gid() const { return mGid; }
    inline void setGid(const QString &gid) { mGid = gid; }

    inline qint64 size() const { return mSize; }
    inline void setSize(qint64 size) { mSize = size; }

    inline QString mimeType() const { return mMimeType; }
    inline void setMimeType(const QString &mimeType) { mMimeType = mimeType; }

    inline QDateTime mTime() const { return mMTime; }
    inline void setMTime(const QDateTime &mTime) { mMTime = mTime; }

    inline QVector<QByteArray> flags() const { return mFlags; }
    inline void setFlags(const QVector<QByteArray> &flags) { mFlags = flags; }

    inline QVector<Akonadi::Protocol::FetchTagsResponse> tags() const { return mTags; }
    inline void setTags(const QVector<Akonadi::Protocol::FetchTagsResponse> &tags) { mTags = tags; }

    inline QVector<qint64> virtualReferences() const { return mVirtualReferences; }
    inline void setVirtualReferences(const QVector<qint64> &virtualReferences) { mVirtualReferences = virtualReferences; }

    inline QVector<Akonadi::Protocol::FetchRelationsResponse> relations() const { return mRelations; }
    inline void setRelations(const QVector<Akonadi::Protocol::FetchRelationsResponse> &relations) { mRelations = relations; }

    inline QVector<Akonadi::Protocol::Ancestor> ancestors() const { return mAncestors; }
    inline void setAncestors(const QVector<Akonadi::Protocol::Ancestor> &ancestors) { mAncestors = ancestors; }

    inline QVector<Akonadi::Protocol::StreamPayloadResponse> parts() const { return mParts; }
    inline void setParts(const QVector<Akonadi::Protocol::StreamPayloadResponse> &parts) { mParts = parts; }

    inline QVector<QByteArray> cachedParts() const { return mCachedParts; }
    inline void setCachedParts(const QVector<QByteArray> &cachedParts) { mCachedParts = cachedParts; }

protected:
    qint64 mId;
    qint64 mParentId;
    qint64 mSize;
    int mRevision;
    QString mRemoteId;
    QString mRemoteRevision;
    QString mGid;
    QString mMimeType;
    QDateTime mMTime;
    QVector<QByteArray> mFlags;
    QVector<Akonadi::Protocol::FetchTagsResponse> mTags;
    QVector<qint64> mVirtualReferences;
    QVector<Akonadi::Protocol::FetchRelationsResponse> mRelations;
    QVector<Akonadi::Protocol::Ancestor> mAncestors;
    QVector<Akonadi::Protocol::StreamPayloadResponse> mParts;
    QVector<QByteArray> mCachedParts;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LinkItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LinkItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LinkItemsCommand &obj);

using LinkItemsCommandPtr = QSharedPointer<LinkItemsCommand>;

class AKONADIPRIVATE_EXPORT LinkItemsCommand : public Command
{

public:
    enum Action {
        Link,
        Unlink,
    };
    explicit LinkItemsCommand();
    explicit LinkItemsCommand(const LinkItemsCommand::Action &action, const Scope &items, const Scope &destination);
    LinkItemsCommand(const LinkItemsCommand &other);
    ~LinkItemsCommand();

    LinkItemsCommand &operator=(const LinkItemsCommand &other);
    bool operator==(const LinkItemsCommand &other) const;
    inline bool operator!=(const LinkItemsCommand &other) const { return !operator==(other); }
    inline Scope items() const { return mItems; }
    inline void setItems(const Scope &items) { mItems = items; }

    inline Scope destination() const { return mDestination; }
    inline void setDestination(const Scope &destination) { mDestination = destination; }

    inline LinkItemsCommand::Action action() const { return mAction; }
    inline void setAction(const LinkItemsCommand::Action &action) { mAction = action; }

protected:
    Scope mItems;
    Scope mDestination;
    LinkItemsCommand::Action mAction;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LinkItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LinkItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LinkItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LinkItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::LinkItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const LinkItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, LinkItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const LinkItemsResponse &obj);

using LinkItemsResponsePtr = QSharedPointer<LinkItemsResponse>;

class AKONADIPRIVATE_EXPORT LinkItemsResponse : public Response
{

public:
    explicit LinkItemsResponse();
    LinkItemsResponse(const LinkItemsResponse &other);
    ~LinkItemsResponse();

    LinkItemsResponse &operator=(const LinkItemsResponse &other);
    bool operator==(const LinkItemsResponse &other) const;
    inline bool operator!=(const LinkItemsResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::LinkItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::LinkItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::LinkItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::LinkItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::LinkItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyItemsCommand &obj);

using ModifyItemsCommandPtr = QSharedPointer<ModifyItemsCommand>;

class AKONADIPRIVATE_EXPORT ModifyItemsCommand : public Command
{

public:
    enum ModifiedPart {
        None = 0,
        Flags = 1,
        AddedFlags = 2,
        RemovedFlags = 4,
        Tags = 8,
        AddedTags = 16,
        RemovedTags = 32,
        RemoteID = 64,
        RemoteRevision = 128,
        GID = 256,
        Size = 512,
        Parts = 1024,
        RemovedParts = 2048,
        Attributes = 4096,
    };
    Q_DECLARE_FLAGS(ModifiedParts, ModifiedPart)

    explicit ModifyItemsCommand();
    explicit ModifyItemsCommand(const Scope &items);
    ModifyItemsCommand(const ModifyItemsCommand &other);
    ~ModifyItemsCommand();

    ModifyItemsCommand &operator=(const ModifyItemsCommand &other);
    bool operator==(const ModifyItemsCommand &other) const;
    inline bool operator!=(const ModifyItemsCommand &other) const { return !operator==(other); }
    inline ModifyItemsCommand::ModifiedParts modifiedParts() const { return mModifiedParts; }
    inline void setModifiedParts(const ModifyItemsCommand::ModifiedParts &modifiedParts) { mModifiedParts = modifiedParts; }

    inline Scope items() const { return mItems; }
    inline void setItems(const Scope &items) { mItems = items; }

    inline int oldRevision() const { return mOldRevision; }
    inline void setOldRevision(int oldRevision) { mOldRevision = oldRevision; }

    inline QSet<QByteArray> flags() const { return mFlags; }
    void setFlags(const QSet<QByteArray> &flags);

    inline QSet<QByteArray> addedFlags() const { return mAddedFlags; }
    void setAddedFlags(const QSet<QByteArray> &addedFlags);

    inline QSet<QByteArray> removedFlags() const { return mRemovedFlags; }
    void setRemovedFlags(const QSet<QByteArray> &removedFlags);

    inline Scope tags() const { return mTags; }
    void setTags(const Scope &tags);

    inline Scope addedTags() const { return mAddedTags; }
    void setAddedTags(const Scope &addedTags);

    inline Scope removedTags() const { return mRemovedTags; }
    void setRemovedTags(const Scope &removedTags);

    inline QString remoteId() const { return mRemoteId; }
    void setRemoteId(const QString &remoteId);

    inline QString gid() const { return mGid; }
    void setGid(const QString &gid);

    inline QString remoteRevision() const { return mRemoteRevision; }
    void setRemoteRevision(const QString &remoteRevision);

    inline bool dirty() const { return mDirty; }
    inline void setDirty(bool dirty) { mDirty = dirty; }

    inline bool invalidateCache() const { return mInvalidateCache; }
    inline void setInvalidateCache(bool invalidateCache) { mInvalidateCache = invalidateCache; }

    inline bool noResponse() const { return mNoResponse; }
    inline void setNoResponse(bool noResponse) { mNoResponse = noResponse; }

    inline bool notify() const { return mNotify; }
    inline void setNotify(bool notify) { mNotify = notify; }

    inline qint64 itemSize() const { return mItemSize; }
    void setItemSize(qint64 itemSize);

    inline QSet<QByteArray> removedParts() const { return mRemovedParts; }
    void setRemovedParts(const QSet<QByteArray> &removedParts);

    inline QSet<QByteArray> parts() const { return mParts; }
    void setParts(const QSet<QByteArray> &parts);

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    void setAttributes(const Akonadi::Protocol::Attributes &attributes);

protected:
    qint64 mItemSize;
    QString mGid;
    Akonadi::Protocol::Attributes mAttributes;
    QSet<QByteArray> mParts;
    QSet<QByteArray> mRemovedParts;
    QString mRemoteRevision;
    ModifyItemsCommand::ModifiedParts mModifiedParts;
    QString mRemoteId;
    Scope mRemovedTags;
    Scope mAddedTags;
    Scope mTags;
    QSet<QByteArray> mRemovedFlags;
    QSet<QByteArray> mAddedFlags;
    QSet<QByteArray> mFlags;
    int mOldRevision;
    Scope mItems;
    bool mDirty;
    bool mInvalidateCache;
    bool mNoResponse;
    bool mNotify;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyItemsResponse &obj);

using ModifyItemsResponsePtr = QSharedPointer<ModifyItemsResponse>;

class AKONADIPRIVATE_EXPORT ModifyItemsResponse : public Response
{

public:
    explicit ModifyItemsResponse();
    explicit ModifyItemsResponse(qint64 id, int newRevision);
    ModifyItemsResponse(const ModifyItemsResponse &other);
    ~ModifyItemsResponse();

    ModifyItemsResponse &operator=(const ModifyItemsResponse &other);
    bool operator==(const ModifyItemsResponse &other) const;
    inline bool operator!=(const ModifyItemsResponse &other) const { return !operator==(other); }
    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline int newRevision() const { return mNewRevision; }
    inline void setNewRevision(int newRevision) { mNewRevision = newRevision; }

    inline QDateTime modificationDateTime() const { return mModificationDateTime; }
    inline void setModificationDateTime(const QDateTime &modificationDateTime) { mModificationDateTime = modificationDateTime; }

protected:
    qint64 mId;
    int mNewRevision;
    QDateTime mModificationDateTime;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const MoveItemsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, MoveItemsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const MoveItemsCommand &obj);

using MoveItemsCommandPtr = QSharedPointer<MoveItemsCommand>;

class AKONADIPRIVATE_EXPORT MoveItemsCommand : public Command
{

public:
    explicit MoveItemsCommand();
    explicit MoveItemsCommand(const Scope &items, const Scope &destination);
    explicit MoveItemsCommand(const Scope &items, const Akonadi::Protocol::ScopeContext &itemsContext, const Scope &destination);
    MoveItemsCommand(const MoveItemsCommand &other);
    ~MoveItemsCommand();

    MoveItemsCommand &operator=(const MoveItemsCommand &other);
    bool operator==(const MoveItemsCommand &other) const;
    inline bool operator!=(const MoveItemsCommand &other) const { return !operator==(other); }
    inline Scope items() const { return mItems; }
    inline void setItems(const Scope &items) { mItems = items; }

    inline Akonadi::Protocol::ScopeContext itemsContext() const { return mItemsContext; }
    inline void setItemsContext(const Akonadi::Protocol::ScopeContext &itemsContext) { mItemsContext = itemsContext; }

    inline Scope destination() const { return mDestination; }
    inline void setDestination(const Scope &destination) { mDestination = destination; }

protected:
    Scope mItems;
    Akonadi::Protocol::ScopeContext mItemsContext;
    Scope mDestination;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::MoveItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::MoveItemsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::MoveItemsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveItemsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveItemsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const MoveItemsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, MoveItemsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const MoveItemsResponse &obj);

using MoveItemsResponsePtr = QSharedPointer<MoveItemsResponse>;

class AKONADIPRIVATE_EXPORT MoveItemsResponse : public Response
{

public:
    explicit MoveItemsResponse();
    MoveItemsResponse(const MoveItemsResponse &other);
    ~MoveItemsResponse();

    MoveItemsResponse &operator=(const MoveItemsResponse &other);
    bool operator==(const MoveItemsResponse &other) const;
    inline bool operator!=(const MoveItemsResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::MoveItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::MoveItemsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::MoveItemsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveItemsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveItemsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateCollectionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateCollectionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateCollectionCommand &obj);

using CreateCollectionCommandPtr = QSharedPointer<CreateCollectionCommand>;

class AKONADIPRIVATE_EXPORT CreateCollectionCommand : public Command
{

public:
    explicit CreateCollectionCommand();
    CreateCollectionCommand(const CreateCollectionCommand &other);
    ~CreateCollectionCommand();

    CreateCollectionCommand &operator=(const CreateCollectionCommand &other);
    bool operator==(const CreateCollectionCommand &other) const;
    inline bool operator!=(const CreateCollectionCommand &other) const { return !operator==(other); }
    inline Scope parent() const { return mParent; }
    inline void setParent(const Scope &parent) { mParent = parent; }

    inline QString name() const { return mName; }
    inline void setName(const QString &name) { mName = name; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString remoteRevision() const { return mRemoteRevision; }
    inline void setRemoteRevision(const QString &remoteRevision) { mRemoteRevision = remoteRevision; }

    inline QStringList mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QStringList &mimeTypes) { mMimeTypes = mimeTypes; }

    inline Akonadi::Protocol::CachePolicy cachePolicy() const { return mCachePolicy; }
    inline void setCachePolicy(const Akonadi::Protocol::CachePolicy &cachePolicy) { mCachePolicy = cachePolicy; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

    inline bool isVirtual() const { return mIsVirtual; }
    inline void setIsVirtual(bool isVirtual) { mIsVirtual = isVirtual; }

    inline bool enabled() const { return mEnabled; }
    inline void setEnabled(bool enabled) { mEnabled = enabled; }

    inline Tristate syncPref() const { return mSyncPref; }
    inline void setSyncPref(const Tristate &syncPref) { mSyncPref = syncPref; }

    inline Tristate displayPref() const { return mDisplayPref; }
    inline void setDisplayPref(const Tristate &displayPref) { mDisplayPref = displayPref; }

    inline Tristate indexPref() const { return mIndexPref; }
    inline void setIndexPref(const Tristate &indexPref) { mIndexPref = indexPref; }

protected:
    Scope mParent;
    QString mName;
    QString mRemoteId;
    QString mRemoteRevision;
    QStringList mMimeTypes;
    Akonadi::Protocol::CachePolicy mCachePolicy;
    Akonadi::Protocol::Attributes mAttributes;
    bool mIsVirtual;
    bool mEnabled;
    Tristate mSyncPref;
    Tristate mDisplayPref;
    Tristate mIndexPref;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateCollectionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateCollectionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateCollectionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateCollectionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateCollectionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateCollectionResponse &obj);

using CreateCollectionResponsePtr = QSharedPointer<CreateCollectionResponse>;

class AKONADIPRIVATE_EXPORT CreateCollectionResponse : public Response
{

public:
    explicit CreateCollectionResponse();
    CreateCollectionResponse(const CreateCollectionResponse &other);
    ~CreateCollectionResponse();

    CreateCollectionResponse &operator=(const CreateCollectionResponse &other);
    bool operator==(const CreateCollectionResponse &other) const;
    inline bool operator!=(const CreateCollectionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateCollectionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateCollectionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateCollectionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CopyCollectionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CopyCollectionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CopyCollectionCommand &obj);

using CopyCollectionCommandPtr = QSharedPointer<CopyCollectionCommand>;

class AKONADIPRIVATE_EXPORT CopyCollectionCommand : public Command
{

public:
    explicit CopyCollectionCommand();
    explicit CopyCollectionCommand(const Scope &collection, const Scope &destination);
    CopyCollectionCommand(const CopyCollectionCommand &other);
    ~CopyCollectionCommand();

    CopyCollectionCommand &operator=(const CopyCollectionCommand &other);
    bool operator==(const CopyCollectionCommand &other) const;
    inline bool operator!=(const CopyCollectionCommand &other) const { return !operator==(other); }
    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

    inline Scope destination() const { return mDestination; }
    inline void setDestination(const Scope &destination) { mDestination = destination; }

protected:
    Scope mCollection;
    Scope mDestination;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CopyCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CopyCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CopyCollectionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyCollectionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyCollectionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CopyCollectionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CopyCollectionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CopyCollectionResponse &obj);

using CopyCollectionResponsePtr = QSharedPointer<CopyCollectionResponse>;

class AKONADIPRIVATE_EXPORT CopyCollectionResponse : public Response
{

public:
    explicit CopyCollectionResponse();
    CopyCollectionResponse(const CopyCollectionResponse &other);
    ~CopyCollectionResponse();

    CopyCollectionResponse &operator=(const CopyCollectionResponse &other);
    bool operator==(const CopyCollectionResponse &other) const;
    inline bool operator!=(const CopyCollectionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CopyCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CopyCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CopyCollectionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyCollectionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CopyCollectionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteCollectionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteCollectionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteCollectionCommand &obj);

using DeleteCollectionCommandPtr = QSharedPointer<DeleteCollectionCommand>;

class AKONADIPRIVATE_EXPORT DeleteCollectionCommand : public Command
{

public:
    explicit DeleteCollectionCommand();
    explicit DeleteCollectionCommand(const Scope &collection);
    DeleteCollectionCommand(const DeleteCollectionCommand &other);
    ~DeleteCollectionCommand();

    DeleteCollectionCommand &operator=(const DeleteCollectionCommand &other);
    bool operator==(const DeleteCollectionCommand &other) const;
    inline bool operator!=(const DeleteCollectionCommand &other) const { return !operator==(other); }
    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

protected:
    Scope mCollection;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteCollectionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteCollectionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteCollectionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteCollectionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteCollectionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteCollectionResponse &obj);

using DeleteCollectionResponsePtr = QSharedPointer<DeleteCollectionResponse>;

class AKONADIPRIVATE_EXPORT DeleteCollectionResponse : public Response
{

public:
    explicit DeleteCollectionResponse();
    DeleteCollectionResponse(const DeleteCollectionResponse &other);
    ~DeleteCollectionResponse();

    DeleteCollectionResponse &operator=(const DeleteCollectionResponse &other);
    bool operator==(const DeleteCollectionResponse &other) const;
    inline bool operator!=(const DeleteCollectionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteCollectionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteCollectionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteCollectionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchCollectionStatsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchCollectionStatsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchCollectionStatsCommand &obj);

using FetchCollectionStatsCommandPtr = QSharedPointer<FetchCollectionStatsCommand>;

class AKONADIPRIVATE_EXPORT FetchCollectionStatsCommand : public Command
{

public:
    explicit FetchCollectionStatsCommand();
    explicit FetchCollectionStatsCommand(const Scope &collection);
    FetchCollectionStatsCommand(const FetchCollectionStatsCommand &other);
    ~FetchCollectionStatsCommand();

    FetchCollectionStatsCommand &operator=(const FetchCollectionStatsCommand &other);
    bool operator==(const FetchCollectionStatsCommand &other) const;
    inline bool operator!=(const FetchCollectionStatsCommand &other) const { return !operator==(other); }
    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

protected:
    Scope mCollection;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchCollectionStatsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchCollectionStatsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchCollectionStatsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionStatsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionStatsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchCollectionStatsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchCollectionStatsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchCollectionStatsResponse &obj);

using FetchCollectionStatsResponsePtr = QSharedPointer<FetchCollectionStatsResponse>;

class AKONADIPRIVATE_EXPORT FetchCollectionStatsResponse : public Response
{

public:
    explicit FetchCollectionStatsResponse();
    explicit FetchCollectionStatsResponse(qint64 count, qint64 unseen, qint64 size);
    FetchCollectionStatsResponse(const FetchCollectionStatsResponse &other);
    ~FetchCollectionStatsResponse();

    FetchCollectionStatsResponse &operator=(const FetchCollectionStatsResponse &other);
    bool operator==(const FetchCollectionStatsResponse &other) const;
    inline bool operator!=(const FetchCollectionStatsResponse &other) const { return !operator==(other); }
    inline qint64 count() const { return mCount; }
    inline void setCount(qint64 count) { mCount = count; }

    inline qint64 unseen() const { return mUnseen; }
    inline void setUnseen(qint64 unseen) { mUnseen = unseen; }

    inline qint64 size() const { return mSize; }
    inline void setSize(qint64 size) { mSize = size; }

protected:
    qint64 mCount;
    qint64 mUnseen;
    qint64 mSize;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchCollectionStatsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchCollectionStatsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchCollectionStatsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionStatsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionStatsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchCollectionsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchCollectionsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchCollectionsCommand &obj);

using FetchCollectionsCommandPtr = QSharedPointer<FetchCollectionsCommand>;

class AKONADIPRIVATE_EXPORT FetchCollectionsCommand : public Command
{

public:
    enum Depth {
        BaseCollection,
        ParentCollection,
        AllCollections,
    };
    explicit FetchCollectionsCommand();
    explicit FetchCollectionsCommand(const Scope &collections);
    FetchCollectionsCommand(const FetchCollectionsCommand &other);
    ~FetchCollectionsCommand();

    FetchCollectionsCommand &operator=(const FetchCollectionsCommand &other);
    bool operator==(const FetchCollectionsCommand &other) const;
    inline bool operator!=(const FetchCollectionsCommand &other) const { return !operator==(other); }
    inline Scope collections() const { return mCollections; }
    inline void setCollections(const Scope &collections) { mCollections = collections; }

    inline FetchCollectionsCommand::Depth depth() const { return mDepth; }
    inline void setDepth(const FetchCollectionsCommand::Depth &depth) { mDepth = depth; }

    inline QString resource() const { return mResource; }
    inline void setResource(const QString &resource) { mResource = resource; }

    inline QStringList mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QStringList &mimeTypes) { mMimeTypes = mimeTypes; }

    inline Akonadi::Protocol::Ancestor::Depth ancestorsDepth() const { return mAncestorsDepth; }
    inline void setAncestorsDepth(const Akonadi::Protocol::Ancestor::Depth &ancestorsDepth) { mAncestorsDepth = ancestorsDepth; }

    inline QSet<QByteArray> ancestorsAttributes() const { return mAncestorsAttributes; }
    inline void setAncestorsAttributes(const QSet<QByteArray> &ancestorsAttributes) { mAncestorsAttributes = ancestorsAttributes; }

    inline bool enabled() const { return mEnabled; }
    inline void setEnabled(bool enabled) { mEnabled = enabled; }

    inline bool syncPref() const { return mSyncPref; }
    inline void setSyncPref(bool syncPref) { mSyncPref = syncPref; }

    inline bool displayPref() const { return mDisplayPref; }
    inline void setDisplayPref(bool displayPref) { mDisplayPref = displayPref; }

    inline bool indexPref() const { return mIndexPref; }
    inline void setIndexPref(bool indexPref) { mIndexPref = indexPref; }

    inline bool fetchStats() const { return mFetchStats; }
    inline void setFetchStats(bool fetchStats) { mFetchStats = fetchStats; }

protected:
    Scope mCollections;
    FetchCollectionsCommand::Depth mDepth;
    QString mResource;
    QStringList mMimeTypes;
    Akonadi::Protocol::Ancestor::Depth mAncestorsDepth;
    QSet<QByteArray> mAncestorsAttributes;
    bool mEnabled;
    bool mSyncPref;
    bool mDisplayPref;
    bool mIndexPref;
    bool mFetchStats;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchCollectionsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchCollectionsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchCollectionsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const FetchCollectionsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, FetchCollectionsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const FetchCollectionsResponse &obj);

using FetchCollectionsResponsePtr = QSharedPointer<FetchCollectionsResponse>;

class AKONADIPRIVATE_EXPORT FetchCollectionsResponse : public Response
{

public:
    explicit FetchCollectionsResponse();
    explicit FetchCollectionsResponse(qint64 id);
    FetchCollectionsResponse(const FetchCollectionsResponse &other);
    ~FetchCollectionsResponse();

    FetchCollectionsResponse &operator=(const FetchCollectionsResponse &other);
    bool operator==(const FetchCollectionsResponse &other) const;
    inline bool operator!=(const FetchCollectionsResponse &other) const { return !operator==(other); }
    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline qint64 parentId() const { return mParentId; }
    inline void setParentId(qint64 parentId) { mParentId = parentId; }

    inline QString name() const { return mName; }
    inline void setName(const QString &name) { mName = name; }

    inline QStringList mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QStringList &mimeTypes) { mMimeTypes = mimeTypes; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString remoteRevision() const { return mRemoteRevision; }
    inline void setRemoteRevision(const QString &remoteRevision) { mRemoteRevision = remoteRevision; }

    inline QString resource() const { return mResource; }
    inline void setResource(const QString &resource) { mResource = resource; }

    inline Akonadi::Protocol::FetchCollectionStatsResponse statistics() const { return mStatistics; }
    inline void setStatistics(const Akonadi::Protocol::FetchCollectionStatsResponse &statistics) { mStatistics = statistics; }

    inline QString searchQuery() const { return mSearchQuery; }
    inline void setSearchQuery(const QString &searchQuery) { mSearchQuery = searchQuery; }

    inline QVector<qint64> searchCollections() const { return mSearchCollections; }
    inline void setSearchCollections(const QVector<qint64> &searchCollections) { mSearchCollections = searchCollections; }

    inline QVector<Akonadi::Protocol::Ancestor> ancestors() const { return mAncestors; }
    inline void setAncestors(const QVector<Akonadi::Protocol::Ancestor> &ancestors) { mAncestors = ancestors; }

    inline Akonadi::Protocol::CachePolicy cachePolicy() const { return mCachePolicy; }
    inline void setCachePolicy(const Akonadi::Protocol::CachePolicy &cachePolicy) { mCachePolicy = cachePolicy; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

    inline bool enabled() const { return mEnabled; }
    inline void setEnabled(bool enabled) { mEnabled = enabled; }

    inline Tristate displayPref() const { return mDisplayPref; }
    inline void setDisplayPref(const Tristate &displayPref) { mDisplayPref = displayPref; }

    inline Tristate syncPref() const { return mSyncPref; }
    inline void setSyncPref(const Tristate &syncPref) { mSyncPref = syncPref; }

    inline Tristate indexPref() const { return mIndexPref; }
    inline void setIndexPref(const Tristate &indexPref) { mIndexPref = indexPref; }

    inline bool referenced() const { return mReferenced; }
    inline void setReferenced(bool referenced) { mReferenced = referenced; }

    inline bool isVirtual() const { return mIsVirtual; }
    inline void setIsVirtual(bool isVirtual) { mIsVirtual = isVirtual; }

protected:
    qint64 mParentId;
    qint64 mId;
    QVector<qint64> mSearchCollections;
    Akonadi::Protocol::Attributes mAttributes;
    Akonadi::Protocol::CachePolicy mCachePolicy;
    QVector<Akonadi::Protocol::Ancestor> mAncestors;
    QString mSearchQuery;
    Akonadi::Protocol::FetchCollectionStatsResponse mStatistics;
    QString mResource;
    QString mRemoteRevision;
    QString mRemoteId;
    QStringList mMimeTypes;
    QString mName;
    bool mEnabled;
    Tristate mDisplayPref;
    Tristate mSyncPref;
    Tristate mIndexPref;
    bool mReferenced;
    bool mIsVirtual;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::FetchCollectionsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::FetchCollectionsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::FetchCollectionsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::FetchCollectionsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyCollectionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyCollectionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyCollectionCommand &obj);

using ModifyCollectionCommandPtr = QSharedPointer<ModifyCollectionCommand>;

class AKONADIPRIVATE_EXPORT ModifyCollectionCommand : public Command
{

public:
    enum ModifiedPart {
        None = 0,
        Name = 1,
        RemoteID = 2,
        RemoteRevision = 4,
        ParentID = 8,
        MimeTypes = 16,
        CachePolicy = 32,
        PersistentSearch = 64,
        RemovedAttributes = 128,
        Attributes = 256,
        ListPreferences = 512,
        Referenced = 1024,
    };
    Q_DECLARE_FLAGS(ModifiedParts, ModifiedPart)

    explicit ModifyCollectionCommand();
    explicit ModifyCollectionCommand(const Scope &collection);
    ModifyCollectionCommand(const ModifyCollectionCommand &other);
    ~ModifyCollectionCommand();

    ModifyCollectionCommand &operator=(const ModifyCollectionCommand &other);
    bool operator==(const ModifyCollectionCommand &other) const;
    inline bool operator!=(const ModifyCollectionCommand &other) const { return !operator==(other); }
    inline ModifyCollectionCommand::ModifiedParts modifiedParts() const { return mModifiedParts; }
    inline void setModifiedParts(const ModifyCollectionCommand::ModifiedParts &modifiedParts) { mModifiedParts = modifiedParts; }

    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

    inline qint64 parentId() const { return mParentId; }
    void setParentId(qint64 parentId);

    inline QStringList mimeTypes() const { return mMimeTypes; }
    void setMimeTypes(const QStringList &mimeTypes);

    inline Akonadi::Protocol::CachePolicy cachePolicy() const { return mCachePolicy; }
    void setCachePolicy(const Akonadi::Protocol::CachePolicy &cachePolicy);

    inline QString name() const { return mName; }
    void setName(const QString &name);

    inline QString remoteId() const { return mRemoteId; }
    void setRemoteId(const QString &remoteId);

    inline QString remoteRevision() const { return mRemoteRevision; }
    void setRemoteRevision(const QString &remoteRevision);

    inline QString persistentSearchQuery() const { return mPersistentSearchQuery; }
    void setPersistentSearchQuery(const QString &persistentSearchQuery);

    inline QVector<qint64> persistentSearchCollections() const { return mPersistentSearchCollections; }
    void setPersistentSearchCollections(const QVector<qint64> &persistentSearchCollections);

    inline bool persistentSearchRecursive() const { return mPersistentSearchRecursive; }
    void setPersistentSearchRecursive(bool persistentSearchRecursive);

    inline bool persistentSearchRemote() const { return mPersistentSearchRemote; }
    void setPersistentSearchRemote(bool persistentSearchRemote);

    inline QSet<QByteArray> removedAttributes() const { return mRemovedAttributes; }
    void setRemovedAttributes(const QSet<QByteArray> &removedAttributes);

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    void setAttributes(const Akonadi::Protocol::Attributes &attributes);

    inline bool enabled() const { return mEnabled; }
    void setEnabled(bool enabled);

    inline Tristate syncPref() const { return mSyncPref; }
    void setSyncPref(const Tristate &syncPref);

    inline Tristate displayPref() const { return mDisplayPref; }
    void setDisplayPref(const Tristate &displayPref);

    inline Tristate indexPref() const { return mIndexPref; }
    void setIndexPref(const Tristate &indexPref);

    inline bool referenced() const { return mReferenced; }
    void setReferenced(bool referenced);

protected:
    qint64 mParentId;
    Scope mCollection;
    Akonadi::Protocol::Attributes mAttributes;
    QSet<QByteArray> mRemovedAttributes;
    QVector<qint64> mPersistentSearchCollections;
    QString mPersistentSearchQuery;
    QString mRemoteRevision;
    QString mRemoteId;
    QString mName;
    Akonadi::Protocol::CachePolicy mCachePolicy;
    QStringList mMimeTypes;
    ModifyCollectionCommand::ModifiedParts mModifiedParts;
    bool mPersistentSearchRecursive;
    bool mPersistentSearchRemote;
    bool mEnabled;
    Tristate mSyncPref;
    Tristate mDisplayPref;
    Tristate mIndexPref;
    bool mReferenced;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyCollectionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyCollectionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyCollectionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyCollectionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyCollectionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyCollectionResponse &obj);

using ModifyCollectionResponsePtr = QSharedPointer<ModifyCollectionResponse>;

class AKONADIPRIVATE_EXPORT ModifyCollectionResponse : public Response
{

public:
    explicit ModifyCollectionResponse();
    ModifyCollectionResponse(const ModifyCollectionResponse &other);
    ~ModifyCollectionResponse();

    ModifyCollectionResponse &operator=(const ModifyCollectionResponse &other);
    bool operator==(const ModifyCollectionResponse &other) const;
    inline bool operator!=(const ModifyCollectionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyCollectionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyCollectionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyCollectionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const MoveCollectionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, MoveCollectionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const MoveCollectionCommand &obj);

using MoveCollectionCommandPtr = QSharedPointer<MoveCollectionCommand>;

class AKONADIPRIVATE_EXPORT MoveCollectionCommand : public Command
{

public:
    explicit MoveCollectionCommand();
    explicit MoveCollectionCommand(const Scope &collection, const Scope &destination);
    MoveCollectionCommand(const MoveCollectionCommand &other);
    ~MoveCollectionCommand();

    MoveCollectionCommand &operator=(const MoveCollectionCommand &other);
    bool operator==(const MoveCollectionCommand &other) const;
    inline bool operator!=(const MoveCollectionCommand &other) const { return !operator==(other); }
    inline Scope collection() const { return mCollection; }
    inline void setCollection(const Scope &collection) { mCollection = collection; }

    inline Scope destination() const { return mDestination; }
    inline void setDestination(const Scope &destination) { mDestination = destination; }

protected:
    Scope mCollection;
    Scope mDestination;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::MoveCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::MoveCollectionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::MoveCollectionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveCollectionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveCollectionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const MoveCollectionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, MoveCollectionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const MoveCollectionResponse &obj);

using MoveCollectionResponsePtr = QSharedPointer<MoveCollectionResponse>;

class AKONADIPRIVATE_EXPORT MoveCollectionResponse : public Response
{

public:
    explicit MoveCollectionResponse();
    MoveCollectionResponse(const MoveCollectionResponse &other);
    ~MoveCollectionResponse();

    MoveCollectionResponse &operator=(const MoveCollectionResponse &other);
    bool operator==(const MoveCollectionResponse &other) const;
    inline bool operator!=(const MoveCollectionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::MoveCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::MoveCollectionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::MoveCollectionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveCollectionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::MoveCollectionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SearchCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SearchCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SearchCommand &obj);

using SearchCommandPtr = QSharedPointer<SearchCommand>;

class AKONADIPRIVATE_EXPORT SearchCommand : public Command
{

public:
    explicit SearchCommand();
    explicit SearchCommand(const QString &query);
    SearchCommand(const SearchCommand &other);
    ~SearchCommand();

    SearchCommand &operator=(const SearchCommand &other);
    bool operator==(const SearchCommand &other) const;
    inline bool operator!=(const SearchCommand &other) const { return !operator==(other); }
    inline QStringList mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QStringList &mimeTypes) { mMimeTypes = mimeTypes; }

    inline QVector<qint64> collections() const { return mCollections; }
    inline void setCollections(const QVector<qint64> &collections) { mCollections = collections; }

    inline QString query() const { return mQuery; }
    inline void setQuery(const QString &query) { mQuery = query; }

    inline Akonadi::Protocol::FetchScope fetchScope() const { return mFetchScope; }
    inline void setFetchScope(const Akonadi::Protocol::FetchScope &fetchScope) { mFetchScope = fetchScope; }

    inline bool recursive() const { return mRecursive; }
    inline void setRecursive(bool recursive) { mRecursive = recursive; }

    inline bool remote() const { return mRemote; }
    inline void setRemote(bool remote) { mRemote = remote; }

protected:
    QStringList mMimeTypes;
    QVector<qint64> mCollections;
    QString mQuery;
    Akonadi::Protocol::FetchScope mFetchScope;
    bool mRecursive;
    bool mRemote;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SearchCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SearchCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SearchCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SearchResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SearchResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SearchResponse &obj);

using SearchResponsePtr = QSharedPointer<SearchResponse>;

class AKONADIPRIVATE_EXPORT SearchResponse : public Response
{

public:
    explicit SearchResponse();
    SearchResponse(const SearchResponse &other);
    ~SearchResponse();

    SearchResponse &operator=(const SearchResponse &other);
    bool operator==(const SearchResponse &other) const;
    inline bool operator!=(const SearchResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SearchResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SearchResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SearchResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SearchResultCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SearchResultCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SearchResultCommand &obj);

using SearchResultCommandPtr = QSharedPointer<SearchResultCommand>;

class AKONADIPRIVATE_EXPORT SearchResultCommand : public Command
{

public:
    explicit SearchResultCommand();
    explicit SearchResultCommand(const QByteArray &searchId, qint64 collectionId, const Scope &result);
    SearchResultCommand(const SearchResultCommand &other);
    ~SearchResultCommand();

    SearchResultCommand &operator=(const SearchResultCommand &other);
    bool operator==(const SearchResultCommand &other) const;
    inline bool operator!=(const SearchResultCommand &other) const { return !operator==(other); }
    inline QByteArray searchId() const { return mSearchId; }
    inline void setSearchId(const QByteArray &searchId) { mSearchId = searchId; }

    inline qint64 collectionId() const { return mCollectionId; }
    inline void setCollectionId(qint64 collectionId) { mCollectionId = collectionId; }

    inline Scope result() const { return mResult; }
    inline void setResult(const Scope &result) { mResult = result; }

protected:
    qint64 mCollectionId;
    QByteArray mSearchId;
    Scope mResult;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SearchResultCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SearchResultCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SearchResultCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResultCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResultCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SearchResultResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SearchResultResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SearchResultResponse &obj);

using SearchResultResponsePtr = QSharedPointer<SearchResultResponse>;

class AKONADIPRIVATE_EXPORT SearchResultResponse : public Response
{

public:
    explicit SearchResultResponse();
    SearchResultResponse(const SearchResultResponse &other);
    ~SearchResultResponse();

    SearchResultResponse &operator=(const SearchResultResponse &other);
    bool operator==(const SearchResultResponse &other) const;
    inline bool operator!=(const SearchResultResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SearchResultResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SearchResultResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SearchResultResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResultResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::SearchResultResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const StoreSearchCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, StoreSearchCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const StoreSearchCommand &obj);

using StoreSearchCommandPtr = QSharedPointer<StoreSearchCommand>;

class AKONADIPRIVATE_EXPORT StoreSearchCommand : public Command
{

public:
    explicit StoreSearchCommand();
    StoreSearchCommand(const StoreSearchCommand &other);
    ~StoreSearchCommand();

    StoreSearchCommand &operator=(const StoreSearchCommand &other);
    bool operator==(const StoreSearchCommand &other) const;
    inline bool operator!=(const StoreSearchCommand &other) const { return !operator==(other); }
    inline QString name() const { return mName; }
    inline void setName(const QString &name) { mName = name; }

    inline QString query() const { return mQuery; }
    inline void setQuery(const QString &query) { mQuery = query; }

    inline QStringList mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QStringList &mimeTypes) { mMimeTypes = mimeTypes; }

    inline QVector<qint64> queryCollections() const { return mQueryCollections; }
    inline void setQueryCollections(const QVector<qint64> &queryCollections) { mQueryCollections = queryCollections; }

    inline bool remote() const { return mRemote; }
    inline void setRemote(bool remote) { mRemote = remote; }

    inline bool recursive() const { return mRecursive; }
    inline void setRecursive(bool recursive) { mRecursive = recursive; }

protected:
    QString mName;
    QString mQuery;
    QStringList mMimeTypes;
    QVector<qint64> mQueryCollections;
    bool mRemote;
    bool mRecursive;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::StoreSearchCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::StoreSearchCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::StoreSearchCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::StoreSearchCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::StoreSearchCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const StoreSearchResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, StoreSearchResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const StoreSearchResponse &obj);

using StoreSearchResponsePtr = QSharedPointer<StoreSearchResponse>;

class AKONADIPRIVATE_EXPORT StoreSearchResponse : public Response
{

public:
    explicit StoreSearchResponse();
    StoreSearchResponse(const StoreSearchResponse &other);
    ~StoreSearchResponse();

    StoreSearchResponse &operator=(const StoreSearchResponse &other);
    bool operator==(const StoreSearchResponse &other) const;
    inline bool operator!=(const StoreSearchResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::StoreSearchResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::StoreSearchResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::StoreSearchResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::StoreSearchResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::StoreSearchResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateTagCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateTagCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateTagCommand &obj);

using CreateTagCommandPtr = QSharedPointer<CreateTagCommand>;

class AKONADIPRIVATE_EXPORT CreateTagCommand : public Command
{

public:
    explicit CreateTagCommand();
    CreateTagCommand(const CreateTagCommand &other);
    ~CreateTagCommand();

    CreateTagCommand &operator=(const CreateTagCommand &other);
    bool operator==(const CreateTagCommand &other) const;
    inline bool operator!=(const CreateTagCommand &other) const { return !operator==(other); }
    inline QByteArray gid() const { return mGid; }
    inline void setGid(const QByteArray &gid) { mGid = gid; }

    inline QByteArray remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QByteArray &remoteId) { mRemoteId = remoteId; }

    inline QByteArray type() const { return mType; }
    inline void setType(const QByteArray &type) { mType = type; }

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    inline void setAttributes(const Akonadi::Protocol::Attributes &attributes) { mAttributes = attributes; }

    inline qint64 parentId() const { return mParentId; }
    inline void setParentId(qint64 parentId) { mParentId = parentId; }

    inline bool merge() const { return mMerge; }
    inline void setMerge(bool merge) { mMerge = merge; }

protected:
    qint64 mParentId;
    QByteArray mGid;
    QByteArray mRemoteId;
    QByteArray mType;
    Akonadi::Protocol::Attributes mAttributes;
    bool mMerge;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateTagCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateTagCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateTagCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateTagResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateTagResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateTagResponse &obj);

using CreateTagResponsePtr = QSharedPointer<CreateTagResponse>;

class AKONADIPRIVATE_EXPORT CreateTagResponse : public Response
{

public:
    explicit CreateTagResponse();
    CreateTagResponse(const CreateTagResponse &other);
    ~CreateTagResponse();

    CreateTagResponse &operator=(const CreateTagResponse &other);
    bool operator==(const CreateTagResponse &other) const;
    inline bool operator!=(const CreateTagResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateTagResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateTagResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateTagResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteTagCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteTagCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteTagCommand &obj);

using DeleteTagCommandPtr = QSharedPointer<DeleteTagCommand>;

class AKONADIPRIVATE_EXPORT DeleteTagCommand : public Command
{

public:
    explicit DeleteTagCommand();
    explicit DeleteTagCommand(const Scope &tag);
    DeleteTagCommand(const DeleteTagCommand &other);
    ~DeleteTagCommand();

    DeleteTagCommand &operator=(const DeleteTagCommand &other);
    bool operator==(const DeleteTagCommand &other) const;
    inline bool operator!=(const DeleteTagCommand &other) const { return !operator==(other); }
    inline Scope tag() const { return mTag; }
    inline void setTag(const Scope &tag) { mTag = tag; }

protected:
    Scope mTag;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteTagCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteTagCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteTagCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DeleteTagResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DeleteTagResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DeleteTagResponse &obj);

using DeleteTagResponsePtr = QSharedPointer<DeleteTagResponse>;

class AKONADIPRIVATE_EXPORT DeleteTagResponse : public Response
{

public:
    explicit DeleteTagResponse();
    DeleteTagResponse(const DeleteTagResponse &other);
    ~DeleteTagResponse();

    DeleteTagResponse &operator=(const DeleteTagResponse &other);
    bool operator==(const DeleteTagResponse &other) const;
    inline bool operator!=(const DeleteTagResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DeleteTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DeleteTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DeleteTagResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteTagResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::DeleteTagResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyTagCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyTagCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyTagCommand &obj);

using ModifyTagCommandPtr = QSharedPointer<ModifyTagCommand>;

class AKONADIPRIVATE_EXPORT ModifyTagCommand : public Command
{

public:
    enum ModifiedPart {
        None = 0,
        ParentId = 1,
        Type = 2,
        RemoteId = 4,
        RemovedAttributes = 8,
        Attributes = 16,
    };
    Q_DECLARE_FLAGS(ModifiedParts, ModifiedPart)

    explicit ModifyTagCommand();
    explicit ModifyTagCommand(qint64 tagId);
    ModifyTagCommand(const ModifyTagCommand &other);
    ~ModifyTagCommand();

    ModifyTagCommand &operator=(const ModifyTagCommand &other);
    bool operator==(const ModifyTagCommand &other) const;
    inline bool operator!=(const ModifyTagCommand &other) const { return !operator==(other); }
    inline ModifyTagCommand::ModifiedParts modifiedParts() const { return mModifiedParts; }
    inline void setModifiedParts(const ModifyTagCommand::ModifiedParts &modifiedParts) { mModifiedParts = modifiedParts; }

    inline qint64 tagId() const { return mTagId; }
    inline void setTagId(qint64 tagId) { mTagId = tagId; }

    inline qint64 parentId() const { return mParentId; }
    void setParentId(qint64 parentId);

    inline QByteArray type() const { return mType; }
    void setType(const QByteArray &type);

    inline QByteArray remoteId() const { return mRemoteId; }
    void setRemoteId(const QByteArray &remoteId);

    inline QSet<QByteArray> removedAttributes() const { return mRemovedAttributes; }
    void setRemovedAttributes(const QSet<QByteArray> &removedAttributes);

    inline Akonadi::Protocol::Attributes attributes() const { return mAttributes; }
    void setAttributes(const Akonadi::Protocol::Attributes &attributes);

protected:
    qint64 mTagId;
    qint64 mParentId;
    ModifyTagCommand::ModifiedParts mModifiedParts;
    QByteArray mType;
    QByteArray mRemoteId;
    QSet<QByteArray> mRemovedAttributes;
    Akonadi::Protocol::Attributes mAttributes;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyTagCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyTagCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyTagCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyTagCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyTagResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyTagResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyTagResponse &obj);

using ModifyTagResponsePtr = QSharedPointer<ModifyTagResponse>;

class AKONADIPRIVATE_EXPORT ModifyTagResponse : public Response
{

public:
    explicit ModifyTagResponse();
    ModifyTagResponse(const ModifyTagResponse &other);
    ~ModifyTagResponse();

    ModifyTagResponse &operator=(const ModifyTagResponse &other);
    bool operator==(const ModifyTagResponse &other) const;
    inline bool operator!=(const ModifyTagResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyTagResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyTagResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyTagResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyTagResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyRelationCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyRelationCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyRelationCommand &obj);

using ModifyRelationCommandPtr = QSharedPointer<ModifyRelationCommand>;

class AKONADIPRIVATE_EXPORT ModifyRelationCommand : public Command
{

public:
    explicit ModifyRelationCommand();
    explicit ModifyRelationCommand(qint64 left, qint64 right, const QByteArray &type, const QByteArray &remoteId = QByteArray());
    ModifyRelationCommand(const ModifyRelationCommand &other);
    ~ModifyRelationCommand();

    ModifyRelationCommand &operator=(const ModifyRelationCommand &other);
    bool operator==(const ModifyRelationCommand &other) const;
    inline bool operator!=(const ModifyRelationCommand &other) const { return !operator==(other); }
    inline qint64 left() const { return mLeft; }
    inline void setLeft(qint64 left) { mLeft = left; }

    inline qint64 right() const { return mRight; }
    inline void setRight(qint64 right) { mRight = right; }

    inline QByteArray type() const { return mType; }
    inline void setType(const QByteArray &type) { mType = type; }

    inline QByteArray remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QByteArray &remoteId) { mRemoteId = remoteId; }

protected:
    qint64 mLeft;
    qint64 mRight;
    QByteArray mType;
    QByteArray mRemoteId;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyRelationCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyRelationCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyRelationCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyRelationCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyRelationCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifyRelationResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifyRelationResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifyRelationResponse &obj);

using ModifyRelationResponsePtr = QSharedPointer<ModifyRelationResponse>;

class AKONADIPRIVATE_EXPORT ModifyRelationResponse : public Response
{

public:
    explicit ModifyRelationResponse();
    ModifyRelationResponse(const ModifyRelationResponse &other);
    ~ModifyRelationResponse();

    ModifyRelationResponse &operator=(const ModifyRelationResponse &other);
    bool operator==(const ModifyRelationResponse &other) const;
    inline bool operator!=(const ModifyRelationResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifyRelationResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifyRelationResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifyRelationResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyRelationResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifyRelationResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const RemoveRelationsCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, RemoveRelationsCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const RemoveRelationsCommand &obj);

using RemoveRelationsCommandPtr = QSharedPointer<RemoveRelationsCommand>;

class AKONADIPRIVATE_EXPORT RemoveRelationsCommand : public Command
{

public:
    explicit RemoveRelationsCommand();
    explicit RemoveRelationsCommand(qint64 left, qint64 right, const QByteArray &type = QByteArray());
    RemoveRelationsCommand(const RemoveRelationsCommand &other);
    ~RemoveRelationsCommand();

    RemoveRelationsCommand &operator=(const RemoveRelationsCommand &other);
    bool operator==(const RemoveRelationsCommand &other) const;
    inline bool operator!=(const RemoveRelationsCommand &other) const { return !operator==(other); }
    inline qint64 left() const { return mLeft; }
    inline void setLeft(qint64 left) { mLeft = left; }

    inline qint64 right() const { return mRight; }
    inline void setRight(qint64 right) { mRight = right; }

    inline QByteArray type() const { return mType; }
    inline void setType(const QByteArray &type) { mType = type; }

protected:
    qint64 mLeft;
    qint64 mRight;
    QByteArray mType;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::RemoveRelationsCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::RemoveRelationsCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::RemoveRelationsCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::RemoveRelationsCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::RemoveRelationsCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const RemoveRelationsResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, RemoveRelationsResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const RemoveRelationsResponse &obj);

using RemoveRelationsResponsePtr = QSharedPointer<RemoveRelationsResponse>;

class AKONADIPRIVATE_EXPORT RemoveRelationsResponse : public Response
{

public:
    explicit RemoveRelationsResponse();
    RemoveRelationsResponse(const RemoveRelationsResponse &other);
    ~RemoveRelationsResponse();

    RemoveRelationsResponse &operator=(const RemoveRelationsResponse &other);
    bool operator==(const RemoveRelationsResponse &other) const;
    inline bool operator!=(const RemoveRelationsResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::RemoveRelationsResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::RemoveRelationsResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::RemoveRelationsResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::RemoveRelationsResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::RemoveRelationsResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SelectResourceCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SelectResourceCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SelectResourceCommand &obj);

using SelectResourceCommandPtr = QSharedPointer<SelectResourceCommand>;

class AKONADIPRIVATE_EXPORT SelectResourceCommand : public Command
{

public:
    explicit SelectResourceCommand();
    explicit SelectResourceCommand(const QString &resourceId);
    SelectResourceCommand(const SelectResourceCommand &other);
    ~SelectResourceCommand();

    SelectResourceCommand &operator=(const SelectResourceCommand &other);
    bool operator==(const SelectResourceCommand &other) const;
    inline bool operator!=(const SelectResourceCommand &other) const { return !operator==(other); }
    inline QString resourceId() const { return mResourceId; }
    inline void setResourceId(const QString &resourceId) { mResourceId = resourceId; }

protected:
    QString mResourceId;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SelectResourceCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SelectResourceCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SelectResourceCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SelectResourceCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::SelectResourceCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SelectResourceResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SelectResourceResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SelectResourceResponse &obj);

using SelectResourceResponsePtr = QSharedPointer<SelectResourceResponse>;

class AKONADIPRIVATE_EXPORT SelectResourceResponse : public Response
{

public:
    explicit SelectResourceResponse();
    SelectResourceResponse(const SelectResourceResponse &other);
    ~SelectResourceResponse();

    SelectResourceResponse &operator=(const SelectResourceResponse &other);
    bool operator==(const SelectResourceResponse &other) const;
    inline bool operator!=(const SelectResourceResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SelectResourceResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SelectResourceResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SelectResourceResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SelectResourceResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::SelectResourceResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const StreamPayloadCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, StreamPayloadCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const StreamPayloadCommand &obj);

using StreamPayloadCommandPtr = QSharedPointer<StreamPayloadCommand>;

class AKONADIPRIVATE_EXPORT StreamPayloadCommand : public Command
{

public:
    enum Request {
        MetaData,
        Data,
    };
    explicit StreamPayloadCommand();
    explicit StreamPayloadCommand(const QByteArray &payloadName, const StreamPayloadCommand::Request &request, const QString &destination = QString());
    StreamPayloadCommand(const StreamPayloadCommand &other);
    ~StreamPayloadCommand();

    StreamPayloadCommand &operator=(const StreamPayloadCommand &other);
    bool operator==(const StreamPayloadCommand &other) const;
    inline bool operator!=(const StreamPayloadCommand &other) const { return !operator==(other); }
    inline QByteArray payloadName() const { return mPayloadName; }
    inline void setPayloadName(const QByteArray &payloadName) { mPayloadName = payloadName; }

    inline QString destination() const { return mDestination; }
    inline void setDestination(const QString &destination) { mDestination = destination; }

    inline StreamPayloadCommand::Request request() const { return mRequest; }
    inline void setRequest(const StreamPayloadCommand::Request &request) { mRequest = request; }

protected:
    QByteArray mPayloadName;
    QString mDestination;
    StreamPayloadCommand::Request mRequest;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::StreamPayloadCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::StreamPayloadCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::StreamPayloadCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::StreamPayloadCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::StreamPayloadCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const StreamPayloadResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, StreamPayloadResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const StreamPayloadResponse &obj);

using StreamPayloadResponsePtr = QSharedPointer<StreamPayloadResponse>;

class AKONADIPRIVATE_EXPORT StreamPayloadResponse : public Response
{

public:
    explicit StreamPayloadResponse();
    explicit StreamPayloadResponse(const QByteArray &payloadName, const Akonadi::Protocol::PartMetaData &metaData = PartMetaData());
    explicit StreamPayloadResponse(const QByteArray &payloadName, const QByteArray &data);
    explicit StreamPayloadResponse(const QByteArray &payloadName, const Akonadi::Protocol::PartMetaData &metaData, const QByteArray &data);
    StreamPayloadResponse(const StreamPayloadResponse &other);
    ~StreamPayloadResponse();

    StreamPayloadResponse &operator=(const StreamPayloadResponse &other);
    bool operator==(const StreamPayloadResponse &other) const;
    inline bool operator!=(const StreamPayloadResponse &other) const { return !operator==(other); }
    inline QByteArray payloadName() const { return mPayloadName; }
    inline void setPayloadName(const QByteArray &payloadName) { mPayloadName = payloadName; }

    inline Akonadi::Protocol::PartMetaData metaData() const { return mMetaData; }
    inline void setMetaData(const Akonadi::Protocol::PartMetaData &metaData) { mMetaData = metaData; }

    inline QByteArray data() const { return mData; }
    inline void setData(const QByteArray &data) { mData = data; }

protected:
    QByteArray mPayloadName;
    Akonadi::Protocol::PartMetaData mMetaData;
    QByteArray mData;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::StreamPayloadResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::StreamPayloadResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::StreamPayloadResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::StreamPayloadResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::StreamPayloadResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ItemChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ItemChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ItemChangeNotification &obj);

using ItemChangeNotificationPtr = QSharedPointer<ItemChangeNotification>;

class AKONADIPRIVATE_EXPORT ItemChangeNotification : public ChangeNotification
{

public:
    enum Operation {
        InvalidOp = 0,
        Add,
        Modify,
        Move,
        Remove,
        Link,
        Unlink,
        ModifyFlags,
        ModifyTags,
        ModifyRelations,
    };
    explicit ItemChangeNotification();
    ItemChangeNotification(const ItemChangeNotification &other);
    ~ItemChangeNotification();

    ItemChangeNotification &operator=(const ItemChangeNotification &other);
    bool operator==(const ItemChangeNotification &other) const;
    inline bool operator!=(const ItemChangeNotification &other) const { return !operator==(other); }
    inline ItemChangeNotification::Operation operation() const { return mOperation; }
    inline void setOperation(const ItemChangeNotification::Operation &operation) { mOperation = operation; }

    inline QVector<Akonadi::Protocol::ChangeNotification::Item> items() const { return mItems; }
    inline void setItems(const QVector<Akonadi::Protocol::ChangeNotification::Item> &items) { mItems = items; }

    inline QByteArray resource() const { return mResource; }
    inline void setResource(const QByteArray &resource) { mResource = resource; }

    inline qint64 parentCollection() const { return mParentCollection; }
    inline void setParentCollection(qint64 parentCollection) { mParentCollection = parentCollection; }

    inline qint64 parentDestCollection() const { return mParentDestCollection; }
    inline void setParentDestCollection(qint64 parentDestCollection) { mParentDestCollection = parentDestCollection; }

    inline QByteArray destinationResource() const { return mDestinationResource; }
    inline void setDestinationResource(const QByteArray &destinationResource) { mDestinationResource = destinationResource; }

    inline QSet<QByteArray> itemParts() const { return mItemParts; }
    inline void setItemParts(const QSet<QByteArray> &itemParts) { mItemParts = itemParts; }

    inline QSet<QByteArray> addedFlags() const { return mAddedFlags; }
    inline void setAddedFlags(const QSet<QByteArray> &addedFlags) { mAddedFlags = addedFlags; }

    inline QSet<QByteArray> removedFlags() const { return mRemovedFlags; }
    inline void setRemovedFlags(const QSet<QByteArray> &removedFlags) { mRemovedFlags = removedFlags; }

    inline QSet<qint64> addedTags() const { return mAddedTags; }
    inline void setAddedTags(const QSet<qint64> &addedTags) { mAddedTags = addedTags; }

    inline QSet<qint64> removedTags() const { return mRemovedTags; }
    inline void setRemovedTags(const QSet<qint64> &removedTags) { mRemovedTags = removedTags; }

    inline QSet<Akonadi::Protocol::ChangeNotification::Relation> addedRelations() const { return mAddedRelations; }
    inline void setAddedRelations(const QSet<Akonadi::Protocol::ChangeNotification::Relation> &addedRelations) { mAddedRelations = addedRelations; }

    inline QSet<Akonadi::Protocol::ChangeNotification::Relation> removedRelations() const { return mRemovedRelations; }
    inline void setRemovedRelations(const QSet<Akonadi::Protocol::ChangeNotification::Relation> &removedRelations) { mRemovedRelations = removedRelations; }

protected:
    qint64 mParentCollection;
    qint64 mParentDestCollection;
    ItemChangeNotification::Operation mOperation;
    QVector<Akonadi::Protocol::ChangeNotification::Item> mItems;
    QByteArray mResource;
    QByteArray mDestinationResource;
    QSet<QByteArray> mItemParts;
    QSet<QByteArray> mAddedFlags;
    QSet<QByteArray> mRemovedFlags;
    QSet<qint64> mAddedTags;
    QSet<qint64> mRemovedTags;
    QSet<Akonadi::Protocol::ChangeNotification::Relation> mAddedRelations;
    QSet<Akonadi::Protocol::ChangeNotification::Relation> mRemovedRelations;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ItemChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ItemChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ItemChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ItemChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::ItemChangeNotificationPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CollectionChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CollectionChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CollectionChangeNotification &obj);

using CollectionChangeNotificationPtr = QSharedPointer<CollectionChangeNotification>;

class AKONADIPRIVATE_EXPORT CollectionChangeNotification : public ChangeNotification
{

public:
    enum Operation {
        InvalidOp,
        Add,
        Modify,
        Move,
        Remove,
        Subscribe,
        Unsubscribe,
    };
    explicit CollectionChangeNotification();
    CollectionChangeNotification(const CollectionChangeNotification &other);
    ~CollectionChangeNotification();

    CollectionChangeNotification &operator=(const CollectionChangeNotification &other);
    bool operator==(const CollectionChangeNotification &other) const;
    inline bool operator!=(const CollectionChangeNotification &other) const { return !operator==(other); }
    inline CollectionChangeNotification::Operation operation() const { return mOperation; }
    inline void setOperation(const CollectionChangeNotification::Operation &operation) { mOperation = operation; }

    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString remoteRevision() const { return mRemoteRevision; }
    inline void setRemoteRevision(const QString &remoteRevision) { mRemoteRevision = remoteRevision; }

    inline QByteArray resource() const { return mResource; }
    inline void setResource(const QByteArray &resource) { mResource = resource; }

    inline qint64 parentCollection() const { return mParentCollection; }
    inline void setParentCollection(qint64 parentCollection) { mParentCollection = parentCollection; }

    inline qint64 parentDestCollection() const { return mParentDestCollection; }
    inline void setParentDestCollection(qint64 parentDestCollection) { mParentDestCollection = parentDestCollection; }

    inline QByteArray destinationResource() const { return mDestinationResource; }
    inline void setDestinationResource(const QByteArray &destinationResource) { mDestinationResource = destinationResource; }

    inline QSet<QByteArray> changedParts() const { return mChangedParts; }
    inline void setChangedParts(const QSet<QByteArray> &changedParts) { mChangedParts = changedParts; }

protected:
    qint64 mId;
    qint64 mParentCollection;
    qint64 mParentDestCollection;
    CollectionChangeNotification::Operation mOperation;
    QString mRemoteId;
    QString mRemoteRevision;
    QByteArray mResource;
    QByteArray mDestinationResource;
    QSet<QByteArray> mChangedParts;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CollectionChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CollectionChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CollectionChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CollectionChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::CollectionChangeNotificationPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const TagChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, TagChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const TagChangeNotification &obj);

using TagChangeNotificationPtr = QSharedPointer<TagChangeNotification>;

class AKONADIPRIVATE_EXPORT TagChangeNotification : public ChangeNotification
{

public:
    enum Operation {
        InvalidOp,
        Add,
        Modify,
        Remove,
    };
    explicit TagChangeNotification();
    TagChangeNotification(const TagChangeNotification &other);
    ~TagChangeNotification();

    TagChangeNotification &operator=(const TagChangeNotification &other);
    bool operator==(const TagChangeNotification &other) const;
    inline bool operator!=(const TagChangeNotification &other) const { return !operator==(other); }
    inline TagChangeNotification::Operation operation() const { return mOperation; }
    inline void setOperation(const TagChangeNotification::Operation &operation) { mOperation = operation; }

    inline qint64 id() const { return mId; }
    inline void setId(qint64 id) { mId = id; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QByteArray resource() const { return mResource; }
    inline void setResource(const QByteArray &resource) { mResource = resource; }

protected:
    qint64 mId;
    TagChangeNotification::Operation mOperation;
    QString mRemoteId;
    QByteArray mResource;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::TagChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::TagChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::TagChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::TagChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::TagChangeNotificationPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const RelationChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, RelationChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const RelationChangeNotification &obj);

using RelationChangeNotificationPtr = QSharedPointer<RelationChangeNotification>;

class AKONADIPRIVATE_EXPORT RelationChangeNotification : public ChangeNotification
{

public:
    enum Operation {
        InvalidOp,
        Add,
        Remove,
    };
    explicit RelationChangeNotification();
    RelationChangeNotification(const RelationChangeNotification &other);
    ~RelationChangeNotification();

    RelationChangeNotification &operator=(const RelationChangeNotification &other);
    bool operator==(const RelationChangeNotification &other) const;
    inline bool operator!=(const RelationChangeNotification &other) const { return !operator==(other); }
    inline RelationChangeNotification::Operation operation() const { return mOperation; }
    inline void setOperation(const RelationChangeNotification::Operation &operation) { mOperation = operation; }

    inline qint64 leftItem() const { return mLeftItem; }
    inline void setLeftItem(qint64 leftItem) { mLeftItem = leftItem; }

    inline qint64 rightItem() const { return mRightItem; }
    inline void setRightItem(qint64 rightItem) { mRightItem = rightItem; }

    inline QString remoteId() const { return mRemoteId; }
    inline void setRemoteId(const QString &remoteId) { mRemoteId = remoteId; }

    inline QString type() const { return mType; }
    inline void setType(const QString &type) { mType = type; }

protected:
    qint64 mLeftItem;
    qint64 mRightItem;
    RelationChangeNotification::Operation mOperation;
    QString mRemoteId;
    QString mType;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::RelationChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::RelationChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::RelationChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::RelationChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::RelationChangeNotificationPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateSubscriptionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateSubscriptionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateSubscriptionCommand &obj);

using CreateSubscriptionCommandPtr = QSharedPointer<CreateSubscriptionCommand>;

class AKONADIPRIVATE_EXPORT CreateSubscriptionCommand : public Command
{

public:
    explicit CreateSubscriptionCommand();
    explicit CreateSubscriptionCommand(const QByteArray &subscriberName, const QByteArray &session = QByteArray());
    CreateSubscriptionCommand(const CreateSubscriptionCommand &other);
    ~CreateSubscriptionCommand();

    CreateSubscriptionCommand &operator=(const CreateSubscriptionCommand &other);
    bool operator==(const CreateSubscriptionCommand &other) const;
    inline bool operator!=(const CreateSubscriptionCommand &other) const { return !operator==(other); }
    inline QByteArray subscriberName() const { return mSubscriberName; }
    inline void setSubscriberName(const QByteArray &subscriberName) { mSubscriberName = subscriberName; }

    inline QByteArray session() const { return mSession; }
    inline void setSession(const QByteArray &session) { mSession = session; }

protected:
    QByteArray mSubscriberName;
    QByteArray mSession;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateSubscriptionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateSubscriptionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateSubscriptionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateSubscriptionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateSubscriptionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const CreateSubscriptionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, CreateSubscriptionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const CreateSubscriptionResponse &obj);

using CreateSubscriptionResponsePtr = QSharedPointer<CreateSubscriptionResponse>;

class AKONADIPRIVATE_EXPORT CreateSubscriptionResponse : public Response
{

public:
    explicit CreateSubscriptionResponse();
    CreateSubscriptionResponse(const CreateSubscriptionResponse &other);
    ~CreateSubscriptionResponse();

    CreateSubscriptionResponse &operator=(const CreateSubscriptionResponse &other);
    bool operator==(const CreateSubscriptionResponse &other) const;
    inline bool operator!=(const CreateSubscriptionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::CreateSubscriptionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::CreateSubscriptionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::CreateSubscriptionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateSubscriptionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::CreateSubscriptionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifySubscriptionCommand &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifySubscriptionCommand &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifySubscriptionCommand &obj);

using ModifySubscriptionCommandPtr = QSharedPointer<ModifySubscriptionCommand>;

class AKONADIPRIVATE_EXPORT ModifySubscriptionCommand : public Command
{

public:
    enum ModifiedPart {
        None = 0,
        Collections = 1,
        Items = 2,
        Tags = 4,
        Types = 8,
        Resources = 16,
        MimeTypes = 32,
        AllFlag = 64,
        ExclusiveFlag = 128,
        Sessions = 256,
        Add = 16384,
        Remove = 32768,
    };
    Q_DECLARE_FLAGS(ModifiedParts, ModifiedPart)

    enum ChangeType {
        NoType,
        ItemChanges,
        CollectionChanges,
        TagChanges,
        RelationChanges,
        SubscriptionChanges,
        ChangeNotifications,
    };
    explicit ModifySubscriptionCommand();
    ModifySubscriptionCommand(const ModifySubscriptionCommand &other);
    ~ModifySubscriptionCommand();

    ModifySubscriptionCommand &operator=(const ModifySubscriptionCommand &other);
    bool operator==(const ModifySubscriptionCommand &other) const;
    inline bool operator!=(const ModifySubscriptionCommand &other) const { return !operator==(other); }
    inline ModifySubscriptionCommand::ModifiedParts modifiedParts() const { return mModifiedParts; }
    inline void setModifiedParts(const ModifySubscriptionCommand::ModifiedParts &modifiedParts) { mModifiedParts = modifiedParts; }

    inline QByteArray subscriberName() const { return mSubscriberName; }
    inline void setSubscriberName(const QByteArray &subscriberName) { mSubscriberName = subscriberName; }

    inline QVector<qint64> startMonitoringCollections() const { return mStartMonitoringCollections; }
    void startMonitoringCollection(const qint64 &startMonitoringCollections);

    inline QVector<qint64> stopMonitoringCollections() const { return mStopMonitoringCollections; }
    void stopMonitoringCollection(const qint64 &stopMonitoringCollections);

    inline QVector<qint64> startMonitoringItems() const { return mStartMonitoringItems; }
    void startMonitoringItem(const qint64 &startMonitoringItems);

    inline QVector<qint64> stopMonitoringItems() const { return mStopMonitoringItems; }
    void stopMonitoringItem(const qint64 &stopMonitoringItems);

    inline QVector<qint64> startMonitoringTags() const { return mStartMonitoringTags; }
    void startMonitoringTag(const qint64 &startMonitoringTags);

    inline QVector<qint64> stopMonitoringTags() const { return mStopMonitoringTags; }
    void stopMonitoringTag(const qint64 &stopMonitoringTags);

    inline QVector<ModifySubscriptionCommand::ChangeType> startMonitoringTypes() const { return mStartMonitoringTypes; }
    void startMonitoringType(const ModifySubscriptionCommand::ChangeType &startMonitoringTypes);

    inline QVector<ModifySubscriptionCommand::ChangeType> stopMonitoringTypes() const { return mStopMonitoringTypes; }
    void stopMonitoringType(const ModifySubscriptionCommand::ChangeType &stopMonitoringTypes);

    inline QVector<QByteArray> startMonitoringResources() const { return mStartMonitoringResources; }
    void startMonitoringResource(const QByteArray &startMonitoringResources);

    inline QVector<QByteArray> stopMonitoringResources() const { return mStopMonitoringResources; }
    void stopMonitoringResource(const QByteArray &stopMonitoringResources);

    inline QStringList startMonitoringMimeTypes() const { return mStartMonitoringMimeTypes; }
    void startMonitoringMimeType(const QString &startMonitoringMimeTypes);

    inline QStringList stopMonitoringMimeTypes() const { return mStopMonitoringMimeTypes; }
    void stopMonitoringMimeType(const QString &stopMonitoringMimeTypes);

    inline bool allMonitored() const { return mAllMonitored; }
    void setAllMonitored(bool allMonitored);

    inline bool isExclusive() const { return mIsExclusive; }
    void setIsExclusive(bool isExclusive);

    inline QVector<QByteArray> startIgnoringSessions() const { return mStartIgnoringSessions; }
    void startIgnoringSession(const QByteArray &startIgnoringSessions);

    inline QVector<QByteArray> stopIgnoringSessions() const { return mStopIgnoringSessions; }
    void stopIgnoringSession(const QByteArray &stopIgnoringSessions);

protected:
    QVector<ModifySubscriptionCommand::ChangeType> mStopMonitoringTypes;
    QVector<QByteArray> mStopIgnoringSessions;
    QVector<QByteArray> mStartIgnoringSessions;
    QStringList mStopMonitoringMimeTypes;
    QStringList mStartMonitoringMimeTypes;
    QVector<QByteArray> mStopMonitoringResources;
    QVector<QByteArray> mStartMonitoringResources;
    ModifySubscriptionCommand::ModifiedParts mModifiedParts;
    QVector<ModifySubscriptionCommand::ChangeType> mStartMonitoringTypes;
    QVector<qint64> mStopMonitoringTags;
    QVector<qint64> mStartMonitoringTags;
    QVector<qint64> mStopMonitoringItems;
    QVector<qint64> mStartMonitoringItems;
    QVector<qint64> mStopMonitoringCollections;
    QVector<qint64> mStartMonitoringCollections;
    QByteArray mSubscriberName;
    bool mAllMonitored;
    bool mIsExclusive;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifySubscriptionCommand &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifySubscriptionCommand &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifySubscriptionCommand &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifySubscriptionCommand)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifySubscriptionCommandPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const ModifySubscriptionResponse &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, ModifySubscriptionResponse &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const ModifySubscriptionResponse &obj);

using ModifySubscriptionResponsePtr = QSharedPointer<ModifySubscriptionResponse>;

class AKONADIPRIVATE_EXPORT ModifySubscriptionResponse : public Response
{

public:
    explicit ModifySubscriptionResponse();
    ModifySubscriptionResponse(const ModifySubscriptionResponse &other);
    ~ModifySubscriptionResponse();

    ModifySubscriptionResponse &operator=(const ModifySubscriptionResponse &other);
    bool operator==(const ModifySubscriptionResponse &other) const;
    inline bool operator!=(const ModifySubscriptionResponse &other) const { return !operator==(other); }
protected:

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::ModifySubscriptionResponse &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::ModifySubscriptionResponse &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::ModifySubscriptionResponse &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifySubscriptionResponse)

Q_DECLARE_METATYPE(Akonadi::Protocol::ModifySubscriptionResponsePtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const SubscriptionChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, SubscriptionChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const SubscriptionChangeNotification &obj);

using SubscriptionChangeNotificationPtr = QSharedPointer<SubscriptionChangeNotification>;

class AKONADIPRIVATE_EXPORT SubscriptionChangeNotification : public ChangeNotification
{

public:
    enum Operation {
        InvalidOp,
        Add,
        Modify,
        Remove,
    };
    explicit SubscriptionChangeNotification();
    SubscriptionChangeNotification(const SubscriptionChangeNotification &other);
    ~SubscriptionChangeNotification();

    SubscriptionChangeNotification &operator=(const SubscriptionChangeNotification &other);
    bool operator==(const SubscriptionChangeNotification &other) const;
    inline bool operator!=(const SubscriptionChangeNotification &other) const { return !operator==(other); }
    inline SubscriptionChangeNotification::Operation operation() const { return mOperation; }
    inline void setOperation(const SubscriptionChangeNotification::Operation &operation) { mOperation = operation; }

    inline QByteArray subscriber() const { return mSubscriber; }
    inline void setSubscriber(const QByteArray &subscriber) { mSubscriber = subscriber; }

    inline QSet<qint64> collections() const { return mCollections; }
    inline void setCollections(const QSet<qint64> &collections) { mCollections = collections; }

    inline QSet<qint64> items() const { return mItems; }
    inline void setItems(const QSet<qint64> &items) { mItems = items; }

    inline QSet<qint64> tags() const { return mTags; }
    inline void setTags(const QSet<qint64> &tags) { mTags = tags; }

    inline QSet<ModifySubscriptionCommand::ChangeType> types() const { return mTypes; }
    inline void setTypes(const QSet<ModifySubscriptionCommand::ChangeType> &types) { mTypes = types; }

    inline QSet<QString> mimeTypes() const { return mMimeTypes; }
    inline void setMimeTypes(const QSet<QString> &mimeTypes) { mMimeTypes = mimeTypes; }

    inline QSet<QByteArray> resources() const { return mResources; }
    inline void setResources(const QSet<QByteArray> &resources) { mResources = resources; }

    inline QSet<QByteArray> ignoredSessions() const { return mIgnoredSessions; }
    inline void setIgnoredSessions(const QSet<QByteArray> &ignoredSessions) { mIgnoredSessions = ignoredSessions; }

    inline bool allMonitored() const { return mAllMonitored; }
    inline void setAllMonitored(bool allMonitored) { mAllMonitored = allMonitored; }

    inline bool exclusive() const { return mExclusive; }
    inline void setExclusive(bool exclusive) { mExclusive = exclusive; }

protected:
    SubscriptionChangeNotification::Operation mOperation;
    QByteArray mSubscriber;
    QSet<qint64> mCollections;
    QSet<qint64> mItems;
    QSet<qint64> mTags;
    QSet<ModifySubscriptionCommand::ChangeType> mTypes;
    QSet<QString> mMimeTypes;
    QSet<QByteArray> mResources;
    QSet<QByteArray> mIgnoredSessions;
    bool mAllMonitored;
    bool mExclusive;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::SubscriptionChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::SubscriptionChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::SubscriptionChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::SubscriptionChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::SubscriptionChangeNotificationPtr)

namespace Akonadi {
namespace Protocol {

AKONADIPRIVATE_EXPORT DataStream &operator<<(DataStream &stream, const DebugChangeNotification &obj);
AKONADIPRIVATE_EXPORT DataStream &operator>>(DataStream &stream, DebugChangeNotification &obj);
AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const DebugChangeNotification &obj);

using DebugChangeNotificationPtr = QSharedPointer<DebugChangeNotification>;

class AKONADIPRIVATE_EXPORT DebugChangeNotification : public ChangeNotification
{

public:
    explicit DebugChangeNotification();
    DebugChangeNotification(const DebugChangeNotification &other);
    ~DebugChangeNotification();

    DebugChangeNotification &operator=(const DebugChangeNotification &other);
    bool operator==(const DebugChangeNotification &other) const;
    inline bool operator!=(const DebugChangeNotification &other) const { return !operator==(other); }
    inline Akonadi::Protocol::ChangeNotificationPtr notification() const { return mNotification; }
    inline void setNotification(const Akonadi::Protocol::ChangeNotificationPtr &notification) { mNotification = notification; }

    inline QVector<QByteArray> listeners() const { return mListeners; }
    inline void setListeners(const QVector<QByteArray> &listeners) { mListeners = listeners; }

    inline qint64 timestamp() const { return mTimestamp; }
    inline void setTimestamp(qint64 timestamp) { mTimestamp = timestamp; }

protected:
    Akonadi::Protocol::ChangeNotificationPtr mNotification;
    qint64 mTimestamp;
    QVector<QByteArray> mListeners;

private:
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator<<(Akonadi::Protocol::DataStream &stream, const Akonadi::Protocol::DebugChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT Akonadi::Protocol::DataStream &operator>>(Akonadi::Protocol::DataStream &stream, Akonadi::Protocol::DebugChangeNotification &obj);
    friend AKONADIPRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Akonadi::Protocol::DebugChangeNotification &obj);
};

} // namespace Protocol
} // namespace Akonadi

Q_DECLARE_METATYPE(Akonadi::Protocol::DebugChangeNotification)

Q_DECLARE_METATYPE(Akonadi::Protocol::DebugChangeNotificationPtr)

