/**
 * Nsmf_PDUSession
 * SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
 * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 1.1.0.alpha-1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "ProblemDetails.h"

namespace oai {
namespace smf_server {
namespace model {

ProblemDetails::ProblemDetails() {
  m_Type                   = "";
  m_TypeIsSet              = false;
  m_Title                  = "";
  m_TitleIsSet             = false;
  m_Status                 = 0;
  m_StatusIsSet            = false;
  m_Detail                 = "";
  m_DetailIsSet            = false;
  m_Instance               = "";
  m_InstanceIsSet          = false;
  m_Cause                  = "";
  m_CauseIsSet             = false;
  m_InvalidParamsIsSet     = false;
  m_SupportedFeatures      = "";
  m_SupportedFeaturesIsSet = false;
}

ProblemDetails::~ProblemDetails() {}

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

void to_json(nlohmann::json& j, const ProblemDetails& o) {
  j = nlohmann::json();
  if (o.typeIsSet()) j["type"] = o.m_Type;
  if (o.titleIsSet()) j["title"] = o.m_Title;
  if (o.statusIsSet()) j["status"] = o.m_Status;
  if (o.detailIsSet()) j["detail"] = o.m_Detail;
  if (o.instanceIsSet()) j["instance"] = o.m_Instance;
  if (o.causeIsSet()) j["cause"] = o.m_Cause;
  if (o.invalidParamsIsSet() || !o.m_InvalidParams.empty())
    j["invalidParams"] = o.m_InvalidParams;
  if (o.supportedFeaturesIsSet())
    j["supportedFeatures"] = o.m_SupportedFeatures;
}

void from_json(const nlohmann::json& j, ProblemDetails& o) {
  if (j.find("type") != j.end()) {
    j.at("type").get_to(o.m_Type);
    o.m_TypeIsSet = true;
  }
  if (j.find("title") != j.end()) {
    j.at("title").get_to(o.m_Title);
    o.m_TitleIsSet = true;
  }
  if (j.find("status") != j.end()) {
    j.at("status").get_to(o.m_Status);
    o.m_StatusIsSet = true;
  }
  if (j.find("detail") != j.end()) {
    j.at("detail").get_to(o.m_Detail);
    o.m_DetailIsSet = true;
  }
  if (j.find("instance") != j.end()) {
    j.at("instance").get_to(o.m_Instance);
    o.m_InstanceIsSet = true;
  }
  if (j.find("cause") != j.end()) {
    j.at("cause").get_to(o.m_Cause);
    o.m_CauseIsSet = true;
  }
  if (j.find("invalidParams") != j.end()) {
    j.at("invalidParams").get_to(o.m_InvalidParams);
    o.m_InvalidParamsIsSet = true;
  }
  if (j.find("supportedFeatures") != j.end()) {
    j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
    o.m_SupportedFeaturesIsSet = true;
  }
}

std::string ProblemDetails::getType() const {
  return m_Type;
}
void ProblemDetails::setType(std::string const& value) {
  m_Type      = value;
  m_TypeIsSet = true;
}
bool ProblemDetails::typeIsSet() const {
  return m_TypeIsSet;
}
void ProblemDetails::unsetType() {
  m_TypeIsSet = false;
}
std::string ProblemDetails::getTitle() const {
  return m_Title;
}
void ProblemDetails::setTitle(std::string const& value) {
  m_Title      = value;
  m_TitleIsSet = true;
}
bool ProblemDetails::titleIsSet() const {
  return m_TitleIsSet;
}
void ProblemDetails::unsetTitle() {
  m_TitleIsSet = false;
}
int32_t ProblemDetails::getStatus() const {
  return m_Status;
}
void ProblemDetails::setStatus(int32_t const value) {
  m_Status      = value;
  m_StatusIsSet = true;
}
bool ProblemDetails::statusIsSet() const {
  return m_StatusIsSet;
}
void ProblemDetails::unsetStatus() {
  m_StatusIsSet = false;
}
std::string ProblemDetails::getDetail() const {
  return m_Detail;
}
void ProblemDetails::setDetail(std::string const& value) {
  m_Detail      = value;
  m_DetailIsSet = true;
}
bool ProblemDetails::detailIsSet() const {
  return m_DetailIsSet;
}
void ProblemDetails::unsetDetail() {
  m_DetailIsSet = false;
}
std::string ProblemDetails::getInstance() const {
  return m_Instance;
}
void ProblemDetails::setInstance(std::string const& value) {
  m_Instance      = value;
  m_InstanceIsSet = true;
}
bool ProblemDetails::instanceIsSet() const {
  return m_InstanceIsSet;
}
void ProblemDetails::unsetInstance() {
  m_InstanceIsSet = false;
}
std::string ProblemDetails::getCause() const {
  return m_Cause;
}
void ProblemDetails::setCause(std::string const& value) {
  m_Cause      = value;
  m_CauseIsSet = true;
}
bool ProblemDetails::causeIsSet() const {
  return m_CauseIsSet;
}
void ProblemDetails::unsetCause() {
  m_CauseIsSet = false;
}
std::vector<InvalidParam>& ProblemDetails::getInvalidParams() {
  return m_InvalidParams;
}
void ProblemDetails::setInvalidParams(std::vector<InvalidParam> const& value) {
  m_InvalidParams      = value;
  m_InvalidParamsIsSet = true;
}
bool ProblemDetails::invalidParamsIsSet() const {
  return m_InvalidParamsIsSet;
}
void ProblemDetails::unsetInvalidParams() {
  m_InvalidParamsIsSet = false;
}
std::string ProblemDetails::getSupportedFeatures() const {
  return m_SupportedFeatures;
}
void ProblemDetails::setSupportedFeatures(std::string const& value) {
  m_SupportedFeatures      = value;
  m_SupportedFeaturesIsSet = true;
}
bool ProblemDetails::supportedFeaturesIsSet() const {
  return m_SupportedFeaturesIsSet;
}
void ProblemDetails::unsetSupportedFeatures() {
  m_SupportedFeaturesIsSet = false;
}

}  // namespace model
}  // namespace smf_server
}  // namespace oai
