#include "huaweicloud/cfw/v1/model/ListDnsServersRequest.h"
namespace HuaweiCloud {
namespace Sdk {
namespace Cfw {
namespace V1 {
namespace Model {
ListDnsServersRequest::ListDnsServersRequest()
{
limit_ = 0;
limitIsSet_ = false;
offset_ = 0;
offsetIsSet_ = false;
fwInstanceId_ = "";
fwInstanceIdIsSet_ = false;
enterpriseProjectId_ = "";
enterpriseProjectIdIsSet_ = false;
}
ListDnsServersRequest::~ListDnsServersRequest() = default;
void ListDnsServersRequest::validate()
{
}
web::json::value ListDnsServersRequest::toJson() const
{
web::json::value val = web::json::value::object();
if(limitIsSet_) {
val[utility::conversions::to_string_t("limit")] = ModelBase::toJson(limit_);
}
if(offsetIsSet_) {
val[utility::conversions::to_string_t("offset")] = ModelBase::toJson(offset_);
}
if(fwInstanceIdIsSet_) {
val[utility::conversions::to_string_t("fw_instance_id")] = ModelBase::toJson(fwInstanceId_);
}
if(enterpriseProjectIdIsSet_) {
val[utility::conversions::to_string_t("enterprise_project_id")] = ModelBase::toJson(enterpriseProjectId_);
}
return val;
}
bool ListDnsServersRequest::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t("limit"))) {
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("limit"));
if(!fieldValue.is_null())
{
int32_t refVal;
ok &= ModelBase::fromJson(fieldValue, refVal);
setLimit(refVal);
}
}
if(val.has_field(utility::conversions::to_string_t("offset"))) {
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("offset"));
if(!fieldValue.is_null())
{
int32_t refVal;
ok &= ModelBase::fromJson(fieldValue, refVal);
setOffset(refVal);
}
}
if(val.has_field(utility::conversions::to_string_t("fw_instance_id"))) {
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("fw_instance_id"));
if(!fieldValue.is_null())
{
std::string refVal;
ok &= ModelBase::fromJson(fieldValue, refVal);
setFwInstanceId(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;
}
int32_t ListDnsServersRequest::getLimit() const
{
return limit_;
}
void ListDnsServersRequest::setLimit(int32_t value)
{
limit_ = value;
limitIsSet_ = true;
}
bool ListDnsServersRequest::limitIsSet() const
{
return limitIsSet_;
}
void ListDnsServersRequest::unsetlimit()
{
limitIsSet_ = false;
}
int32_t ListDnsServersRequest::getOffset() const
{
return offset_;
}
void ListDnsServersRequest::setOffset(int32_t value)
{
offset_ = value;
offsetIsSet_ = true;
}
bool ListDnsServersRequest::offsetIsSet() const
{
return offsetIsSet_;
}
void ListDnsServersRequest::unsetoffset()
{
offsetIsSet_ = false;
}
std::string ListDnsServersRequest::getFwInstanceId() const
{
return fwInstanceId_;
}
void ListDnsServersRequest::setFwInstanceId(const std::string& value)
{
fwInstanceId_ = value;
fwInstanceIdIsSet_ = true;
}
bool ListDnsServersRequest::fwInstanceIdIsSet() const
{
return fwInstanceIdIsSet_;
}
void ListDnsServersRequest::unsetfwInstanceId()
{
fwInstanceIdIsSet_ = false;
}
std::string ListDnsServersRequest::getEnterpriseProjectId() const
{
return enterpriseProjectId_;
}
void ListDnsServersRequest::setEnterpriseProjectId(const std::string& value)
{
enterpriseProjectId_ = value;
enterpriseProjectIdIsSet_ = true;
}
bool ListDnsServersRequest::enterpriseProjectIdIsSet() const
{
return enterpriseProjectIdIsSet_;
}
void ListDnsServersRequest::unsetenterpriseProjectId()
{
enterpriseProjectIdIsSet_ = false;
}
}
}
}
}
}