#include "huaweicloud/cdn/v1/model/ShowOriginHostRequest.h"
namespace HuaweiCloud {
namespace Sdk {
namespace Cdn {
namespace V1 {
namespace Model {
ShowOriginHostRequest::ShowOriginHostRequest()
{
domainId_ = "";
domainIdIsSet_ = false;
enterpriseProjectId_ = "";
enterpriseProjectIdIsSet_ = false;
}
ShowOriginHostRequest::~ShowOriginHostRequest() = default;
void ShowOriginHostRequest::validate()
{
}
web::json::value ShowOriginHostRequest::toJson() const
{
web::json::value val = web::json::value::object();
if(domainIdIsSet_) {
val[utility::conversions::to_string_t("domain_id")] = ModelBase::toJson(domainId_);
}
if(enterpriseProjectIdIsSet_) {
val[utility::conversions::to_string_t("enterprise_project_id")] = ModelBase::toJson(enterpriseProjectId_);
}
return val;
}
bool ShowOriginHostRequest::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t("domain_id"))) {
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("domain_id"));
if(!fieldValue.is_null())
{
std::string refVal;
ok &= ModelBase::fromJson(fieldValue, refVal);
setDomainId(refVal);
}
}
if(val.has_field(utility::conversions::to_string_t("enterprise_project_id"))) {
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("enterprise_project_id"));
if(!fieldValue.is_null())
{
std::string refVal;
ok &= ModelBase::fromJson(fieldValue, refVal);
setEnterpriseProjectId(refVal);
}
}
return ok;
}
std::string ShowOriginHostRequest::getDomainId() const
{
return domainId_;
}
void ShowOriginHostRequest::setDomainId(const std::string& value)
{
domainId_ = value;
domainIdIsSet_ = true;
}
bool ShowOriginHostRequest::domainIdIsSet() const
{
return domainIdIsSet_;
}
void ShowOriginHostRequest::unsetdomainId()
{
domainIdIsSet_ = false;
}
std::string ShowOriginHostRequest::getEnterpriseProjectId() const
{
return enterpriseProjectId_;
}
void ShowOriginHostRequest::setEnterpriseProjectId(const std::string& value)
{
enterpriseProjectId_ = value;
enterpriseProjectIdIsSet_ = true;
}
bool ShowOriginHostRequest::enterpriseProjectIdIsSet() const
{
return enterpriseProjectIdIsSet_;
}
void ShowOriginHostRequest::unsetenterpriseProjectId()
{
enterpriseProjectIdIsSet_ = false;
}
}
}
}
}
}