/**
 * 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 "SequenceNumber.h"

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

SequenceNumber::SequenceNumber() {
  m_SqnSchemeIsSet = false;
  m_Sqn = "";
  m_SqnIsSet = false;
  m_LastIndexesIsSet = false;
  m_IndLength = 0;
  m_IndLengthIsSet = false;
  m_DifSignIsSet = false;
}

SequenceNumber::~SequenceNumber() {}

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

void to_json(nlohmann::json &j, const SequenceNumber &o) {
  j = nlohmann::json();
  if (o.sqnSchemeIsSet())
    j["sqnScheme"] = o.m_SqnScheme;
  if (o.sqnIsSet())
    j["sqn"] = o.m_Sqn;
  if (o.lastIndexesIsSet() || !o.m_LastIndexes.empty())
    j["lastIndexes"] = o.m_LastIndexes;
  if (o.indLengthIsSet())
    j["indLength"] = o.m_IndLength;
  if (o.difSignIsSet())
    j["difSign"] = o.m_DifSign;
}

void from_json(const nlohmann::json &j, SequenceNumber &o) {
  if (j.find("sqnScheme") != j.end()) {
    j.at("sqnScheme").get_to(o.m_SqnScheme);
    o.m_SqnSchemeIsSet = true;
  }
  if (j.find("sqn") != j.end()) {
    j.at("sqn").get_to(o.m_Sqn);
    o.m_SqnIsSet = true;
  }
  if (j.find("lastIndexes") != j.end()) {
    j.at("lastIndexes").get_to(o.m_LastIndexes);
    o.m_LastIndexesIsSet = true;
  }
  if (j.find("indLength") != j.end()) {
    j.at("indLength").get_to(o.m_IndLength);
    o.m_IndLengthIsSet = true;
  }
  if (j.find("difSign") != j.end()) {
    j.at("difSign").get_to(o.m_DifSign);
    o.m_DifSignIsSet = true;
  }
}

SqnScheme SequenceNumber::getSqnScheme() const { return m_SqnScheme; }
void SequenceNumber::setSqnScheme(SqnScheme const &value) {
  m_SqnScheme = value;
  m_SqnSchemeIsSet = true;
}
bool SequenceNumber::sqnSchemeIsSet() const { return m_SqnSchemeIsSet; }
void SequenceNumber::unsetSqnScheme() { m_SqnSchemeIsSet = false; }
std::string SequenceNumber::getSqn() const { return m_Sqn; }
void SequenceNumber::setSqn(std::string const &value) {
  m_Sqn = value;
  m_SqnIsSet = true;
}
bool SequenceNumber::sqnIsSet() const { return m_SqnIsSet; }
void SequenceNumber::unsetSqn() { m_SqnIsSet = false; }
std::map<std::string, int32_t> &SequenceNumber::getLastIndexes() {
  return m_LastIndexes;
}
void SequenceNumber::setLastIndexes(
    std::map<std::string, int32_t> const value) {
  m_LastIndexes = value;
  m_LastIndexesIsSet = true;
}
bool SequenceNumber::lastIndexesIsSet() const { return m_LastIndexesIsSet; }
void SequenceNumber::unsetLastIndexes() { m_LastIndexesIsSet = false; }
int32_t SequenceNumber::getIndLength() const { return m_IndLength; }
void SequenceNumber::setIndLength(int32_t const value) {
  m_IndLength = value;
  m_IndLengthIsSet = true;
}
bool SequenceNumber::indLengthIsSet() const { return m_IndLengthIsSet; }
void SequenceNumber::unsetIndLength() { m_IndLengthIsSet = false; }
Sign SequenceNumber::getDifSign() const { return m_DifSign; }
void SequenceNumber::setDifSign(Sign const &value) {
  m_DifSign = value;
  m_DifSignIsSet = true;
}
bool SequenceNumber::difSignIsSet() const { return m_DifSignIsSet; }
void SequenceNumber::unsetDifSign() { m_DifSignIsSet = false; }

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