/**
* Swagger Petstore
* This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/


#include "ApiResponse.h"

namespace io {
namespace swagger {
namespace server {
namespace model {

ApiResponse::ApiResponse()
{
    m_Code = 0;
    m_CodeIsSet = false;
    m_Type = "";
    m_TypeIsSet = false;
    m_Message = "";
    m_MessageIsSet = false;
    
}

ApiResponse::~ApiResponse()
{
}

void ApiResponse::validate()
{
    // TODO: implement validation
}

nlohmann::json ApiResponse::toJson() const
{
    nlohmann::json val = nlohmann::json::object();

    if(m_CodeIsSet)
    {
        val["code"] = m_Code;
    }
    if(m_TypeIsSet)
    {
        val["type"] = ModelBase::toJson(m_Type);
    }
    if(m_MessageIsSet)
    {
        val["message"] = ModelBase::toJson(m_Message);
    }
    

    return val;
}

void ApiResponse::fromJson(nlohmann::json& val)
{
    if(val.find("code") != val.end())
    {
        setCode(val.at("code"));
    }
    if(val.find("type") != val.end())
    {
        setType(val.at("type"));
        
    }
    if(val.find("message") != val.end())
    {
        setMessage(val.at("message"));
        
    }
    
}


int32_t ApiResponse::getCode() const
{
    return m_Code;
}
void ApiResponse::setCode(int32_t value)
{
    m_Code = value;
    m_CodeIsSet = true;
}
bool ApiResponse::codeIsSet() const
{
    return m_CodeIsSet;
}
void ApiResponse::unsetCode()
{
    m_CodeIsSet = false;
}
std::string ApiResponse::getType() const
{
    return m_Type;
}
void ApiResponse::setType(std::string value)
{
    m_Type = value;
    m_TypeIsSet = true;
}
bool ApiResponse::typeIsSet() const
{
    return m_TypeIsSet;
}
void ApiResponse::unsetType()
{
    m_TypeIsSet = false;
}
std::string ApiResponse::getMessage() const
{
    return m_Message;
}
void ApiResponse::setMessage(std::string value)
{
    m_Message = value;
    m_MessageIsSet = true;
}
bool ApiResponse::messageIsSet() const
{
    return m_MessageIsSet;
}
void ApiResponse::unsetMessage()
{
    m_MessageIsSet = false;
}

}
}
}
}

