Hhuaweicloud
656b86e7创建于 2023年7月6日历史提交


#include "huaweicloud/eip/v2/model/MatchReq.h"

namespace HuaweiCloud {
namespace Sdk {
namespace Eip {
namespace V2 {
namespace Model {




MatchReq::MatchReq()
{
    key_ = "";
    keyIsSet_ = false;
    value_ = "";
    valueIsSet_ = false;
}

MatchReq::~MatchReq() = default;

void MatchReq::validate()
{
}

web::json::value MatchReq::toJson() const
{
    web::json::value val = web::json::value::object();

    if(keyIsSet_) {
        val[utility::conversions::to_string_t("key")] = ModelBase::toJson(key_);
    }
    if(valueIsSet_) {
        val[utility::conversions::to_string_t("value")] = ModelBase::toJson(value_);
    }

    return val;
}

bool MatchReq::fromJson(const web::json::value& val)
{
    bool ok = true;
    
    if(val.has_field(utility::conversions::to_string_t("key"))) {
        const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("key"));
        if(!fieldValue.is_null())
        {
            std::string refVal;
            ok &= ModelBase::fromJson(fieldValue, refVal);
            setKey(refVal);
        }
    }
    if(val.has_field(utility::conversions::to_string_t("value"))) {
        const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("value"));
        if(!fieldValue.is_null())
        {
            std::string refVal;
            ok &= ModelBase::fromJson(fieldValue, refVal);
            setValue(refVal);
        }
    }
    return ok;
}

std::string MatchReq::getKey() const
{
    return key_;
}

void MatchReq::setKey(const std::string& value)
{
    key_ = value;
    keyIsSet_ = true;
}

bool MatchReq::keyIsSet() const
{
    return keyIsSet_;
}

void MatchReq::unsetkey()
{
    keyIsSet_ = false;
}

std::string MatchReq::getValue() const
{
    return value_;
}

void MatchReq::setValue(const std::string& value)
{
    value_ = value;
    valueIsSet_ = true;
}

bool MatchReq::valueIsSet() const
{
    return valueIsSet_;
}

void MatchReq::unsetvalue()
{
    valueIsSet_ = false;
}

}
}
}
}
}