text: /**
   * FastReport Cloud
   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   *
   * The version of the OpenAPI document: v1
   *
   * NOTE: This class is auto generated by OpenAPI-Generator 5.1.1.
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  
  
  #include "RunTransportTaskBaseVM.h"
  
  namespace fastreport {
  namespace cloud {
  namespace models {
  
  
  
  
  RunTransportTaskBaseVM::RunTransportTaskBaseVM()
  {
      m_filesIsSet = false;
      m_subscriptionId = utility::conversions::to_string_t("");
      m_subscriptionIdIsSet = false;
      m_typeIsSet = false;
  }
  
  RunTransportTaskBaseVM::~RunTransportTaskBaseVM()
  {
  }
  
  void RunTransportTaskBaseVM::validate()
  {
      // TODO: implement validation
  }
  
  web::json::value RunTransportTaskBaseVM::toJson() const
  {
  
      web::json::value val = web::json::value::object();
      
      if(m_filesIsSet)
      {
          val[utility::conversions::to_string_t("files")] = ModelBase::toJson(m_files);
      }
      if(m_subscriptionIdIsSet)
      {
          val[utility::conversions::to_string_t("subscriptionId")] = ModelBase::toJson(m_subscriptionId);
      }
      if(m_typeIsSet)
      {
          val[utility::conversions::to_string_t("type")] = ModelBase::toJson(m_type);
      }
  
      return val;
  }
  
  bool RunTransportTaskBaseVM::fromJson(const web::json::value& val)
  {
      bool ok = true;
      
      if(val.has_field(utility::conversions::to_string_t("files")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("files"));
          if(!fieldValue.is_null())
          {
              std::vector<std::shared_ptr<RunInputFileVM>> refVal_files;
              ok &= ModelBase::fromJson(fieldValue, refVal_files);
              setFiles(refVal_files);
          }
      }
      if(val.has_field(utility::conversions::to_string_t("subscriptionId")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("subscriptionId"));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_subscriptionId;
              ok &= ModelBase::fromJson(fieldValue, refVal_subscriptionId);
              setSubscriptionId(refVal_subscriptionId);
          }
      }
      if(val.has_field(utility::conversions::to_string_t("type")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("type"));
          if(!fieldValue.is_null())
          {
              std::shared_ptr<TaskType> refVal_type;
              ok &= ModelBase::fromJson(fieldValue, refVal_type);
              setType(refVal_type);
          }
      }
      return ok;
  }
  
  void RunTransportTaskBaseVM::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_filesIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("files"), m_files));
      }
      if(m_subscriptionIdIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("subscriptionId"), m_subscriptionId));
      }
      if(m_typeIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("type"), m_type));
      }
  }
  
  bool RunTransportTaskBaseVM::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("files")))
      {
          std::vector<std::shared_ptr<RunInputFileVM>> refVal_files;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("files")), refVal_files );
          setFiles(refVal_files);
      }
      if(multipart->hasContent(utility::conversions::to_string_t("subscriptionId")))
      {
          utility::string_t refVal_subscriptionId;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("subscriptionId")), refVal_subscriptionId );
          setSubscriptionId(refVal_subscriptionId);
      }
      if(multipart->hasContent(utility::conversions::to_string_t("type")))
      {
          std::shared_ptr<TaskType> refVal_type;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("type")), refVal_type );
          setType(refVal_type);
      }
      return ok;
  }
  
  std::vector<std::shared_ptr<RunInputFileVM>>& RunTransportTaskBaseVM::getFiles()
  {
      return m_files;
  }
  
  void RunTransportTaskBaseVM::setFiles(const std::vector<std::shared_ptr<RunInputFileVM>>& value)
  {
      m_files = value;
      m_filesIsSet = true;
  }
  
  bool RunTransportTaskBaseVM::filesIsSet() const
  {
      return m_filesIsSet;
  }
  
  void RunTransportTaskBaseVM::unsetfiles()
  {
      m_filesIsSet = false;
  }
  utility::string_t RunTransportTaskBaseVM::getSubscriptionId() const
  {
      return m_subscriptionId;
  }
  
  void RunTransportTaskBaseVM::setSubscriptionId(const utility::string_t& value)
  {
      m_subscriptionId = value;
      m_subscriptionIdIsSet = true;
  }
  
  bool RunTransportTaskBaseVM::subscriptionIdIsSet() const
  {
      return m_subscriptionIdIsSet;
  }
  
  void RunTransportTaskBaseVM::unsetsubscriptionId()
  {
      m_subscriptionIdIsSet = false;
  }
  std::shared_ptr<TaskType> RunTransportTaskBaseVM::getType() const
  {
      return m_type;
  }
  
  void RunTransportTaskBaseVM::setType(const std::shared_ptr<TaskType>& value)
  {
      m_type = value;
      m_typeIsSet = true;
  }
  
  bool RunTransportTaskBaseVM::typeIsSet() const
  {
      return m_typeIsSet;
  }
  
  void RunTransportTaskBaseVM::unsettype()
  {
      m_typeIsSet = false;
  }
  }
  }
  }
  
  
  