//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a RdGen v1.13.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#include "RequestFailed.Pregenerated.h"



#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable:4250 )
#pragma warning( disable:4307 )
#pragma warning( disable:4267 )
#pragma warning( disable:4244 )
#pragma warning( disable:4100 )
#endif

namespace JetBrains {
namespace EditorPlugin {
// companion
// constants
// initializer
void RequestFailed::initialize()
{
}
// primary ctor
RequestFailed::RequestFailed(NotificationType type_, FString message_, int32_t requestID_) :
RequestResultBase(std::move(requestID_))
,type_(std::move(type_)), message_(std::move(message_))
{
    initialize();
}
// secondary constructor
// default ctors and dtors
// reader
RequestFailed RequestFailed::read(rd::SerializationCtx& ctx, rd::Buffer & buffer)
{
    auto requestID_ = buffer.read_integral<int32_t>();
    auto type_ = rd::Polymorphic<NotificationType>::read(ctx, buffer);
    auto message_ = rd::Polymorphic<FString>::read(ctx, buffer);
    RequestFailed res{std::move(type_), std::move(message_), std::move(requestID_)};
    return res;
}
// writer
void RequestFailed::write(rd::SerializationCtx& ctx, rd::Buffer& buffer) const
{
    buffer.write_integral(requestID_);
    rd::Polymorphic<NotificationType>::write(ctx, buffer, type_);
    rd::Polymorphic<std::decay_t<decltype(message_)>>::write(ctx, buffer, message_);
}
// virtual init
// identify
// getters
NotificationType const & RequestFailed::get_type() const
{
    return type_;
}
FString const & RequestFailed::get_message() const
{
    return message_;
}
// intern
// equals trait
bool RequestFailed::equals(rd::ISerializable const& object) const
{
    auto const &other = dynamic_cast<RequestFailed const&>(object);
    if (this == &other) return true;
    if (this->type_ != other.type_) return false;
    if (this->message_ != other.message_) return false;
    if (this->requestID_ != other.requestID_) return false;
    
    return true;
}
// equality operators
bool operator==(const RequestFailed &lhs, const RequestFailed &rhs) {
    if (lhs.type_name() != rhs.type_name()) return false;
    return lhs.equals(rhs);
}
bool operator!=(const RequestFailed &lhs, const RequestFailed &rhs){
    return !(lhs == rhs);
}
// hash code trait
size_t RequestFailed::hashCode() const noexcept
{
    size_t __r = 0;
    __r = __r * 31 + (rd::hash<NotificationType>()(get_type()));
    __r = __r * 31 + (rd::hash<FString>()(get_message()));
    __r = __r * 31 + (rd::hash<int32_t>()(get_requestID()));
    return __r;
}
// type name trait
std::string RequestFailed::type_name() const
{
    return "RequestFailed";
}
// static type name trait
std::string RequestFailed::static_type_name()
{
    return "RequestFailed";
}
// polymorphic to string
std::string RequestFailed::toString() const
{
    std::string res = "RequestFailed\n";
    res += "\ttype = ";
    res += rd::to_string(type_);
    res += '\n';
    res += "\tmessage = ";
    res += rd::to_string(message_);
    res += '\n';
    res += "\trequestID = ";
    res += rd::to_string(requestID_);
    res += '\n';
    return res;
}
// external to string
std::string to_string(const RequestFailed & value)
{
    return value.toString();
}
}
}

#ifdef _MSC_VER
#pragma warning( pop )
#endif

