Skip to content

Commit

Permalink
Add audience targeting APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
aashikam committed Oct 8, 2024
1 parent ada9d56 commit 6abc1da
Show file tree
Hide file tree
Showing 15 changed files with 843 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/resources/functions/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,33 @@
<file>updateCampaign.xml</file>
<description>Updates a campaign.</description>
</component>
<component name="createAdCreative">
<file>createAdCreative.xml</file>
<description>Creates an ad creative.</description>
</component>
<component name="createCustomAudience">
<file>createCustomAudience.xml</file>
<description>Creates a custom audience.</description>
</component>
<component name="deleteAdCreative">
<file>deleteAdCreative.xml</file>
<description>Deletes an ad creative.</description>
</component>
<component name="deleteCustomAudience">
<file>deleteCustomAudience.xml</file>
<description>Delete a custom audience.</description>
</component>
<component name="getAdCreatives">
<file>getAdCreatives.xml</file>
<description>Get ad creatives.</description>
</component>
<component name="getCustomAudiences">
<file>getCustomAudiences.xml</file>
<description>Get custom audiences.</description>
</component>
<component name="updateCustomAudience">
<file>updateCustomAudience.xml</file>
<description>Updates a custom audience.</description>
</component>
</subComponents>
</component>
31 changes: 31 additions & 0 deletions src/main/resources/functions/createAdCreative.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="createAdCreative">
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/act_{ad_account_id}/adcreatives"/>
</class>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="ContentType" value="application/json" scope="axis2"/>
<call>
<endpoint>
<http method="POST" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
65 changes: 65 additions & 0 deletions src/main/resources/functions/createCustomAudience.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="createCustomAudience">
<!-- Request Body Parameter List -->
<parameter name="name" description="Name of the custom audience. Type: string" />
<parameter name="description" description="Description of the custom audience. Type: string" />
<parameter name="subtype" description="The subtype of the custom audience. Type: string" />
<parameter name="retentionDays" description="The number of days to retain audience members. Type: integer" />
<parameter name="rule" description="A rule that defines this custom audience. Type: string" />
<parameter name="customerFileSource" description="The origin of the customer data. Type: string" />
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/act_{ad_account_id}customaudiences"/>
</class>
<payloadFactory media-type="json" template-type="freemarker">
<format>
<![CDATA[{
<#if (args.arg1)?has_content>
"name": "${args.arg1}", </#if>
<#if (args.arg2)?has_content>
"description": "${args.arg2}", </#if>
<#if (args.arg3)?has_content>
"subtype": "${args.arg3}", </#if>
<#if (args.arg4)?has_content>
"retention_days": "${args.arg4}", </#if>
<#if (args.arg5)?has_content>
"rule": "${args.arg5}", </#if>
<#if (args.arg6)?has_content>
"customer_file_source": "${args.arg6}" </#if>
}]]>
</format>
<args>
<arg evaluator="xml" expression="$func:name"/>
<arg evaluator="xml" expression="$func:description"/>
<arg evaluator="xml" expression="$func:subtype"/>
<arg evaluator="xml" expression="$func:retentionDays"/>
<arg evaluator="xml" expression="$func:rule"/>
<arg evaluator="xml" expression="$func:customerFileSource"/>
</args>
</payloadFactory>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="ContentType" value="application/json" scope="axis2"/>
<call>
<endpoint>
<http method="POST" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
32 changes: 32 additions & 0 deletions src/main/resources/functions/deleteAdCreative.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="deleteAdCreative">
<!-- Path Parameter List -->
<parameter name="adCreativeId" description="The ID of the ad creative." />
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/{ad_creative_id}"/>
<property name="pathParameters" value="adCreativeId,"/>
</class>
<call>
<endpoint>
<http method="DELETE" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
32 changes: 32 additions & 0 deletions src/main/resources/functions/deleteCustomAudience.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="deleteCustomAudience">
<!-- Path Parameter List -->
<parameter name="customAudienceId" description="The ID of the custom audience." />
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/{custom_audience_id}"/>
<property name="pathParameters" value="customAudienceId,"/>
</class>
<call>
<endpoint>
<http method="DELETE" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
30 changes: 30 additions & 0 deletions src/main/resources/functions/getAdCreatives.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="getAdCreatives">
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/act_{ad_account_id}/adcreatives"/>
</class>
<header name="Accept" value="application/json" scope="transport" action="set"/>
<call>
<endpoint>
<http method="GET" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
30 changes: 30 additions & 0 deletions src/main/resources/functions/getCustomAudiences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="getCustomAudiences">
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/act_{ad_account_id}customaudiences"/>
</class>
<header name="Accept" value="application/json" scope="transport" action="set"/>
<call>
<endpoint>
<http method="GET" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
65 changes: 65 additions & 0 deletions src/main/resources/functions/updateCustomAudience.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
~
~ This software is the property of WSO2 LLC. and its suppliers, if any.
~ Dissemination of any information or reproduction of any material contained
~ herein is strictly forbidden, unless permitted by WSO2 in accordance with
~ the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2
~ For specific language governing the permissions and limitations under
~ this license, please see the license as well as any agreement you’ve
~ entered into with WSO2 governing the purchase of this software and any
~ associated services.
-->

<!-- Generated on 08-Tue, 10, 2024 21:24:55+0530 -->

<template xmlns="http://ws.apache.org/ns/synapse" name="updateCustomAudience">
<!-- Path Parameter List -->
<parameter name="customAudienceId" description="The ID of the custom audience." />
<!-- Request Body Parameter List -->
<parameter name="name" description="Name of the custom audience. Type: string" />
<parameter name="description" description="Description of the custom audience. Type: string" />
<parameter name="retentionDays" description="The number of days to retain audience members. Type: integer" />
<parameter name="rule" description="A rule that defines this custom audience. Type: string" />
<parameter name="optOutLink" description="URL where users can opt out. Type: string" />
<sequence>
<class name="org.wso2.healthcare.integration.common.ehr.RestURLBuilder">
<property name="operationPath" value="/{custom_audience_id}"/>
<property name="pathParameters" value="customAudienceId,"/>
</class>
<payloadFactory media-type="json" template-type="freemarker">
<format>
<![CDATA[{
<#if (args.arg1)?has_content>
"name": "${args.arg1}", </#if>
<#if (args.arg2)?has_content>
"description": "${args.arg2}", </#if>
<#if (args.arg3)?has_content>
"retention_days": "${args.arg3}", </#if>
<#if (args.arg4)?has_content>
"rule": "${args.arg4}", </#if>
<#if (args.arg5)?has_content>
"opt_out_link": "${args.arg5}" </#if>
}]]>
</format>
<args>
<arg evaluator="xml" expression="$func:name"/>
<arg evaluator="xml" expression="$func:description"/>
<arg evaluator="xml" expression="$func:retentionDays"/>
<arg evaluator="xml" expression="$func:rule"/>
<arg evaluator="xml" expression="$func:optOutLink"/>
</args>
</payloadFactory>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="ContentType" value="application/json" scope="axis2"/>
<header name="Accept" value="application/json" scope="transport" action="set"/>
<call>
<endpoint>
<http method="POST" uri-template="{uri.var.base}{+uri.var.urlPath}{+uri.var.urlQuery}"/>
</endpoint>
</call>
<class name="org.wso2.healthcare.integration.common.ehr.ResponseProcessingHandler"/>
</sequence>
</template>
Loading

0 comments on commit 6abc1da

Please sign in to comment.