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 "WebhookTaskVM.h"
  
  namespace fastreport {
  namespace cloud {
  namespace models {
  
  
  
  
  WebhookTaskVM::WebhookTaskVM()
  {
      m_endpointsIsSet = false;
      m_name = utility::conversions::to_string_t("");
      m_nameIsSet = false;
      m_subscriptionId = utility::conversions::to_string_t("");
      m_subscriptionIdIsSet = false;
      m_typeIsSet = false;
  }
  
  WebhookTaskVM::~WebhookTaskVM()
  {
  }
  
  void WebhookTaskVM::validate()
  {
      // TODO: implement validation
  }
  
  web::json::value WebhookTaskVM::toJson() const
  {
  
      web::json::value val = web::json::value::object();
      
      if(m_endpointsIsSet)
      {
          val[utility::conversions::to_string_t("endpoints")] = ModelBase::toJson(m_endpoints);
      }
      if(m_nameIsSet)
      {
          val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_name);
      }
      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 WebhookTaskVM::fromJson(const web::json::value& val)
  {
      bool ok = true;
      
      if(val.has_field(utility::conversions::to_string_t("endpoints")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("endpoints"));
          if(!fieldValue.is_null())
          {
              std::vector<std::shared_ptr<EndpointVM>> refVal_endpoints;
              ok &= ModelBase::fromJson(fieldValue, refVal_endpoints);
              setEndpoints(refVal_endpoints);
          }
      }
      if(val.has_field(utility::conversions::to_string_t("name")))
      {
          const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("name"));
          if(!fieldValue.is_null())
          {
              utility::string_t refVal_name;
              ok &= ModelBase::fromJson(fieldValue, refVal_name);
              setName(refVal_name);
          }
      }
      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 WebhookTaskVM::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_endpointsIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("endpoints"), m_endpoints));
      }
      if(m_nameIsSet)
      {
          multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_name));
      }
      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 WebhookTaskVM::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("endpoints")))
      {
          std::vector<std::shared_ptr<EndpointVM>> refVal_endpoints;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("endpoints")), refVal_endpoints );
          setEndpoints(refVal_endpoints);
      }
      if(multipart->hasContent(utility::conversions::to_string_t("name")))
      {
          utility::string_t refVal_name;
          ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t("name")), refVal_name );
          setName(refVal_name);
      }
      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<EndpointVM>>& WebhookTaskVM::getEndpoints()
  {
      return m_endpoints;
  }
  
  void WebhookTaskVM::setEndpoints(const std::vector<std::shared_ptr<EndpointVM>>& value)
  {
      m_endpoints = value;
      m_endpointsIsSet = true;
  }
  
  bool WebhookTaskVM::endpointsIsSet() const
  {
      return m_endpointsIsSet;
  }
  
  void WebhookTaskVM::unsetendpoints()
  {
      m_endpointsIsSet = false;
  }
  utility::string_t WebhookTaskVM::getName() const
  {
      return m_name;
  }
  
  void WebhookTaskVM::setName(const utility::string_t& value)
  {
      m_name = value;
      m_nameIsSet = true;
  }
  
  bool WebhookTaskVM::nameIsSet() const
  {
      return m_nameIsSet;
  }
  
  void WebhookTaskVM::unsetname()
  {
      m_nameIsSet = false;
  }
  utility::string_t WebhookTaskVM::getSubscriptionId() const
  {
      return m_subscriptionId;
  }
  
  void WebhookTaskVM::setSubscriptionId(const utility::string_t& value)
  {
      m_subscriptionId = value;
      m_subscriptionIdIsSet = true;
  }
  
  bool WebhookTaskVM::subscriptionIdIsSet() const
  {
      return m_subscriptionIdIsSet;
  }
  
  void WebhookTaskVM::unsetsubscriptionId()
  {
      m_subscriptionIdIsSet = false;
  }
  std::shared_ptr<TaskType> WebhookTaskVM::getType() const
  {
      return m_type;
  }
  
  void WebhookTaskVM::setType(const std::shared_ptr<TaskType>& value)
  {
      m_type = value;
      m_typeIsSet = true;
  }
  
  bool WebhookTaskVM::typeIsSet() const
  {
      return m_typeIsSet;
  }
  
  void WebhookTaskVM::unsettype()
  {
      m_typeIsSet = false;
  }
  }
  }
  }
  
  
  