/**
 * Nsmf_PDUSession
 * SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
 * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 1.1.0.alpha-1
 *
 * NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#include "EpsBearerInfo.h"

namespace oai {
namespace smf {
namespace model {

EpsBearerInfo::EpsBearerInfo() {
  m_Ebi = 0;
}

EpsBearerInfo::~EpsBearerInfo() {}

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

web::json::value EpsBearerInfo::toJson() const {
  web::json::value val = web::json::value::object();

  val[utility::conversions::to_string_t("ebi")] = ModelBase::toJson(m_Ebi);
  val[utility::conversions::to_string_t("pgwS8uFteid")] =
      ModelBase::toJson(m_PgwS8uFteid);
  val[utility::conversions::to_string_t("bearerLevelQoS")] =
      ModelBase::toJson(m_BearerLevelQoS);

  return val;
}

void EpsBearerInfo::fromJson(const web::json::value& val) {
  setEbi(ModelBase::int32_tFromJson(
      val.at(utility::conversions::to_string_t("ebi"))));
  setPgwS8uFteid(ModelBase::stringFromJson(
      val.at(utility::conversions::to_string_t("pgwS8uFteid"))));
  setBearerLevelQoS(ModelBase::stringFromJson(
      val.at(utility::conversions::to_string_t("bearerLevelQoS"))));
}

void EpsBearerInfo::toMultipart(
    std::shared_ptr<MultipartFormData> multipart,
    const utility::string_t& prefix) const {
  utility::string_t namePrefix = prefix;
  if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
                                   utility::conversions::to_string_t(".")) {
    namePrefix += utility::conversions::to_string_t(".");
  }

  multipart->add(ModelBase::toHttpContent(
      namePrefix + utility::conversions::to_string_t("ebi"), m_Ebi));
  multipart->add(ModelBase::toHttpContent(
      namePrefix + utility::conversions::to_string_t("pgwS8uFteid"),
      m_PgwS8uFteid));
  multipart->add(ModelBase::toHttpContent(
      namePrefix + utility::conversions::to_string_t("bearerLevelQoS"),
      m_BearerLevelQoS));
}

void EpsBearerInfo::fromMultiPart(
    std::shared_ptr<MultipartFormData> multipart,
    const utility::string_t& prefix) {
  utility::string_t namePrefix = prefix;
  if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
                                   utility::conversions::to_string_t(".")) {
    namePrefix += utility::conversions::to_string_t(".");
  }

  setEbi(ModelBase::int32_tFromHttpContent(
      multipart->getContent(utility::conversions::to_string_t("ebi"))));
  setPgwS8uFteid(ModelBase::stringFromHttpContent(
      multipart->getContent(utility::conversions::to_string_t("pgwS8uFteid"))));
  setBearerLevelQoS(ModelBase::stringFromHttpContent(multipart->getContent(
      utility::conversions::to_string_t("bearerLevelQoS"))));
}

int32_t EpsBearerInfo::getEbi() const {
  return m_Ebi;
}

void EpsBearerInfo::setEbi(int32_t value) {
  m_Ebi = value;
}

utility::string_t EpsBearerInfo::getPgwS8uFteid() const {
  return m_PgwS8uFteid;
}

void EpsBearerInfo::setPgwS8uFteid(const utility::string_t& value) {
  m_PgwS8uFteid = value;
}

utility::string_t EpsBearerInfo::getBearerLevelQoS() const {
  return m_BearerLevelQoS;
}

void EpsBearerInfo::setBearerLevelQoS(const utility::string_t& value) {
  m_BearerLevelQoS = value;
}

}  // namespace model
}  // namespace smf
}  // namespace oai
