@@ -36,8 +36,12 @@ namespace AlibabaCloud
|
||||
{
|
||||
struct CustomizeFields
|
||||
{
|
||||
std::string mainAccountUid;
|
||||
std::string abcUrl;
|
||||
std::vector<std::string> associatePersonList;
|
||||
std::string distributionLevel;
|
||||
std::string tag;
|
||||
std::string associatePerson;
|
||||
std::string cid;
|
||||
};
|
||||
std::string email;
|
||||
|
||||
@@ -31,21 +31,21 @@ XspaceClient::XspaceClient(const Credentials &credentials, const ClientConfigura
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "xspace");
|
||||
}
|
||||
|
||||
XspaceClient::XspaceClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "xspace");
|
||||
}
|
||||
|
||||
XspaceClient::XspaceClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "xspace");
|
||||
}
|
||||
|
||||
XspaceClient::~XspaceClient()
|
||||
|
||||
@@ -33,6 +33,6 @@ std::string QueryCustomerByIdRequest::getId()const
|
||||
void QueryCustomerByIdRequest::setId(const std::string& id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", id);
|
||||
setCoreParameter("Id", id);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ QueryCustomerByIdResult::~QueryCustomerByIdResult()
|
||||
|
||||
void QueryCustomerByIdResult::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 dataNode = value["Data"];
|
||||
if(!dataNode["Id"].isNull())
|
||||
@@ -62,6 +65,14 @@ void QueryCustomerByIdResult::parse(const std::string &payload)
|
||||
data_.customizeFields.cid = customizeFieldsNode["Cid"].asString();
|
||||
if(!customizeFieldsNode["AbcUrl"].isNull())
|
||||
data_.customizeFields.abcUrl = customizeFieldsNode["AbcUrl"].asString();
|
||||
if(!customizeFieldsNode["DistributionLevel"].isNull())
|
||||
data_.customizeFields.distributionLevel = customizeFieldsNode["DistributionLevel"].asString();
|
||||
if(!customizeFieldsNode["MainAccountUid"].isNull())
|
||||
data_.customizeFields.mainAccountUid = customizeFieldsNode["MainAccountUid"].asString();
|
||||
if(!customizeFieldsNode["AssociatePerson"].isNull())
|
||||
data_.customizeFields.associatePerson = customizeFieldsNode["AssociatePerson"].asString();
|
||||
if(!customizeFieldsNode["Tag"].isNull())
|
||||
data_.customizeFields.tag = customizeFieldsNode["Tag"].asString();
|
||||
auto allAssociatePersonList = customizeFieldsNode["AssociatePersonList"]["AssociatePersonList"];
|
||||
for (auto value : allAssociatePersonList)
|
||||
data_.customizeFields.associatePersonList.push_back(value.asString());
|
||||
|
||||
@@ -33,6 +33,6 @@ std::string QueryCustomerByPhoneRequest::getPhone()const
|
||||
void QueryCustomerByPhoneRequest::setPhone(const std::string& phone)
|
||||
{
|
||||
phone_ = phone;
|
||||
setParameter("Phone", phone);
|
||||
setCoreParameter("Phone", phone);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ QueryCustomerByPhoneResult::~QueryCustomerByPhoneResult()
|
||||
|
||||
void QueryCustomerByPhoneResult::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 allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
|
||||
Reference in New Issue
Block a user