//
// Automatically generated by ipdlc.
// Edit at your own risk
//


#include "mozilla/dom/PMLSTransactionChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/MLSTransactionChild.h"
#include "mozilla/dom/MLSTransactionMessage.h"

#include "mozilla/ipc/PBackgroundChild.h"

#include "ipc/IPCMessageUtils.h"
#include "ipc/IPCMessageUtilsSpecializations.h"
#include "nsIFile.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/ProtocolMessageUtils.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/ShmemMessageUtils.h"
#include "mozilla/ipc/TaintingIPCUtils.h"

namespace mozilla {
namespace dom {


auto PMLSTransactionChild::ProcessingError(
        Result aCode,
        const char* aReason) -> void
{
}

auto PMLSTransactionChild::ShouldContinueFromReplyTimeout() -> bool
{
    return true;
}

MOZ_IMPLICIT PMLSTransactionChild::PMLSTransactionChild() :
    mozilla::ipc::IToplevelProtocol("PMLSTransactionChild", kProtocolId, mozilla::ipc::ChildSide)
{
    MOZ_COUNT_CTOR(PMLSTransactionChild);
}

PMLSTransactionChild::~PMLSTransactionChild()
{
    MOZ_COUNT_DTOR(PMLSTransactionChild);
}

auto PMLSTransactionChild::ActorAlloc() -> void
{
    MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PMLSTransactionChild'");
    AddRef();
}

auto PMLSTransactionChild::ActorDealloc() -> void
{
    Release();
}

auto PMLSTransactionChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
    return {};
}

auto PMLSTransactionChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
    switch (aProtocol) {
    default:
        return nullptr;
    }
}

auto PMLSTransactionChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
    mAsyncCallbacks.RejectPendingResponses(aReason);
}

auto PMLSTransactionChild::SendRequestStateDelete(
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestStateDelete(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestStateDelete", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestStateDelete__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestStateDelete() -> RefPtr<RequestStateDeletePromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestStateDelete([promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupStateDelete(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkGroupIdEpoch>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupStateDelete(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupStateDelete", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupStateDelete__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkGroupIdEpoch>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupStateDelete(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestGroupStateDeletePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupStateDelete(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](mozilla::Maybe<GkGroupIdEpoch>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGenerateIdentityKeypair(
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGenerateIdentityKeypair(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateIdentityKeypair", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGenerateIdentityKeypair__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGenerateIdentityKeypair() -> RefPtr<RequestGenerateIdentityKeypairPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGenerateIdentityKeypair([promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGenerateCredentialBasic(
        mozilla::Span<uint8_t const> credName,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGenerateCredentialBasic(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), credName);
    // Sentinel = 'credName'
    ((&(writer__)))->WriteSentinel(237634336);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateCredentialBasic", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGenerateCredentialBasic__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGenerateCredentialBasic(mozilla::Span<uint8_t const> credName) -> RefPtr<RequestGenerateCredentialBasicPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGenerateCredentialBasic(std::forward<mozilla::Span<uint8_t const>>(credName), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGenerateKeyPackage(
        mozilla::Span<uint8_t const> identity,
        mozilla::Span<uint8_t const> credential,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGenerateKeyPackage(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), identity);
    // Sentinel = 'identity'
    ((&(writer__)))->WriteSentinel(251396971);
    IPC::WriteParam((&(writer__)), credential);
    // Sentinel = 'credential'
    ((&(writer__)))->WriteSentinel(378209308);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateKeyPackage", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGenerateKeyPackage__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGenerateKeyPackage(
        mozilla::Span<uint8_t const> identity,
        mozilla::Span<uint8_t const> credential) -> RefPtr<RequestGenerateKeyPackagePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGenerateKeyPackage(std::forward<mozilla::Span<uint8_t const>>(identity), std::forward<mozilla::Span<uint8_t const>>(credential), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupCreate(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> credential,
        mozilla::Span<uint8_t const> inOptGroupIdentifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkGroupIdEpoch>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupCreate(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), credential);
    // Sentinel = 'credential'
    ((&(writer__)))->WriteSentinel(378209308);
    IPC::WriteParam((&(writer__)), inOptGroupIdentifier);
    // Sentinel = 'inOptGroupIdentifier'
    ((&(writer__)))->WriteSentinel(1415579675);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupCreate", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupCreate__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkGroupIdEpoch>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupCreate(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> credential,
        mozilla::Span<uint8_t const> inOptGroupIdentifier) -> RefPtr<RequestGroupCreatePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupCreate(std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(credential), std::forward<mozilla::Span<uint8_t const>>(inOptGroupIdentifier), [promise__](mozilla::Maybe<GkGroupIdEpoch>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupJoin(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> welcome,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkGroupIdEpoch>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupJoin(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), welcome);
    // Sentinel = 'welcome'
    ((&(writer__)))->WriteSentinel(198836973);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupJoin", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupJoin__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkGroupIdEpoch>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkGroupIdEpoch?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupJoin(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> welcome) -> RefPtr<RequestGroupJoinPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkGroupIdEpoch>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupJoin(std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(welcome), [promise__](mozilla::Maybe<GkGroupIdEpoch>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupAdd(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> keyPackage,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkMlsCommitOutput>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupAdd(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), keyPackage);
    // Sentinel = 'keyPackage'
    ((&(writer__)))->WriteSentinel(368313334);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupAdd", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupAdd__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkMlsCommitOutput>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupAdd(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> keyPackage) -> RefPtr<RequestGroupAddPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupAdd(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(keyPackage), [promise__](mozilla::Maybe<GkMlsCommitOutput>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupProposeAdd(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> keyPackage,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupProposeAdd(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), keyPackage);
    // Sentinel = 'keyPackage'
    ((&(writer__)))->WriteSentinel(368313334);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupProposeAdd", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupProposeAdd__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupProposeAdd(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> keyPackage) -> RefPtr<RequestGroupProposeAddPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupProposeAdd(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(keyPackage), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupRemove(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> remIdentifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkMlsCommitOutput>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupRemove(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), remIdentifier);
    // Sentinel = 'remIdentifier'
    ((&(writer__)))->WriteSentinel(614335816);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupRemove", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupRemove__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkMlsCommitOutput>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupRemove(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> remIdentifier) -> RefPtr<RequestGroupRemovePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupRemove(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(remIdentifier), [promise__](mozilla::Maybe<GkMlsCommitOutput>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupProposeRemove(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> remIdentifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupProposeRemove(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), remIdentifier);
    // Sentinel = 'remIdentifier'
    ((&(writer__)))->WriteSentinel(614335816);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupProposeRemove", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupProposeRemove__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupProposeRemove(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> remIdentifier) -> RefPtr<RequestGroupProposeRemovePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupProposeRemove(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(remIdentifier), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupClose(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkMlsCommitOutput>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupClose(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupClose", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupClose__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkMlsCommitOutput>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkMlsCommitOutput?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupClose(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestGroupClosePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkMlsCommitOutput>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupClose(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](mozilla::Maybe<GkMlsCommitOutput>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGroupDetails(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkGroupDetails>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGroupDetails(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupDetails", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGroupDetails__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkGroupDetails>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkGroupDetails?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkGroupDetails?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGroupDetails(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestGroupDetailsPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkGroupDetails>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkGroupDetails>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGroupDetails(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](mozilla::Maybe<GkGroupDetails>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestSend(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> message,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestSend(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), message);
    // Sentinel = 'message'
    ((&(writer__)))->WriteSentinel(197198566);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestSend", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestSend__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestSend(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> message) -> RefPtr<RequestSendPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestSend(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(message), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestReceive(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> message,
        mozilla::ipc::ResolveCallback<GkReceived>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestReceive(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), message);
    // Sentinel = 'message'
    ((&(writer__)))->WriteSentinel(197198566);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestReceive", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestReceive__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<GkReceived>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkReceived'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkReceived'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestReceive(
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> message) -> RefPtr<RequestReceivePromise>
{
    RefPtr<MozPromise<GkReceived, ResponseRejectReason, true>::Private> promise__ = new MozPromise<GkReceived, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestReceive(std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(message), [promise__](GkReceived&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestHasPendingProposals(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestHasPendingProposals(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestHasPendingProposals", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestHasPendingProposals__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestHasPendingProposals(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestHasPendingProposalsPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestHasPendingProposals(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestClearPendingProposals(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestClearPendingProposals(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestClearPendingProposals", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestClearPendingProposals__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestClearPendingProposals(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestClearPendingProposalsPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestClearPendingProposals(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestHasPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestHasPendingCommit(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestHasPendingCommit", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestHasPendingCommit__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestHasPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestHasPendingCommitPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestHasPendingCommit(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestClearPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestClearPendingCommit(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestClearPendingCommit", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestClearPendingCommit__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestClearPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestClearPendingCommitPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestClearPendingCommit(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestApplyPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::ipc::ResolveCallback<GkReceived>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestApplyPendingCommit(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestApplyPendingCommit", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestApplyPendingCommit__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<GkReceived>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkReceived'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkReceived'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestApplyPendingCommit(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier) -> RefPtr<RequestApplyPendingCommitPromise>
{
    RefPtr<MozPromise<GkReceived, ResponseRejectReason, true>::Private> promise__ = new MozPromise<GkReceived, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestApplyPendingCommit(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), [promise__](GkReceived&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestExportSecret(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> label,
        mozilla::Span<uint8_t const> content,
        const uint64_t& len,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<GkExporterOutput>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestExportSecret(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), groupIdentifier);
    // Sentinel = 'groupIdentifier'
    ((&(writer__)))->WriteSentinel(832505393);
    IPC::WriteParam((&(writer__)), identifier);
    // Sentinel = 'identifier'
    ((&(writer__)))->WriteSentinel(379978788);
    IPC::WriteParam((&(writer__)), label);
    // Sentinel = 'label'
    ((&(writer__)))->WriteSentinel(100729345);
    IPC::WriteParam((&(writer__)), content);
    // Sentinel = 'content'
    ((&(writer__)))->WriteSentinel(197853948);
    IPC::WriteParam((&(writer__)), len);
    // Sentinel = 'len'
    ((&(writer__)))->WriteSentinel(41877824);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestExportSecret", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestExportSecret__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<GkExporterOutput>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'GkExporterOutput?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GkExporterOutput?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestExportSecret(
        mozilla::Span<uint8_t const> groupIdentifier,
        mozilla::Span<uint8_t const> identifier,
        mozilla::Span<uint8_t const> label,
        mozilla::Span<uint8_t const> content,
        const uint64_t& len) -> RefPtr<RequestExportSecretPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<GkExporterOutput>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<GkExporterOutput>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestExportSecret(std::forward<mozilla::Span<uint8_t const>>(groupIdentifier), std::forward<mozilla::Span<uint8_t const>>(identifier), std::forward<mozilla::Span<uint8_t const>>(label), std::forward<mozilla::Span<uint8_t const>>(content), std::forward<const uint64_t&>(len), [promise__](mozilla::Maybe<GkExporterOutput>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGetGroupIdentifier(
        mozilla::Span<uint8_t const> message,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGetGroupIdentifier(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), message);
    // Sentinel = 'message'
    ((&(writer__)))->WriteSentinel(197198566);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGetGroupIdentifier", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGetGroupIdentifier__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGetGroupIdentifier(mozilla::Span<uint8_t const> message) -> RefPtr<RequestGetGroupIdentifierPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGetGroupIdentifier(std::forward<mozilla::Span<uint8_t const>>(message), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::SendRequestGetGroupEpoch(
        mozilla::Span<uint8_t const> message,
        mozilla::ipc::ResolveCallback<mozilla::Maybe<RawBytes>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PMLSTransaction::Msg_RequestGetGroupEpoch(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), message);
    // Sentinel = 'message'
    ((&(writer__)))->WriteSentinel(197198566);


    if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PMLSTransactionChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGetGroupEpoch", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PMLSTransaction::Reply_RequestGetGroupEpoch__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<mozilla::Maybe<RawBytes>>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'RawBytes?'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'RawBytes?'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PMLSTransactionChild::SendRequestGetGroupEpoch(mozilla::Span<uint8_t const> message) -> RefPtr<RequestGetGroupEpochPromise>
{
    RefPtr<MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<RawBytes>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendRequestGetGroupEpoch(std::forward<mozilla::Span<uint8_t const>>(message), [promise__](mozilla::Maybe<RawBytes>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PMLSTransactionChild::DeallocManagee(
        mozilla::ipc::ProtocolId aProtocolId,
        IProtocol* aListener) -> void
{
    FatalError("unreached");
    return;
}

auto PMLSTransactionChild::OnMessageReceived(const Message& msg__) -> PMLSTransactionChild::Result
{
    if (!CanSend()) {
        if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
            mozilla::ipc::LogMessageForProtocol(
                "PMLSTransactionChild",
                this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                "Ignored message for dead actor",
                (&(msg__))->type(),
                mozilla::ipc::MessageDirection::eSending);
        }
        return MsgProcessed;

    }
    switch (msg__.type()) {
    case PMLSTransaction::Reply_RequestStateDelete__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestStateDelete", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupStateDelete__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupStateDelete", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGenerateIdentityKeypair__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateIdentityKeypair", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGenerateCredentialBasic__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateCredentialBasic", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGenerateKeyPackage__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGenerateKeyPackage", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupCreate__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupCreate", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupJoin__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupJoin", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupAdd__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupAdd", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupProposeAdd__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupProposeAdd", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupRemove__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupRemove", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupProposeRemove__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupProposeRemove", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupClose__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupClose", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGroupDetails__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGroupDetails", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestSend__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestSend", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestReceive__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestReceive", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestHasPendingProposals__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestHasPendingProposals", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestClearPendingProposals__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestClearPendingProposals", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestHasPendingCommit__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestHasPendingCommit", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestClearPendingCommit__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestClearPendingCommit", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestApplyPendingCommit__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestApplyPendingCommit", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestExportSecret__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestExportSecret", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGetGroupIdentifier__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGetGroupIdentifier", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PMLSTransaction::Reply_RequestGetGroupEpoch__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PMLSTransaction", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PMLSTransactionChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PMLSTransaction::Msg_RequestGetGroupEpoch", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    default:
        return MsgNotKnown;
    case SHMEM_CREATED_MESSAGE_TYPE:
        {
            if (!ShmemCreated(msg__)) {
                return MsgPayloadError;
            }
            return MsgProcessed;
        }
    case SHMEM_DESTROYED_MESSAGE_TYPE:
        {
            if (!ShmemDestroyed(msg__)) {
                return MsgPayloadError;
            }
            return MsgProcessed;
        }
    }
}

auto PMLSTransactionChild::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PMLSTransactionChild::Result
{
    if (!CanSend()) {
        return MsgDropped;

    }
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
    return MsgNotKnown;
}



} // namespace dom
} // namespace mozilla
