@@ -51,42 +51,6 @@ UbsmsClient::UbsmsClient(const std::string & accessKeyId, const std::string & ac
|
||||
UbsmsClient::~UbsmsClient()
|
||||
{}
|
||||
|
||||
UbsmsClient::NotifyUserBusinessCommandOutcome UbsmsClient::notifyUserBusinessCommand(const NotifyUserBusinessCommandRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return NotifyUserBusinessCommandOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return NotifyUserBusinessCommandOutcome(NotifyUserBusinessCommandResult(outcome.result()));
|
||||
else
|
||||
return NotifyUserBusinessCommandOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void UbsmsClient::notifyUserBusinessCommandAsync(const NotifyUserBusinessCommandRequest& request, const NotifyUserBusinessCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, notifyUserBusinessCommand(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
UbsmsClient::NotifyUserBusinessCommandOutcomeCallable UbsmsClient::notifyUserBusinessCommandCallable(const NotifyUserBusinessCommandRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<NotifyUserBusinessCommandOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->notifyUserBusinessCommand(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
UbsmsClient::DescribeBusinessStatusOutcome UbsmsClient::describeBusinessStatus(const DescribeBusinessStatusRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -123,6 +87,42 @@ UbsmsClient::DescribeBusinessStatusOutcomeCallable UbsmsClient::describeBusiness
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
UbsmsClient::NotifyUserBusinessCommandOutcome UbsmsClient::notifyUserBusinessCommand(const NotifyUserBusinessCommandRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return NotifyUserBusinessCommandOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return NotifyUserBusinessCommandOutcome(NotifyUserBusinessCommandResult(outcome.result()));
|
||||
else
|
||||
return NotifyUserBusinessCommandOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void UbsmsClient::notifyUserBusinessCommandAsync(const NotifyUserBusinessCommandRequest& request, const NotifyUserBusinessCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, notifyUserBusinessCommand(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
UbsmsClient::NotifyUserBusinessCommandOutcomeCallable UbsmsClient::notifyUserBusinessCommandCallable(const NotifyUserBusinessCommandRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<NotifyUserBusinessCommandOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->notifyUserBusinessCommand(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
UbsmsClient::SetUserBusinessStatusOutcome UbsmsClient::setUserBusinessStatus(const SetUserBusinessStatusRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string DescribeBusinessStatusRequest::getPassword()const
|
||||
void DescribeBusinessStatusRequest::setPassword(const std::string& password)
|
||||
{
|
||||
password_ = password;
|
||||
setParameter("Password", password);
|
||||
setCoreParameter("Password", password);
|
||||
}
|
||||
|
||||
std::string DescribeBusinessStatusRequest::getCallerBid()const
|
||||
@@ -44,6 +44,6 @@ std::string DescribeBusinessStatusRequest::getCallerBid()const
|
||||
void DescribeBusinessStatusRequest::setCallerBid(const std::string& callerBid)
|
||||
{
|
||||
callerBid_ = callerBid;
|
||||
setParameter("CallerBid", callerBid);
|
||||
setCoreParameter("CallerBid", callerBid);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ DescribeBusinessStatusResult::~DescribeBusinessStatusResult()
|
||||
|
||||
void DescribeBusinessStatusResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allUserBusinessStatusList = value["UserBusinessStatusList"]["UserBusinessStatus"];
|
||||
for (auto value : allUserBusinessStatusList)
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string NotifyUserBusinessCommandRequest::getUid()const
|
||||
void NotifyUserBusinessCommandRequest::setUid(const std::string& uid)
|
||||
{
|
||||
uid_ = uid;
|
||||
setParameter("Uid", uid);
|
||||
setCoreParameter("Uid", uid);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getPassword()const
|
||||
@@ -44,7 +44,7 @@ std::string NotifyUserBusinessCommandRequest::getPassword()const
|
||||
void NotifyUserBusinessCommandRequest::setPassword(const std::string& password)
|
||||
{
|
||||
password_ = password;
|
||||
setParameter("Password", password);
|
||||
setCoreParameter("Password", password);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getInstanceId()const
|
||||
@@ -55,7 +55,7 @@ std::string NotifyUserBusinessCommandRequest::getInstanceId()const
|
||||
void NotifyUserBusinessCommandRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
setCoreParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getServiceCode()const
|
||||
@@ -66,7 +66,7 @@ std::string NotifyUserBusinessCommandRequest::getServiceCode()const
|
||||
void NotifyUserBusinessCommandRequest::setServiceCode(const std::string& serviceCode)
|
||||
{
|
||||
serviceCode_ = serviceCode;
|
||||
setParameter("ServiceCode", serviceCode);
|
||||
setCoreParameter("ServiceCode", serviceCode);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getClientToken()const
|
||||
@@ -77,7 +77,7 @@ std::string NotifyUserBusinessCommandRequest::getClientToken()const
|
||||
void NotifyUserBusinessCommandRequest::setClientToken(const std::string& clientToken)
|
||||
{
|
||||
clientToken_ = clientToken;
|
||||
setParameter("ClientToken", clientToken);
|
||||
setCoreParameter("ClientToken", clientToken);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getCmd()const
|
||||
@@ -88,7 +88,7 @@ std::string NotifyUserBusinessCommandRequest::getCmd()const
|
||||
void NotifyUserBusinessCommandRequest::setCmd(const std::string& cmd)
|
||||
{
|
||||
cmd_ = cmd;
|
||||
setParameter("Cmd", cmd);
|
||||
setCoreParameter("Cmd", cmd);
|
||||
}
|
||||
|
||||
std::string NotifyUserBusinessCommandRequest::getRegion()const
|
||||
@@ -99,6 +99,6 @@ std::string NotifyUserBusinessCommandRequest::getRegion()const
|
||||
void NotifyUserBusinessCommandRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
setCoreParameter("Region", region);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ NotifyUserBusinessCommandResult::~NotifyUserBusinessCommandResult()
|
||||
|
||||
void NotifyUserBusinessCommandResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string SetUserBusinessStatusRequest::getUid()const
|
||||
void SetUserBusinessStatusRequest::setUid(const std::string& uid)
|
||||
{
|
||||
uid_ = uid;
|
||||
setParameter("Uid", uid);
|
||||
setCoreParameter("Uid", uid);
|
||||
}
|
||||
|
||||
std::string SetUserBusinessStatusRequest::getStatusValue()const
|
||||
@@ -44,7 +44,7 @@ std::string SetUserBusinessStatusRequest::getStatusValue()const
|
||||
void SetUserBusinessStatusRequest::setStatusValue(const std::string& statusValue)
|
||||
{
|
||||
statusValue_ = statusValue;
|
||||
setParameter("StatusValue", statusValue);
|
||||
setCoreParameter("StatusValue", statusValue);
|
||||
}
|
||||
|
||||
std::string SetUserBusinessStatusRequest::getService()const
|
||||
@@ -55,7 +55,7 @@ std::string SetUserBusinessStatusRequest::getService()const
|
||||
void SetUserBusinessStatusRequest::setService(const std::string& service)
|
||||
{
|
||||
service_ = service;
|
||||
setParameter("Service", service);
|
||||
setCoreParameter("Service", service);
|
||||
}
|
||||
|
||||
std::string SetUserBusinessStatusRequest::getStatusKey()const
|
||||
@@ -66,6 +66,6 @@ std::string SetUserBusinessStatusRequest::getStatusKey()const
|
||||
void SetUserBusinessStatusRequest::setStatusKey(const std::string& statusKey)
|
||||
{
|
||||
statusKey_ = statusKey;
|
||||
setParameter("StatusKey", statusKey);
|
||||
setCoreParameter("StatusKey", statusKey);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ SetUserBusinessStatusResult::~SetUserBusinessStatusResult()
|
||||
|
||||
void SetUserBusinessStatusResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
Reference in New Issue
Block a user