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

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

AfExternal::AfExternal() {
  m_AfId = "";
  m_AfIdIsSet = false;
  m_AllowedGeographicAreaIsSet = false;
  m_PrivacyCheckRelatedActionIsSet = false;
  m_ValidTimePeriodIsSet = false;
}

AfExternal::~AfExternal() {}

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

void to_json(nlohmann::json &j, const AfExternal &o) {
  j = nlohmann::json();
  if (o.afIdIsSet())
    j["afId"] = o.m_AfId;
  if (o.allowedGeographicAreaIsSet() || !o.m_AllowedGeographicArea.empty())
    j["allowedGeographicArea"] = o.m_AllowedGeographicArea;
  if (o.privacyCheckRelatedActionIsSet())
    j["privacyCheckRelatedAction"] = o.m_PrivacyCheckRelatedAction;
  if (o.validTimePeriodIsSet())
    j["validTimePeriod"] = o.m_ValidTimePeriod;
}

void from_json(const nlohmann::json &j, AfExternal &o) {
  if (j.find("afId") != j.end()) {
    j.at("afId").get_to(o.m_AfId);
    o.m_AfIdIsSet = true;
  }
  if (j.find("allowedGeographicArea") != j.end()) {
    j.at("allowedGeographicArea").get_to(o.m_AllowedGeographicArea);
    o.m_AllowedGeographicAreaIsSet = true;
  }
  if (j.find("privacyCheckRelatedAction") != j.end()) {
    j.at("privacyCheckRelatedAction").get_to(o.m_PrivacyCheckRelatedAction);
    o.m_PrivacyCheckRelatedActionIsSet = true;
  }
  if (j.find("validTimePeriod") != j.end()) {
    j.at("validTimePeriod").get_to(o.m_ValidTimePeriod);
    o.m_ValidTimePeriodIsSet = true;
  }
}

std::string AfExternal::getAfId() const { return m_AfId; }
void AfExternal::setAfId(std::string const &value) {
  m_AfId = value;
  m_AfIdIsSet = true;
}
bool AfExternal::afIdIsSet() const { return m_AfIdIsSet; }
void AfExternal::unsetAfId() { m_AfIdIsSet = false; }
std::vector<GeographicArea> &AfExternal::getAllowedGeographicArea() {
  return m_AllowedGeographicArea;
}
void AfExternal::setAllowedGeographicArea(
    std::vector<GeographicArea> const &value) {
  m_AllowedGeographicArea = value;
  m_AllowedGeographicAreaIsSet = true;
}
bool AfExternal::allowedGeographicAreaIsSet() const {
  return m_AllowedGeographicAreaIsSet;
}
void AfExternal::unsetAllowedGeographicArea() {
  m_AllowedGeographicAreaIsSet = false;
}
PrivacyCheckRelatedAction AfExternal::getPrivacyCheckRelatedAction() const {
  return m_PrivacyCheckRelatedAction;
}
void AfExternal::setPrivacyCheckRelatedAction(
    PrivacyCheckRelatedAction const &value) {
  m_PrivacyCheckRelatedAction = value;
  m_PrivacyCheckRelatedActionIsSet = true;
}
bool AfExternal::privacyCheckRelatedActionIsSet() const {
  return m_PrivacyCheckRelatedActionIsSet;
}
void AfExternal::unsetPrivacyCheckRelatedAction() {
  m_PrivacyCheckRelatedActionIsSet = false;
}
ValidTimePeriod AfExternal::getValidTimePeriod() const {
  return m_ValidTimePeriod;
}
void AfExternal::setValidTimePeriod(ValidTimePeriod const &value) {
  m_ValidTimePeriod = value;
  m_ValidTimePeriodIsSet = true;
}
bool AfExternal::validTimePeriodIsSet() const { return m_ValidTimePeriodIsSet; }
void AfExternal::unsetValidTimePeriod() { m_ValidTimePeriodIsSet = false; }

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