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

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

PolicyDataSubscription::PolicyDataSubscription() {
  m_NotificationUri = "";
  m_NotifId = "";
  m_NotifIdIsSet = false;
  m_MonResItemsIsSet = false;
  m_Expiry = "";
  m_ExpiryIsSet = false;
  m_SupportedFeatures = "";
  m_SupportedFeaturesIsSet = false;
}

PolicyDataSubscription::~PolicyDataSubscription() {}

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

void to_json(nlohmann::json &j, const PolicyDataSubscription &o) {
  j = nlohmann::json();
  j["notificationUri"] = o.m_NotificationUri;
  if (o.notifIdIsSet())
    j["notifId"] = o.m_NotifId;
  j["monitoredResourceUris"] = o.m_MonitoredResourceUris;
  if (o.monResItemsIsSet() || !o.m_MonResItems.empty())
    j["monResItems"] = o.m_MonResItems;
  if (o.expiryIsSet())
    j["expiry"] = o.m_Expiry;
  if (o.supportedFeaturesIsSet())
    j["supportedFeatures"] = o.m_SupportedFeatures;
}

void from_json(const nlohmann::json &j, PolicyDataSubscription &o) {
  j.at("notificationUri").get_to(o.m_NotificationUri);
  if (j.find("notifId") != j.end()) {
    j.at("notifId").get_to(o.m_NotifId);
    o.m_NotifIdIsSet = true;
  }
  j.at("monitoredResourceUris").get_to(o.m_MonitoredResourceUris);
  if (j.find("monResItems") != j.end()) {
    j.at("monResItems").get_to(o.m_MonResItems);
    o.m_MonResItemsIsSet = true;
  }
  if (j.find("expiry") != j.end()) {
    j.at("expiry").get_to(o.m_Expiry);
    o.m_ExpiryIsSet = true;
  }
  if (j.find("supportedFeatures") != j.end()) {
    j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
    o.m_SupportedFeaturesIsSet = true;
  }
}

std::string PolicyDataSubscription::getNotificationUri() const {
  return m_NotificationUri;
}
void PolicyDataSubscription::setNotificationUri(std::string const &value) {
  m_NotificationUri = value;
}
std::string PolicyDataSubscription::getNotifId() const { return m_NotifId; }
void PolicyDataSubscription::setNotifId(std::string const &value) {
  m_NotifId = value;
  m_NotifIdIsSet = true;
}
bool PolicyDataSubscription::notifIdIsSet() const { return m_NotifIdIsSet; }
void PolicyDataSubscription::unsetNotifId() { m_NotifIdIsSet = false; }
std::vector<std::string> &PolicyDataSubscription::getMonitoredResourceUris() {
  return m_MonitoredResourceUris;
}
void PolicyDataSubscription::setMonitoredResourceUris(
    std::vector<std::string> const &value) {
  m_MonitoredResourceUris = value;
}
std::vector<ResourceItem> &PolicyDataSubscription::getMonResItems() {
  return m_MonResItems;
}
void PolicyDataSubscription::setMonResItems(
    std::vector<ResourceItem> const &value) {
  m_MonResItems = value;
  m_MonResItemsIsSet = true;
}
bool PolicyDataSubscription::monResItemsIsSet() const {
  return m_MonResItemsIsSet;
}
void PolicyDataSubscription::unsetMonResItems() { m_MonResItemsIsSet = false; }
std::string PolicyDataSubscription::getExpiry() const { return m_Expiry; }
void PolicyDataSubscription::setExpiry(std::string const &value) {
  m_Expiry = value;
  m_ExpiryIsSet = true;
}
bool PolicyDataSubscription::expiryIsSet() const { return m_ExpiryIsSet; }
void PolicyDataSubscription::unsetExpiry() { m_ExpiryIsSet = false; }
std::string PolicyDataSubscription::getSupportedFeatures() const {
  return m_SupportedFeatures;
}
void PolicyDataSubscription::setSupportedFeatures(std::string const &value) {
  m_SupportedFeatures = value;
  m_SupportedFeaturesIsSet = true;
}
bool PolicyDataSubscription::supportedFeaturesIsSet() const {
  return m_SupportedFeaturesIsSet;
}
void PolicyDataSubscription::unsetSupportedFeatures() {
  m_SupportedFeaturesIsSet = false;
}

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