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


#include "google/protobuf/api.qpb.h"

#include <QtProtobuf/qprotobufregistration.h>

#include <cmath>

namespace google::protobuf {

class Api_QtProtobufData : public QSharedData
{
public:
    Api_QtProtobufData()
        : QSharedData(),
          m_sourceContext(nullptr),
          m_syntax(SyntaxGadget::Syntax::SYNTAX_PROTO2)
    {
    }

    Api_QtProtobufData(const Api_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_methods(other.m_methods),
          m_options(other.m_options),
          m_version(other.m_version),
          m_sourceContext(other.m_sourceContext
                                               ? new SourceContext(*other.m_sourceContext)
                                               : nullptr),
          m_mixins(other.m_mixins),
          m_syntax(other.m_syntax),
          m_edition(other.m_edition)
    {
    }

    QString m_name;
    QList<Method> m_methods;
    QList<Option> m_options;
    QString m_version;
    QtProtobufPrivate::QProtobufLazyMessagePointer<SourceContext> m_sourceContext;
    QList<Mixin> m_mixins;
    SyntaxGadget::Syntax m_syntax;
    QString m_edition;
};

Api::~Api() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 33> qt_protobuf_Api_uint_data;
    const char qt_protobuf_Api_char_data[86];
} qt_protobuf_Api_metadata {
    // data
    {
        0, /* = version */
        8, /* = num fields */
        9, /* = field number offset */
        17, /* = property index offset */
        25, /* = field flags offset */
        19, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        20, /* = name */
        25, /* = methods */
        33, /* = options */
        41, /* = version */
        49, /* = sourceContext */
        63, /* = mixins */
        70, /* = syntax */
        77, /* = edition */
        85, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = methods */
        3, /* = options */
        4, /* = version */
        5, /* = sourceContext */
        6, /* = mixins */
        7, /* = syntax */
        8, /* = edition */
        // Property indices:
        0, /* = name */
        1, /* = methods */
        3, /* = options */
        5, /* = version */
        6, /* = sourceContext */
        8, /* = mixins */
        10, /* = syntax */
        11, /* = edition */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = methods */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = version */
        uint(QtProtobufPrivate::FieldFlag::ExplicitPresence | QtProtobufPrivate::FieldFlag::Message), /* = sourceContext */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = mixins */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = syntax */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = edition */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Api\0" /* = full message name */
    /* field char_data: */
    "name\0methods\0options\0version\0sourceContext\0"
    "mixins\0syntax\0edition\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Api::staticPropertyOrdering = {
    &qt_protobuf_Api_metadata.data
};

void Api::registerTypes()
{
    qRegisterMetaType<Api>();
    qRegisterMetaType<QList<Api>>();
}

Api::Api()
    : QProtobufMessage(&Api::staticMetaObject, &Api::staticPropertyOrdering),
      dptr(new Api_QtProtobufData)
{
}

Api::Api(const Api &other)
    = default;
Api &Api::operator =(const Api &other)
{
    Api temp(other);
    swap(temp);
    return *this;
}
Api::Api(Api &&other) noexcept
    = default;
Api::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Api &lhs, const Api &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_methods == rhs.dptr->m_methods
        && lhs.dptr->m_options == rhs.dptr->m_options
        && lhs.dptr->m_version == rhs.dptr->m_version
        && (lhs.dptr->m_sourceContext == rhs.dptr->m_sourceContext
            || *lhs.dptr->m_sourceContext == *rhs.dptr->m_sourceContext)
        && lhs.dptr->m_mixins == rhs.dptr->m_mixins
        && lhs.dptr->m_syntax == rhs.dptr->m_syntax
        && lhs.dptr->m_edition == rhs.dptr->m_edition;
}

const QString &Api::name() const &
{
    return dptr->m_name;
}

const QList<Method> &Api::methods() const &
{
    return dptr->m_methods;
}

const QList<Option> &Api::options() const &
{
    return dptr->m_options;
}

const QString &Api::version() const &
{
    return dptr->m_version;
}

SourceContext *Api::sourceContext_p()
{
    if (!dptr->m_sourceContext)
        dptr.detach();
    return dptr->m_sourceContext.get();
}

bool Api::hasSourceContext() const
{
    return dptr->m_sourceContext.operator bool();
}

const SourceContext &Api::sourceContext() const &
{
    return *dptr->m_sourceContext;
}

SourceContext &Api::mutSourceContext() &
{
    dptr.detach();
    return *dptr->m_sourceContext;
}

void Api::clearSourceContext()
{
    if (dptr->m_sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset();
    }
}

const QList<Mixin> &Api::mixins() const &
{
    return dptr->m_mixins;
}

SyntaxGadget::Syntax Api::syntax() const
{
    return dptr->m_syntax;
}

const QString &Api::edition() const &
{
    return dptr->m_edition;
}

void Api::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Api::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Api::setMethods(const QList<Method> &methods)
{
    if (dptr->m_methods != methods) {
        dptr.detach();
        dptr->m_methods = methods;
    }
}

void Api::setMethods(QList<Method> &&methods)
{
    if (dptr->m_methods != methods) {
        dptr.detach();
        dptr->m_methods = std::move(methods);
    }
}

void Api::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void Api::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}

void Api::setVersion(const QString &version)
{
    if (dptr->m_version != version) {
        dptr.detach();
        dptr->m_version = version;
    }
}

void Api::setVersion(QString &&version)
{
    if (dptr->m_version != version) {
        dptr.detach();
        dptr->m_version = std::move(version);
    }
}

void Api::setSourceContext_p(SourceContext *sourceContext)
{
    if (dptr->m_sourceContext.get() != sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset(sourceContext);
    }
}

void Api::setSourceContext(const SourceContext &sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = sourceContext;
    }
}

void Api::setSourceContext(SourceContext &&sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = std::move(sourceContext);
    }
}

void Api::setMixins(const QList<Mixin> &mixins)
{
    if (dptr->m_mixins != mixins) {
        dptr.detach();
        dptr->m_mixins = mixins;
    }
}

void Api::setMixins(QList<Mixin> &&mixins)
{
    if (dptr->m_mixins != mixins) {
        dptr.detach();
        dptr->m_mixins = std::move(mixins);
    }
}

void Api::setSyntax(SyntaxGadget::Syntax syntax)
{
    if (dptr->m_syntax != syntax) {
        dptr.detach();
        dptr->m_syntax = syntax;
    }
}

void Api::setEdition(const QString &edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = edition;
    }
}

void Api::setEdition(QString &&edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = std::move(edition);
    }
}


class Method_QtProtobufData : public QSharedData
{
public:
    Method_QtProtobufData()
        : QSharedData(),
          m_requestStreaming(false),
          m_responseStreaming(false),
          m_syntax(SyntaxGadget::Syntax::SYNTAX_PROTO2)
    {
    }

    Method_QtProtobufData(const Method_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_requestTypeUrl(other.m_requestTypeUrl),
          m_requestStreaming(other.m_requestStreaming),
          m_responseTypeUrl(other.m_responseTypeUrl),
          m_responseStreaming(other.m_responseStreaming),
          m_options(other.m_options),
          m_syntax(other.m_syntax),
          m_edition(other.m_edition)
    {
    }

    QString m_name;
    QString m_requestTypeUrl;
    bool m_requestStreaming;
    QString m_responseTypeUrl;
    bool m_responseStreaming;
    QList<Option> m_options;
    SyntaxGadget::Syntax m_syntax;
    QString m_edition;
};

Method::~Method() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 33> qt_protobuf_Method_uint_data;
    const char qt_protobuf_Method_char_data[118];
} qt_protobuf_Method_metadata {
    // data
    {
        0, /* = version */
        8, /* = num fields */
        9, /* = field number offset */
        17, /* = property index offset */
        25, /* = field flags offset */
        22, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        23, /* = name */
        28, /* = requestTypeUrl */
        43, /* = requestStreaming */
        60, /* = responseTypeUrl */
        76, /* = responseStreaming */
        94, /* = options */
        102, /* = syntax */
        109, /* = edition */
        117, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = requestTypeUrl */
        3, /* = requestStreaming */
        4, /* = responseTypeUrl */
        5, /* = responseStreaming */
        6, /* = options */
        7, /* = syntax */
        8, /* = edition */
        // Property indices:
        0, /* = name */
        1, /* = requestTypeUrl */
        2, /* = requestStreaming */
        3, /* = responseTypeUrl */
        4, /* = responseStreaming */
        5, /* = options */
        7, /* = syntax */
        8, /* = edition */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = requestTypeUrl */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = requestStreaming */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = responseTypeUrl */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = responseStreaming */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = syntax */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = edition */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Method\0" /* = full message name */
    /* field char_data: */
    "name\0requestTypeUrl\0requestStreaming\0responseTypeUrl\0responseStreaming\0"
    "options\0syntax\0edition\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Method::staticPropertyOrdering = {
    &qt_protobuf_Method_metadata.data
};

void Method::registerTypes()
{
    qRegisterMetaType<Method>();
    qRegisterMetaType<QList<Method>>();
}

Method::Method()
    : QProtobufMessage(&Method::staticMetaObject, &Method::staticPropertyOrdering),
      dptr(new Method_QtProtobufData)
{
}

Method::Method(const Method &other)
    = default;
Method &Method::operator =(const Method &other)
{
    Method temp(other);
    swap(temp);
    return *this;
}
Method::Method(Method &&other) noexcept
    = default;
Method::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Method &lhs, const Method &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_requestTypeUrl == rhs.dptr->m_requestTypeUrl
        && lhs.dptr->m_requestStreaming == rhs.dptr->m_requestStreaming
        && lhs.dptr->m_responseTypeUrl == rhs.dptr->m_responseTypeUrl
        && lhs.dptr->m_responseStreaming == rhs.dptr->m_responseStreaming
        && lhs.dptr->m_options == rhs.dptr->m_options
        && lhs.dptr->m_syntax == rhs.dptr->m_syntax
        && lhs.dptr->m_edition == rhs.dptr->m_edition;
}

const QString &Method::name() const &
{
    return dptr->m_name;
}

const QString &Method::requestTypeUrl() const &
{
    return dptr->m_requestTypeUrl;
}

bool Method::requestStreaming() const
{
    return dptr->m_requestStreaming;
}

const QString &Method::responseTypeUrl() const &
{
    return dptr->m_responseTypeUrl;
}

bool Method::responseStreaming() const
{
    return dptr->m_responseStreaming;
}

const QList<Option> &Method::options() const &
{
    return dptr->m_options;
}

SyntaxGadget::Syntax Method::syntax() const
{
    return dptr->m_syntax;
}

const QString &Method::edition() const &
{
    return dptr->m_edition;
}

void Method::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Method::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Method::setRequestTypeUrl(const QString &requestTypeUrl)
{
    if (dptr->m_requestTypeUrl != requestTypeUrl) {
        dptr.detach();
        dptr->m_requestTypeUrl = requestTypeUrl;
    }
}

void Method::setRequestTypeUrl(QString &&requestTypeUrl)
{
    if (dptr->m_requestTypeUrl != requestTypeUrl) {
        dptr.detach();
        dptr->m_requestTypeUrl = std::move(requestTypeUrl);
    }
}

void Method::setRequestStreaming(bool requestStreaming)
{
    if (dptr->m_requestStreaming != requestStreaming) {
        dptr.detach();
        dptr->m_requestStreaming = requestStreaming;
    }
}

void Method::setResponseTypeUrl(const QString &responseTypeUrl)
{
    if (dptr->m_responseTypeUrl != responseTypeUrl) {
        dptr.detach();
        dptr->m_responseTypeUrl = responseTypeUrl;
    }
}

void Method::setResponseTypeUrl(QString &&responseTypeUrl)
{
    if (dptr->m_responseTypeUrl != responseTypeUrl) {
        dptr.detach();
        dptr->m_responseTypeUrl = std::move(responseTypeUrl);
    }
}

void Method::setResponseStreaming(bool responseStreaming)
{
    if (dptr->m_responseStreaming != responseStreaming) {
        dptr.detach();
        dptr->m_responseStreaming = responseStreaming;
    }
}

void Method::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void Method::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}

void Method::setSyntax(SyntaxGadget::Syntax syntax)
{
    if (dptr->m_syntax != syntax) {
        dptr.detach();
        dptr->m_syntax = syntax;
    }
}

void Method::setEdition(const QString &edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = edition;
    }
}

void Method::setEdition(QString &&edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = std::move(edition);
    }
}


class Mixin_QtProtobufData : public QSharedData
{
public:
    Mixin_QtProtobufData()
        : QSharedData()
    {
    }

    Mixin_QtProtobufData(const Mixin_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_root(other.m_root)
    {
    }

    QString m_name;
    QString m_root;
};

Mixin::~Mixin() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 9> qt_protobuf_Mixin_uint_data;
    const char qt_protobuf_Mixin_char_data[33];
} qt_protobuf_Mixin_metadata {
    // data
    {
        0, /* = version */
        2, /* = num fields */
        3, /* = field number offset */
        5, /* = property index offset */
        7, /* = field flags offset */
        21, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        22, /* = name */
        27, /* = root */
        32, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = root */
        // Property indices:
        0, /* = name */
        1, /* = root */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = root */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Mixin\0" /* = full message name */
    /* field char_data: */
    "name\0root\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Mixin::staticPropertyOrdering = {
    &qt_protobuf_Mixin_metadata.data
};

void Mixin::registerTypes()
{
    qRegisterMetaType<Mixin>();
    qRegisterMetaType<QList<Mixin>>();
}

Mixin::Mixin()
    : QProtobufMessage(&Mixin::staticMetaObject, &Mixin::staticPropertyOrdering),
      dptr(new Mixin_QtProtobufData)
{
}

Mixin::Mixin(const Mixin &other)
    = default;
Mixin &Mixin::operator =(const Mixin &other)
{
    Mixin temp(other);
    swap(temp);
    return *this;
}
Mixin::Mixin(Mixin &&other) noexcept
    = default;
Mixin::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Mixin &lhs, const Mixin &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_root == rhs.dptr->m_root;
}

const QString &Mixin::name() const &
{
    return dptr->m_name;
}

const QString &Mixin::root() const &
{
    return dptr->m_root;
}

void Mixin::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Mixin::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Mixin::setRoot(const QString &root)
{
    if (dptr->m_root != root) {
        dptr.detach();
        dptr->m_root = root;
    }
}

void Mixin::setRoot(QString &&root)
{
    if (dptr->m_root != root) {
        dptr.detach();
        dptr->m_root = std::move(root);
    }
}

} // namespace google::protobuf

#include "moc_api.qpb.cpp"
