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

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

namespace qtgrpc::tests {
namespace TestService {
using namespace Qt::StringLiterals;

Client::Client(QObject *parent)
    : QGrpcClientBase("qtgrpc.tests.TestService"_L1, parent)
{
}

Client::~Client() = default;

std::unique_ptr<QGrpcCallReply> Client::testMethod(const qtgrpc::tests::IntMessage &arg)
{
    return testMethod(arg, {});
}


std::unique_ptr<QGrpcCallReply> Client::testMethod(const qtgrpc::tests::IntMessage &arg, const QGrpcCallOptions &options)
{
    auto reply = call("testMethod"_L1, arg, options);
    if (auto *replyPtr = reply.get(); replyPtr != nullptr) {
        setOperationResponseMetaType(replyPtr, QMetaType::fromType<qtgrpc::tests::IntMessage>());
    }
    return reply;
}

std::unique_ptr<QGrpcServerStream> Client::testMethodServerStream(const qtgrpc::tests::IntMessage &arg)
{
    return testMethodServerStream(arg, {});}

std::unique_ptr<QGrpcServerStream> Client::testMethodServerStream(const qtgrpc::tests::IntMessage &arg, const QGrpcCallOptions &options)
{
    auto stream = serverStream("testMethodServerStream"_L1, arg, options);
    if (auto *streamPtr = stream.get(); streamPtr != nullptr) {
        setOperationResponseMetaType(streamPtr, QMetaType::fromType<qtgrpc::tests::IntMessage>());
    }
    return stream;
}

std::unique_ptr<QGrpcClientStream> Client::testMethodClientStream(const qtgrpc::tests::IntMessage &arg)
{
    return testMethodClientStream(arg, {});}

std::unique_ptr<QGrpcClientStream> Client::testMethodClientStream(const qtgrpc::tests::IntMessage &arg, const QGrpcCallOptions &options)
{
    auto stream = clientStream("testMethodClientStream"_L1, arg, options);
    if (auto *streamPtr = stream.get(); streamPtr != nullptr) {
        setOperationResponseMetaType(streamPtr, QMetaType::fromType<qtgrpc::tests::IntMessage>());
    }
    return stream;
}

std::unique_ptr<QGrpcBidiStream> Client::testMethodBiStream(const qtgrpc::tests::IntMessage &arg)
{
    return testMethodBiStream(arg, {});}

std::unique_ptr<QGrpcBidiStream> Client::testMethodBiStream(const qtgrpc::tests::IntMessage &arg, const QGrpcCallOptions &options)
{
    auto stream = bidiStream("testMethodBiStream"_L1, arg, options);
    if (auto *streamPtr = stream.get(); streamPtr != nullptr) {
        setOperationResponseMetaType(streamPtr, QMetaType::fromType<qtgrpc::tests::IntMessage>());
    }
    return stream;
}

} // namespace TestService
} // namespace qtgrpc::tests

