Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend/enh/added-more-params-support-for-whatsapp #756

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["main"]
branches: ["main", "prodHotPush-Common"]
pull_request:
branches: ["main"]
branches: ["main", "prodHotPush-Common"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
14 changes: 11 additions & 3 deletions lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ type GupShupSendMessageWithTemplateIdAPI =
:> QueryParam "var1" Text
:> QueryParam "var2" Text
:> QueryParam "var3" Text
:> QueryParam "var4" Text
:> QueryParam "var5" Text
:> QueryParam "var6" Text
:> QueryParam "var7" Text
:> QueryParam "cta_button_url" Text
:> QueryParam "isTemplate" Bool
:> MandatoryQueryParam "template_id" Text
Expand All @@ -74,7 +78,7 @@ type GupShupSendOtpAPI =

gupShupOptAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> EulerClient Whatsapp.OptApiResp
gupShupSendOtpAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Bool -> EulerClient Whatsapp.SendOtpApiResp
gupShupSendMessageWithTemplateIdAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Text -> EulerClient Whatsapp.SendOtpApiResp
gupShupSendMessageWithTemplateIdAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Text -> EulerClient Whatsapp.SendOtpApiResp
gupShupOptAPIClient :<|> gupShupSendOtpAPIClient :<|> gupShupSendMessageWithTemplateIdAPIClient = client (Proxy :: Proxy GupShupAPI)

whatsAppOptAPI ::
Expand Down Expand Up @@ -157,9 +161,13 @@ whatsAppSendMessageWithTemplateIdAPI ::
Maybe Text ->
Maybe Text ->
Maybe Text ->
Maybe Text ->
Maybe Text ->
Maybe Text ->
Maybe Text ->
Maybe Bool ->
Text ->
m Whatsapp.SendWhatsAppMessageApiResp
whatsAppSendMessageWithTemplateIdAPI url userid password sendTo method auth_scheme v msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId = do
callAPI url (gupShupSendMessageWithTemplateIdAPIClient userid password sendTo method auth_scheme v msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId) "GupShup WhatsApp Message with TemplateId API" (Proxy :: Proxy GupShupAPI)
whatsAppSendMessageWithTemplateIdAPI url userid password sendTo method auth_scheme v msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId = do
callAPI url (gupShupSendMessageWithTemplateIdAPIClient userid password sendTo method auth_scheme v msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId) "GupShup WhatsApp Message with TemplateId API" (Proxy :: Proxy GupShupAPI)
>>= checkGupShupOptError url
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ whatsAppSendMessageWithTemplateIdAPI GupShupCfg {..} SendWhatsAppMessageWithTemp
userId <- decrypt userid
password' <- decrypt password
gupShupUrl <- parseBaseUrl url
Ex.whatsAppSendMessageWithTemplateIdAPI gupShupUrl userId password' sendTo otpCfg.method authScheme v otpCfg.msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId
Ex.whatsAppSendMessageWithTemplateIdAPI gupShupUrl userId password' sendTo otpCfg.method authScheme v otpCfg.msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ data SendWhatsAppMessageWithTemplateIdApIReq = SendWhatsAppMessageWithTemplateId
var1 :: Maybe Text,
var2 :: Maybe Text,
var3 :: Maybe Text,
var4 :: Maybe Text,
var5 :: Maybe Text,
var6 :: Maybe Text,
var7 :: Maybe Text,
ctaButtonUrl :: Maybe Text,
containsUrlButton :: Maybe Bool
}
Expand Down