text: /**
   * Swaggy Jenkins
   * Jenkins API clients generated from Swagger / Open API specification
   *
   * The version of the OpenAPI document: 1.1.2-pre.0
   * Contact: blah@cliffano.com
   *
   * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0.
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  
  
  #include "GenericResource.h"
  
  namespace org {
  namespace openapitools {
  namespace client {
  namespace model {
  
  
  
  
  GenericResource::GenericResource()
  {
      m__class = utility::conversions::to_string_t("");
      m__classIsSet = false;
      m_DisplayName = utility::conversions::to_string_t("");
      m_DisplayNameIsSet = false;
      m_DurationInMillis = 0;
      m_DurationInMillisIsSet = false;
      m_Id = utility::conversions::to_string_t("");
      m_IdIsSet = false;
      m_Result = utility::conversions::to_string_t("");
      m_ResultIsSet = false;
      m_StartTime = utility::conversions::to_string_t("");
      m_StartTimeIsSet = false;
  }
  
  GenericResource::~GenericResource()
  {
  }
  
  void GenericResource::validate()
  {
      // TODO: implement validation
  }
  
  web::json::value GenericResource::toJson() const
  {
  
      web::json::value val = web::json::value::object();
      
      if(m__classIsSet)
      {
          val[utility::conversions::to_string_t(U("_class"))] = ModelBase::toJson(m__class);
      }
      if(m_DisplayNameIsSet)
      {
          val[utility::conversions::to_string_t(U("displayName"))] = ModelBase::toJson(m_DisplayName);
      }
      if(m_DurationInMillisIsSet)
      {
          val[utility::conversions::to_string_t(U("durationInMillis"))] = ModelBase::toJson(m_DurationInMillis);
      }
      if(m_IdIsSet)
      {
          val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
      }
      if(m_ResultIsSet)
      {
          val[utility::conversions::to_string_t(U("result"))] = ModelBase::toJson(m_Result);
      }
      if(m_StartTimeIsSet)
      {
          val[utility::conversions::to_string_t(U("startTime"))] = ModelBase::toJson(m_StartTime);
      }
  
      return val;
  }
  
  bool GenericResource::fromJson(const web::json::value& val)
  {
      bool ok = true;
      
      if(val.has_field(utility::conversions::to_string_t(U("_class"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("_class")));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal__class;
              ok &= ModelBase::fromJson(fieldValue, refVal__class);
              setClass(refVal__class);
          }
      }
      if(val.has_field(utility::conversions::to_string_t(U("displayName"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("displayName")));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_displayName;
              ok &= ModelBase::fromJson(fieldValue, refVal_displayName);
              setDisplayName(refVal_displayName);
          }
      }
      if(val.has_field(utility::conversions::to_string_t(U("durationInMillis"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("durationInMillis")));
          if(!fieldValue.is_null())
          {
              int32_t refVal_durationInMillis;
              ok &= ModelBase::fromJson(fieldValue, refVal_durationInMillis);
              setDurationInMillis(refVal_durationInMillis);
          }
      }
      if(val.has_field(utility::conversions::to_string_t(U("id"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_id;
              ok &= ModelBase::fromJson(fieldValue, refVal_id);
              setId(refVal_id);
          }
      }
      if(val.has_field(utility::conversions::to_string_t(U("result"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("result")));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_result;
              ok &= ModelBase::fromJson(fieldValue, refVal_result);
              setResult(refVal_result);
          }
      }
      if(val.has_field(utility::conversions::to_string_t(U("startTime"))))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("startTime")));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_startTime;
              ok &= ModelBase::fromJson(fieldValue, refVal_startTime);
              setStartTime(refVal_startTime);
          }
      }
      return ok;
  }
  
  void GenericResource::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(U(".")))
      {
          namePrefix += utility::conversions::to_string_t(U("."));
      }
      if(m__classIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("_class")), m__class));
      }
      if(m_DisplayNameIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("displayName")), m_DisplayName));
      }
      if(m_DurationInMillisIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("durationInMillis")), m_DurationInMillis));
      }
      if(m_IdIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
      }
      if(m_ResultIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("result")), m_Result));
      }
      if(m_StartTimeIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("startTime")), m_StartTime));
      }
  }
  
  bool GenericResource::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(U(".")))
      {
          namePrefix += utility::conversions::to_string_t(U("."));
      }
  
      if(multipart->hasContent(utility::conversions::to_string_t(U("_class"))))
      {
          utility::string_t refVal__class;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("_class"))), refVal__class );
          setClass(refVal__class);
      }
      if(multipart->hasContent(utility::conversions::to_string_t(U("displayName"))))
      {
          utility::string_t refVal_displayName;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("displayName"))), refVal_displayName );
          setDisplayName(refVal_displayName);
      }
      if(multipart->hasContent(utility::conversions::to_string_t(U("durationInMillis"))))
      {
          int32_t refVal_durationInMillis;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("durationInMillis"))), refVal_durationInMillis );
          setDurationInMillis(refVal_durationInMillis);
      }
      if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
      {
          utility::string_t refVal_id;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id );
          setId(refVal_id);
      }
      if(multipart->hasContent(utility::conversions::to_string_t(U("result"))))
      {
          utility::string_t refVal_result;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("result"))), refVal_result );
          setResult(refVal_result);
      }
      if(multipart->hasContent(utility::conversions::to_string_t(U("startTime"))))
      {
          utility::string_t refVal_startTime;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("startTime"))), refVal_startTime );
          setStartTime(refVal_startTime);
      }
      return ok;
  }
  
  utility::string_t GenericResource::getClass() const
  {
      return m__class;
  }
  
  void GenericResource::setClass(const utility::string_t& value)
  {
      m__class = value;
      m__classIsSet = true;
  }
  
  bool GenericResource::r_classIsSet() const
  {
      return m__classIsSet;
  }
  
  void GenericResource::unset_class()
  {
      m__classIsSet = false;
  }
  utility::string_t GenericResource::getDisplayName() const
  {
      return m_DisplayName;
  }
  
  void GenericResource::setDisplayName(const utility::string_t& value)
  {
      m_DisplayName = value;
      m_DisplayNameIsSet = true;
  }
  
  bool GenericResource::displayNameIsSet() const
  {
      return m_DisplayNameIsSet;
  }
  
  void GenericResource::unsetDisplayName()
  {
      m_DisplayNameIsSet = false;
  }
  int32_t GenericResource::getDurationInMillis() const
  {
      return m_DurationInMillis;
  }
  
  void GenericResource::setDurationInMillis(int32_t value)
  {
      m_DurationInMillis = value;
      m_DurationInMillisIsSet = true;
  }
  
  bool GenericResource::durationInMillisIsSet() const
  {
      return m_DurationInMillisIsSet;
  }
  
  void GenericResource::unsetDurationInMillis()
  {
      m_DurationInMillisIsSet = false;
  }
  utility::string_t GenericResource::getId() const
  {
      return m_Id;
  }
  
  void GenericResource::setId(const utility::string_t& value)
  {
      m_Id = value;
      m_IdIsSet = true;
  }
  
  bool GenericResource::idIsSet() const
  {
      return m_IdIsSet;
  }
  
  void GenericResource::unsetId()
  {
      m_IdIsSet = false;
  }
  utility::string_t GenericResource::getResult() const
  {
      return m_Result;
  }
  
  void GenericResource::setResult(const utility::string_t& value)
  {
      m_Result = value;
      m_ResultIsSet = true;
  }
  
  bool GenericResource::resultIsSet() const
  {
      return m_ResultIsSet;
  }
  
  void GenericResource::unsetResult()
  {
      m_ResultIsSet = false;
  }
  utility::string_t GenericResource::getStartTime() const
  {
      return m_StartTime;
  }
  
  void GenericResource::setStartTime(const utility::string_t& value)
  {
      m_StartTime = value;
      m_StartTimeIsSet = true;
  }
  
  bool GenericResource::startTimeIsSet() const
  {
      return m_StartTimeIsSet;
  }
  
  void GenericResource::unsetStartTime()
  {
      m_StartTimeIsSet = false;
  }
  }
  }
  }
  }
  
  
  