/* This file is autogenerated. DO NOT CHANGE. All changes will be lost */

#ifndef QMLQTGRPCGEN_CLIENT_GRPC_QPB_H
#define QMLQTGRPCGEN_CLIENT_GRPC_QPB_H

#include "qtgrpc/tests/qtgrpcgen_client.grpc.qpb.h"

#include <QtGrpcQuick/qqmlgrpccalloptions.h>
#include <QtGrpcQuick/qqmlgrpcfunctionalhandlers.h>
#include <QtGrpcQuick/qtqmlgrpcstreamsender.h>

#include <QtQml/qjsengine.h>
#include <QtQml/qjsvalue.h>
#include <QtQml/qqmlengine.h>

namespace qtgrpc::tests {
namespace TestService {
class QmlClient;
class QPB_TST_QTGRPC_GEN_EXPORT TestMethodClientStreamSender : public QQmlGrpcClientStreamSender
{
    Q_OBJECT
    QML_NAMED_ELEMENT(TestServiceTestMethodClientStreamSender)
    QML_UNCREATABLE("TestServiceTestMethodClientStreamSender can only be created by gRPC client instance")

    TestMethodClientStreamSender(QGrpcClientStream *stream) : QQmlGrpcClientStreamSender(stream) {}

public:
    Q_INVOKABLE void writeMessage(const qtgrpc::tests::IntMessage &arg)
    {
        writeMessageImpl(arg);
    }
    friend class TestService::QmlClient;
};

class QPB_TST_QTGRPC_GEN_EXPORT TestMethodBiStreamSender : public QQmlGrpcBidiStreamSender
{
    Q_OBJECT
    QML_NAMED_ELEMENT(TestServiceTestMethodBiStreamSender)
    QML_UNCREATABLE("TestServiceTestMethodBiStreamSender can only be created by gRPC client instance")

    TestMethodBiStreamSender(QGrpcBidiStream *stream) : QQmlGrpcBidiStreamSender(stream) {}

public:
    Q_INVOKABLE void writeMessage(const qtgrpc::tests::IntMessage &arg)
    {
        writeMessageImpl(arg);
    }
    friend class TestService::QmlClient;
};


class QPB_TST_QTGRPC_GEN_EXPORT QmlClient : public Client
{
    Q_OBJECT
    QML_NAMED_ELEMENT(TestServiceClient)

public:
    explicit QmlClient(QObject *parent = nullptr);
    Q_INVOKABLE void testMethod(const qtgrpc::tests::IntMessage &arg, const QJSValue &callback, const QJSValue &errorCallback, const QtGrpcQuickPrivate::QQmlGrpcCallOptions *options = nullptr);
    Q_INVOKABLE void testMethodServerStream(const qtgrpc::tests::IntMessage &arg,
                    const QJSValue &messageCallback,
                    const QJSValue &finishCallback,
                    const QJSValue &errorCallback,
                    const QtGrpcQuickPrivate::QQmlGrpcCallOptions *options = nullptr);
    Q_INVOKABLE TestMethodClientStreamSender *testMethodClientStream(const qtgrpc::tests::IntMessage &arg,
                    const QJSValue &finishCallback,
                    const QJSValue &errorCallback,
                    const QtGrpcQuickPrivate::QQmlGrpcCallOptions *options = nullptr);
    Q_INVOKABLE TestMethodBiStreamSender *testMethodBiStream(const qtgrpc::tests::IntMessage &arg,
                    const QJSValue &messageCallback,
                    const QJSValue &finishCallback,
                    const QJSValue &errorCallback,
                    const QtGrpcQuickPrivate::QQmlGrpcCallOptions *options = nullptr);
};
} // namespace TestService
} // namespace qtgrpc::tests

#endif // QMLQTGRPCGEN_CLIENT_GRPC_QPB_H
