/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "UsageMonDataLimit.h"

namespace org {
namespace openapitools {
namespace server {
namespace model {

UsageMonDataLimit::UsageMonDataLimit() {
  m_LimitId = "";
  m_ScopesIsSet = false;
  m_UmLevelIsSet = false;
  m_StartDate = "";
  m_StartDateIsSet = false;
  m_EndDate = "";
  m_EndDateIsSet = false;
  m_UsageLimitIsSet = false;
  m_ResetPeriod = "";
  m_ResetPeriodIsSet = false;
}

UsageMonDataLimit::~UsageMonDataLimit() {}

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

void to_json(nlohmann::json &j, const UsageMonDataLimit &o) {
  j = nlohmann::json();
  j["limitId"] = o.m_LimitId;
  if (o.scopesIsSet() || !o.m_Scopes.empty())
    j["scopes"] = o.m_Scopes;
  if (o.umLevelIsSet())
    j["umLevel"] = o.m_UmLevel;
  if (o.startDateIsSet())
    j["startDate"] = o.m_StartDate;
  if (o.endDateIsSet())
    j["endDate"] = o.m_EndDate;
  if (o.usageLimitIsSet())
    j["usageLimit"] = o.m_UsageLimit;
  if (o.resetPeriodIsSet())
    j["resetPeriod"] = o.m_ResetPeriod;
}

void from_json(const nlohmann::json &j, UsageMonDataLimit &o) {
  j.at("limitId").get_to(o.m_LimitId);
  if (j.find("scopes") != j.end()) {
    j.at("scopes").get_to(o.m_Scopes);
    o.m_ScopesIsSet = true;
  }
  if (j.find("umLevel") != j.end()) {
    j.at("umLevel").get_to(o.m_UmLevel);
    o.m_UmLevelIsSet = true;
  }
  if (j.find("startDate") != j.end()) {
    j.at("startDate").get_to(o.m_StartDate);
    o.m_StartDateIsSet = true;
  }
  if (j.find("endDate") != j.end()) {
    j.at("endDate").get_to(o.m_EndDate);
    o.m_EndDateIsSet = true;
  }
  if (j.find("usageLimit") != j.end()) {
    j.at("usageLimit").get_to(o.m_UsageLimit);
    o.m_UsageLimitIsSet = true;
  }
  if (j.find("resetPeriod") != j.end()) {
    j.at("resetPeriod").get_to(o.m_ResetPeriod);
    o.m_ResetPeriodIsSet = true;
  }
}

std::string UsageMonDataLimit::getLimitId() const { return m_LimitId; }
void UsageMonDataLimit::setLimitId(std::string const &value) {
  m_LimitId = value;
}
std::map<std::string, UsageMonDataScope> &UsageMonDataLimit::getScopes() {
  return m_Scopes;
}
void UsageMonDataLimit::setScopes(
    std::map<std::string, UsageMonDataScope> const &value) {
  m_Scopes = value;
  m_ScopesIsSet = true;
}
bool UsageMonDataLimit::scopesIsSet() const { return m_ScopesIsSet; }
void UsageMonDataLimit::unsetScopes() { m_ScopesIsSet = false; }
UsageMonLevel UsageMonDataLimit::getUmLevel() const { return m_UmLevel; }
void UsageMonDataLimit::setUmLevel(UsageMonLevel const &value) {
  m_UmLevel = value;
  m_UmLevelIsSet = true;
}
bool UsageMonDataLimit::umLevelIsSet() const { return m_UmLevelIsSet; }
void UsageMonDataLimit::unsetUmLevel() { m_UmLevelIsSet = false; }
std::string UsageMonDataLimit::getStartDate() const { return m_StartDate; }
void UsageMonDataLimit::setStartDate(std::string const &value) {
  m_StartDate = value;
  m_StartDateIsSet = true;
}
bool UsageMonDataLimit::startDateIsSet() const { return m_StartDateIsSet; }
void UsageMonDataLimit::unsetStartDate() { m_StartDateIsSet = false; }
std::string UsageMonDataLimit::getEndDate() const { return m_EndDate; }
void UsageMonDataLimit::setEndDate(std::string const &value) {
  m_EndDate = value;
  m_EndDateIsSet = true;
}
bool UsageMonDataLimit::endDateIsSet() const { return m_EndDateIsSet; }
void UsageMonDataLimit::unsetEndDate() { m_EndDateIsSet = false; }
UsageThreshold UsageMonDataLimit::getUsageLimit() const { return m_UsageLimit; }
void UsageMonDataLimit::setUsageLimit(UsageThreshold const &value) {
  m_UsageLimit = value;
  m_UsageLimitIsSet = true;
}
bool UsageMonDataLimit::usageLimitIsSet() const { return m_UsageLimitIsSet; }
void UsageMonDataLimit::unsetUsageLimit() { m_UsageLimitIsSet = false; }
std::string UsageMonDataLimit::getResetPeriod() const { return m_ResetPeriod; }
void UsageMonDataLimit::setResetPeriod(std::string const &value) {
  m_ResetPeriod = value;
  m_ResetPeriodIsSet = true;
}
bool UsageMonDataLimit::resetPeriodIsSet() const { return m_ResetPeriodIsSet; }
void UsageMonDataLimit::unsetResetPeriod() { m_ResetPeriodIsSet = false; }

} // namespace model
} // namespace server
} // namespace openapitools
} // namespace org
