#include "huaweicloud/cdn/v1/model/ShowCacheRulesRequest.h"
namespace HuaweiCloud {
namespace Sdk {
namespace Cdn {
namespace V1 {
namespace Model {
ShowCacheRulesRequest::ShowCacheRulesRequest()
{
domainId_ = "";
domainIdIsSet_ = false;
enterpriseProjectId_ = "";
enterpriseProjectIdIsSet_ = false;
}
ShowCacheRulesRequest::~ShowCacheRulesRequest() = default;
void ShowCacheRulesRequest::validate()
{
}
web::json::value ShowCacheRulesRequest::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 ShowCacheRulesRequest::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 ShowCacheRulesRequest::getDomainId() const
{
return domainId_;
}
void ShowCacheRulesRequest::setDomainId(const std::string& value)
{
domainId_ = value;
domainIdIsSet_ = true;
}
bool ShowCacheRulesRequest::domainIdIsSet() const
{
return domainIdIsSet_;
}
void ShowCacheRulesRequest::unsetdomainId()
{
domainIdIsSet_ = false;
}
std::string ShowCacheRulesRequest::getEnterpriseProjectId() const
{
return enterpriseProjectId_;
}
void ShowCacheRulesRequest::setEnterpriseProjectId(const std::string& value)
{
enterpriseProjectId_ = value;
enterpriseProjectIdIsSet_ = true;
}
bool ShowCacheRulesRequest::enterpriseProjectIdIsSet() const
{
return enterpriseProjectIdIsSet_;
}
void ShowCacheRulesRequest::unsetenterpriseProjectId()
{
enterpriseProjectIdIsSet_ = false;
}
}
}
}
}
}