Authentication template add SupportApps

This commit is contained in:
sdk-team
2024-06-21 02:00:04 +00:00
parent d4d30d5bb7
commit 5d8d514785
7 changed files with 37 additions and 1 deletions

View File

@@ -49,6 +49,12 @@ public:
std::string flowId;
std::string flowAction;
std::string navigateScreen;
struct SupportedAppsItem {
std::string signatureHash;
std::string packageName;
};
SupportedAppsItem supportedAppsItem;
std::vector<SupportedAppsItem> supportedApps;
};
ButtonsItem buttonsItem;
std::vector<ButtonsItem> buttons;

View File

@@ -46,6 +46,11 @@ namespace AlibabaCloud
std::string intentCode;
std::string nextTemplateName;
};
struct SupportedAppsItem
{
std::string signatureHash;
std::string packageName;
};
std::string autofillText;
std::string packageName;
std::string text;
@@ -59,6 +64,7 @@ namespace AlibabaCloud
std::string signatureHash;
std::string navigateScreen;
std::string phoneNumber;
std::vector<Button::SupportedAppsItem> supportedApps;
std::string urlType;
};
struct

View File

@@ -49,6 +49,12 @@ public:
std::string flowId;
std::string flowAction;
std::string navigateScreen;
struct SupportedAppsItem {
std::string signatureHash;
std::string packageName;
};
SupportedAppsItem supportedAppsItem;
std::vector<SupportedAppsItem> supportedApps;
};
ButtonsItem buttonsItem;
std::vector<ButtonsItem> buttons;

View File

@@ -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));

View File

@@ -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();

View File

@@ -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));