Authentication template add SupportApps
This commit is contained in:
@@ -52,6 +52,10 @@ void CreateChatappTemplateRequest::setComponents(const std::vector<CreateChatapp
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".FlowId", components[dep1].buttons[dep2].flowId);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".FlowAction", components[dep1].buttons[dep2].flowAction);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".NavigateScreen", components[dep1].buttons[dep2].navigateScreen);
|
||||
for(int dep3 = 0; dep3 != components[dep1].buttons[dep2].supportedApps.size(); dep3++) {
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".SupportedApps." + std::to_string(dep3 + 1) + ".SignatureHash", components[dep1].buttons[dep2].supportedApps[dep3].signatureHash);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".SupportedApps." + std::to_string(dep3 + 1) + ".PackageName", components[dep1].buttons[dep2].supportedApps[dep3].packageName);
|
||||
}
|
||||
}
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".ThumbUrl", components[dep1].thumbUrl);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Duration", std::to_string(components[dep1].duration));
|
||||
|
||||
@@ -128,6 +128,16 @@ void GetChatappTemplateDetailResult::parse(const std::string &payload)
|
||||
buttonsObject.flowAction = dataNodeComponentscomponentButtonsbutton["FlowAction"].asString();
|
||||
if(!dataNodeComponentscomponentButtonsbutton["NavigateScreen"].isNull())
|
||||
buttonsObject.navigateScreen = dataNodeComponentscomponentButtonsbutton["NavigateScreen"].asString();
|
||||
auto allSupportedAppsNode = dataNodeComponentscomponentButtonsbutton["SupportedApps"]["supportedAppsItem"];
|
||||
for (auto dataNodeComponentscomponentButtonsbuttonSupportedAppssupportedAppsItem : allSupportedAppsNode)
|
||||
{
|
||||
Data::Component::Button::SupportedAppsItem supportedAppsObject;
|
||||
if(!dataNodeComponentscomponentButtonsbuttonSupportedAppssupportedAppsItem["SignatureHash"].isNull())
|
||||
supportedAppsObject.signatureHash = dataNodeComponentscomponentButtonsbuttonSupportedAppssupportedAppsItem["SignatureHash"].asString();
|
||||
if(!dataNodeComponentscomponentButtonsbuttonSupportedAppssupportedAppsItem["PackageName"].isNull())
|
||||
supportedAppsObject.packageName = dataNodeComponentscomponentButtonsbuttonSupportedAppssupportedAppsItem["PackageName"].asString();
|
||||
buttonsObject.supportedApps.push_back(supportedAppsObject);
|
||||
}
|
||||
auto extendAttrsNode = value["ExtendAttrs"];
|
||||
if(!extendAttrsNode["NextTemplateCode"].isNull())
|
||||
buttonsObject.extendAttrs.nextTemplateCode = extendAttrsNode["NextTemplateCode"].asString();
|
||||
|
||||
@@ -52,6 +52,10 @@ void ModifyChatappTemplateRequest::setComponents(const std::vector<ModifyChatapp
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".FlowId", components[dep1].buttons[dep2].flowId);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".FlowAction", components[dep1].buttons[dep2].flowAction);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".NavigateScreen", components[dep1].buttons[dep2].navigateScreen);
|
||||
for(int dep3 = 0; dep3 != components[dep1].buttons[dep2].supportedApps.size(); dep3++) {
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".SupportedApps." + std::to_string(dep3 + 1) + ".SignatureHash", components[dep1].buttons[dep2].supportedApps[dep3].signatureHash);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Buttons." + std::to_string(dep2 + 1) + ".SupportedApps." + std::to_string(dep3 + 1) + ".PackageName", components[dep1].buttons[dep2].supportedApps[dep3].packageName);
|
||||
}
|
||||
}
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".ThumbUrl", components[dep1].thumbUrl);
|
||||
setBodyParameter(std::string("Components") + "." + std::to_string(dep1 + 1) + ".Duration", std::to_string(components[dep1].duration));
|
||||
|
||||
Reference in New Issue
Block a user