|
| 1 | +/** |
| 2 | + * Represents a Campaign |
| 3 | + * @constructor |
| 4 | + * @param {function} client - make api call |
| 5 | + * @param {object} [data] - data of call |
| 6 | + */ |
| 7 | +export class Campaign extends PlivoResource { |
| 8 | + constructor(client: Function, data?: {}); |
| 9 | + id: string; |
| 10 | + [clientKey]: symbol; |
| 11 | +} |
| 12 | + |
| 13 | +export class CampaignCreateResponse { |
| 14 | + constructor(params: object); |
| 15 | + apiId: string; |
| 16 | + campaignId: string; |
| 17 | + message: string; |
| 18 | + error?: string; |
| 19 | +} |
| 20 | + |
| 21 | +export class LinkUnlinkNumberResponse { |
| 22 | + constructor(params: object); |
| 23 | + apiId: string; |
| 24 | + message?: string; |
| 25 | + error?: string; |
| 26 | + remark?: string; |
| 27 | +} |
| 28 | + |
| 29 | +/** |
| 30 | + * Represents a Campaign Interface |
| 31 | + * @constructor |
| 32 | + * @param {function} client - make api call |
| 33 | + * @param {object} [data] - data of call |
| 34 | + */ |
| 35 | +export class CampaignInterface extends PlivoResource { |
| 36 | + constructor(client: Function, data?: {}); |
| 37 | + /** |
| 38 | + * get Campaign by given id |
| 39 | + * @method |
| 40 | + * @param {string} campaignID - id of Campaign |
| 41 | + * @promise {object} return {@link Campaign} object |
| 42 | + * @fail {Error} return Error |
| 43 | + */ |
| 44 | + get(campaignID: string): Promise<any>; |
| 45 | + |
| 46 | + /** |
| 47 | + * Get All Campaign Detail |
| 48 | + * @method |
| 49 | + * @param {object} params - params brand_id, usecase, campaign_source to get all campaign details. |
| 50 | + * @promise {object[]} returns list of campaign Object |
| 51 | + * @fail {Error} returns Error |
| 52 | + */ |
| 53 | + list(params?: {}): Promise<any>; |
| 54 | + |
| 55 | + /** |
| 56 | + * create Campaign |
| 57 | + * @method |
| 58 | + * @param {string} brand_id |
| 59 | + * @param {string} campaign_alias |
| 60 | + * @param {string} vertical |
| 61 | + * @param {string} usecase |
| 62 | + * @param {array} sub_usecases |
| 63 | + * @param {string} description |
| 64 | + * @param {boolean} embedded_link |
| 65 | + * @param {boolean} embedded_phone |
| 66 | + * @param {boolean} age_gated |
| 67 | + * @param {boolean} direct_lending |
| 68 | + * @param {boolean} subscriber_optin |
| 69 | + * @param {boolean} subscriber_optout |
| 70 | + * @param {boolean} subscriber_help |
| 71 | + * @param {boolean} affiliate_marketing |
| 72 | + * @param {string} sample1 |
| 73 | + * @param {string} sample2 |
| 74 | + * @param {string} message_flow |
| 75 | + * @param {string} help_message |
| 76 | + * @param {string} optout_message |
| 77 | + * @param {object} params - additional params |
| 78 | + * @promise {object} return {@link CampaignCreateResponse} object |
| 79 | + * @fail {Error} return Error |
| 80 | + */ |
| 81 | + create( |
| 82 | + brand_id: string, |
| 83 | + campaign_alias: string, |
| 84 | + vertical: string, |
| 85 | + usecase: string, |
| 86 | + sub_usecases: any[], |
| 87 | + description: string, |
| 88 | + embedded_link: boolean, |
| 89 | + embedded_phone: boolean, |
| 90 | + age_gated: boolean, |
| 91 | + direct_lending: boolean, |
| 92 | + subscriber_optin: boolean, |
| 93 | + subscriber_optout: boolean, |
| 94 | + subscriber_help: boolean, |
| 95 | + affiliate_marketing: boolean, |
| 96 | + sample1: string, |
| 97 | + sample2: string, |
| 98 | + message_flow: string, |
| 99 | + help_message: string, |
| 100 | + optout_message: string, |
| 101 | + params?: {} |
| 102 | + ): Promise<CampaignCreateResponse>; |
| 103 | + |
| 104 | + /** |
| 105 | + * import Campaign |
| 106 | + * @method |
| 107 | + * @param {string} campaign_id |
| 108 | + * @param {string} campaign_alias |
| 109 | + * @param {object} params - additional params |
| 110 | + * @promise {object} return {@link PlivoGenericResponse} object |
| 111 | + * @fail {Error} return Error |
| 112 | + */ |
| 113 | + import_campaign( |
| 114 | + campaign_id: string, |
| 115 | + campaign_alias: string, |
| 116 | + params?: {} |
| 117 | + ): Promise<any>; |
| 118 | + |
| 119 | + /** |
| 120 | + * update Campaign |
| 121 | + * @method |
| 122 | + * @param {string} campaign_id |
| 123 | + * @param {string} reseller_id |
| 124 | + * @param {string} description |
| 125 | + * @param {string} sample1 |
| 126 | + * @param {string} sample2 |
| 127 | + * @param {string} message_flow |
| 128 | + * @param {string} help_message |
| 129 | + * @param {string} optin_keywords |
| 130 | + * @param {string} optin_message |
| 131 | + * @param {string} optout_keywords |
| 132 | + * @param {string} optout_message |
| 133 | + * @param {string} help_keywords |
| 134 | + * @param {object} params - additional params |
| 135 | + * @promise {object} return {@link PlivoGenericResponse} object |
| 136 | + * @fail {Error} return Error |
| 137 | + */ |
| 138 | + update( |
| 139 | + campaign_id: string, |
| 140 | + reseller_id: string, |
| 141 | + description: string, |
| 142 | + sample1: string, |
| 143 | + sample2: string, |
| 144 | + message_flow: string, |
| 145 | + help_message: string, |
| 146 | + optin_keywords: string, |
| 147 | + optin_message: string, |
| 148 | + optout_keywords: string, |
| 149 | + optout_message: string, |
| 150 | + help_keywords: string, |
| 151 | + params?: {} |
| 152 | + ): Promise<any>; |
| 153 | + |
| 154 | + /** |
| 155 | + * getNumber CampaignNumbers by given campaignId, number |
| 156 | + * @method |
| 157 | + * @param {string} campaignID - id of Campaign |
| 158 | + * @param {string} number - number |
| 159 | + * @promise {object} return {@link Campaign} object |
| 160 | + * @fail {Error} return Error |
| 161 | + */ |
| 162 | + getNumber(campaignID: string, number: string): Promise<any>; |
| 163 | + |
| 164 | + /** |
| 165 | + * listNumber CampaignNumbers by given campaignId |
| 166 | + * @method |
| 167 | + * @param {string} campaignID - id of Campaign |
| 168 | + * @param {object} params - limit and offset |
| 169 | + * @promise {object} returns {@link Campaign} object |
| 170 | + * @fail {Error} return Error |
| 171 | + */ |
| 172 | + listNumber(campaignID: string, params?: {}): Promise<any>; |
| 173 | + |
| 174 | + /** |
| 175 | + * linkNumber link number to Campaign |
| 176 | + * @method |
| 177 | + * @param {string} campaignID |
| 178 | + * @param {array} numbers |
| 179 | + * @param {object} params - additional params |
| 180 | + * @promise {object} return {@link LinkUnlinkNumberResponse} object |
| 181 | + * @fail {Error} return Error |
| 182 | + */ |
| 183 | + linkNumber( |
| 184 | + campaignID: string, |
| 185 | + numbers: any[], |
| 186 | + params?: {} |
| 187 | + ): Promise<LinkUnlinkNumberResponse>; |
| 188 | + |
| 189 | + /** |
| 190 | + * unlinkNumber unlink number from Campaign |
| 191 | + * @method |
| 192 | + * @param {string} campaignID |
| 193 | + * @param {string} number |
| 194 | + * @param {object} params - additional params |
| 195 | + * @promise {object} return {@link LinkUnlinkNumberResponse} object |
| 196 | + * @fail {Error} return Error |
| 197 | + */ |
| 198 | + unlinkNumber( |
| 199 | + campaignID: string, |
| 200 | + number: string, |
| 201 | + params?: {} |
| 202 | + ): Promise<LinkUnlinkNumberResponse>; |
| 203 | + |
| 204 | + /** |
| 205 | + * Delete Campaign |
| 206 | + * @method |
| 207 | + * @param {string} campaignID |
| 208 | + * @promise {object} return {@link PlivoGenericResponse} object |
| 209 | + * @fail {Error} return Error |
| 210 | + */ |
| 211 | + deleteCampaign(campaignID: string): Promise<any>; |
| 212 | + [clientKey]: symbol; |
| 213 | +} |
| 214 | + |
| 215 | +import { PlivoResource } from "../base"; |
| 216 | +declare const clientKey: unique symbol; |
| 217 | +export {}; |
| 218 | + |
0 commit comments