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

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

DddTrafficDescriptor::DddTrafficDescriptor() {
  m_Ipv4Addr = "";
  m_Ipv4AddrIsSet = false;
  m_Ipv6AddrIsSet = false;
  m_PortNumber = 0;
  m_PortNumberIsSet = false;
  m_MacAddr = "";
  m_MacAddrIsSet = false;
}

DddTrafficDescriptor::~DddTrafficDescriptor() {}

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

void to_json(nlohmann::json &j, const DddTrafficDescriptor &o) {
  j = nlohmann::json();
  if (o.ipv4AddrIsSet())
    j["ipv4Addr"] = o.m_Ipv4Addr;
  if (o.ipv6AddrIsSet())
    j["ipv6Addr"] = o.m_Ipv6Addr;
  if (o.portNumberIsSet())
    j["portNumber"] = o.m_PortNumber;
  if (o.macAddrIsSet())
    j["macAddr"] = o.m_MacAddr;
}

void from_json(const nlohmann::json &j, DddTrafficDescriptor &o) {
  if (j.find("ipv4Addr") != j.end()) {
    j.at("ipv4Addr").get_to(o.m_Ipv4Addr);
    o.m_Ipv4AddrIsSet = true;
  }
  if (j.find("ipv6Addr") != j.end()) {
    j.at("ipv6Addr").get_to(o.m_Ipv6Addr);
    o.m_Ipv6AddrIsSet = true;
  }
  if (j.find("portNumber") != j.end()) {
    j.at("portNumber").get_to(o.m_PortNumber);
    o.m_PortNumberIsSet = true;
  }
  if (j.find("macAddr") != j.end()) {
    j.at("macAddr").get_to(o.m_MacAddr);
    o.m_MacAddrIsSet = true;
  }
}

std::string DddTrafficDescriptor::getIpv4Addr() const { return m_Ipv4Addr; }
void DddTrafficDescriptor::setIpv4Addr(std::string const &value) {
  m_Ipv4Addr = value;
  m_Ipv4AddrIsSet = true;
}
bool DddTrafficDescriptor::ipv4AddrIsSet() const { return m_Ipv4AddrIsSet; }
void DddTrafficDescriptor::unsetIpv4Addr() { m_Ipv4AddrIsSet = false; }
Ipv6Addr DddTrafficDescriptor::getIpv6Addr() const { return m_Ipv6Addr; }
void DddTrafficDescriptor::setIpv6Addr(Ipv6Addr const &value) {
  m_Ipv6Addr = value;
  m_Ipv6AddrIsSet = true;
}
bool DddTrafficDescriptor::ipv6AddrIsSet() const { return m_Ipv6AddrIsSet; }
void DddTrafficDescriptor::unsetIpv6Addr() { m_Ipv6AddrIsSet = false; }
int32_t DddTrafficDescriptor::getPortNumber() const { return m_PortNumber; }
void DddTrafficDescriptor::setPortNumber(int32_t const value) {
  m_PortNumber = value;
  m_PortNumberIsSet = true;
}
bool DddTrafficDescriptor::portNumberIsSet() const { return m_PortNumberIsSet; }
void DddTrafficDescriptor::unsetPortNumber() { m_PortNumberIsSet = false; }
std::string DddTrafficDescriptor::getMacAddr() const { return m_MacAddr; }
void DddTrafficDescriptor::setMacAddr(std::string const &value) {
  m_MacAddr = value;
  m_MacAddrIsSet = true;
}
bool DddTrafficDescriptor::macAddrIsSet() const { return m_MacAddrIsSet; }
void DddTrafficDescriptor::unsetMacAddr() { m_MacAddrIsSet = false; }

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