text: /**
   * PowerMeter API
   * API
   *
   * The version of the OpenAPI document: 2021.4.1
   *
   * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1.
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  
  
  #include "ComputePower.h"
  
  namespace powermeter {
  namespace model {
  
  
  
  
  ComputePower::ComputePower()
  {
      m_Undefined = utility::conversions::to_string_t("");
      m_UndefinedIsSet = false;
  }
  
  ComputePower::~ComputePower()
  {
  }
  
  void ComputePower::validate()
  {
      // TODO: implement validation
  }
  
  web::json::value ComputePower::toJson() const
  {
  
      web::json::value val = web::json::value::object();
      
      if(m_UndefinedIsSet)
      {
          val[utility::conversions::to_string_t("undefined")] = ModelBase::toJson(m_Undefined);
      }
  
      return val;
  }
  
  bool ComputePower::fromJson(const web::json::value& val)
  {
      bool ok = true;
      
      if(val.has_field(utility::conversions::to_string_t("undefined")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("undefined"));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_undefined;
              ok &= ModelBase::fromJson(fieldValue, refVal_undefined);
              setUndefined(refVal_undefined);
          }
      }
      return ok;
  }
  
  void ComputePower::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(".");
      }
      if(m_UndefinedIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("undefined"), m_Undefined));
      }
  }
  
  bool ComputePower::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
  {
      bool ok = true;
      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(".");
      }
  
      if(multipart->hasContent(utility::conversions::to_string_t("undefined")))
      {
          utility::string_t refVal_undefined;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("undefined")), refVal_undefined );
          setUndefined(refVal_undefined);
      }
      return ok;
  }
  
  utility::string_t ComputePower::getUndefined() const
  {
      return m_Undefined;
  }
  
  void ComputePower::setUndefined(const utility::string_t& value)
  {
      m_Undefined = value;
      m_UndefinedIsSet = true;
  }
  
  bool ComputePower::undefinedIsSet() const
  {
      return m_UndefinedIsSet;
  }
  
  void ComputePower::unsetUndefined()
  {
      m_UndefinedIsSet = false;
  }
  }
  }
  
  
  