@appconda/nextjs 1.0.17 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/Cache/Adapter.js +1 -0
  2. package/dist/Cache/Adapters/Filesystem.js +102 -0
  3. package/dist/Cache/Adapters/Memory.js +46 -0
  4. package/dist/Cache/Adapters/None.js +27 -0
  5. package/dist/Cache/Adapters/Redis.js +79 -0
  6. package/dist/Cache/Adapters/Sharding.js +72 -0
  7. package/dist/Cache/Cache.js +51 -0
  8. package/dist/Cache/index.js +5 -0
  9. package/dist/Cache/test.js +0 -0
  10. package/dist/Services.js +28 -0
  11. package/dist/actions/actionClient.js +35 -0
  12. package/dist/actions/index.js +1 -0
  13. package/dist/actions/nodes.js +9 -0
  14. package/dist/client.js +334 -0
  15. package/dist/decorators/Cache.js +78 -0
  16. package/dist/decorators/CacheKey.js +8 -0
  17. package/dist/decorators/Invalidate.js +46 -0
  18. package/dist/enums/api-service.js +14 -0
  19. package/dist/enums/api.js +6 -0
  20. package/dist/enums/auth-method.js +10 -0
  21. package/dist/enums/authentication-factor.js +7 -0
  22. package/dist/enums/authenticator-type.js +4 -0
  23. package/dist/enums/browser.js +17 -0
  24. package/dist/enums/compression.js +6 -0
  25. package/dist/enums/credit-card.js +19 -0
  26. package/dist/enums/database-usage-range.js +6 -0
  27. package/dist/enums/email-template-locale.js +134 -0
  28. package/dist/enums/email-template-type.js +10 -0
  29. package/dist/enums/entities/EntityLimitType.js +5 -0
  30. package/dist/enums/entities/PropertyAttributeName.js +28 -0
  31. package/dist/enums/entities/PropertyCondition.js +9 -0
  32. package/dist/enums/entities/PropertyType.js +17 -0
  33. package/dist/enums/entities/PropertyValueType.js +7 -0
  34. package/dist/enums/entities/RowAccess.js +1 -0
  35. package/dist/enums/entities/ViewFilterCondition.js +13 -0
  36. package/dist/enums/execution-method.js +9 -0
  37. package/dist/enums/flag.js +198 -0
  38. package/dist/enums/function-usage-range.js +6 -0
  39. package/dist/enums/image-format.js +8 -0
  40. package/dist/enums/image-gravity.js +12 -0
  41. package/dist/enums/index-type.js +6 -0
  42. package/dist/enums/messaging-provider-type.js +6 -0
  43. package/dist/enums/name.js +15 -0
  44. package/dist/enums/o-auth-provider copy.js +42 -0
  45. package/dist/enums/o-auth-provider.js +42 -0
  46. package/dist/enums/password-hash.js +14 -0
  47. package/dist/enums/platform-type.js +18 -0
  48. package/dist/enums/project-usage-range.js +5 -0
  49. package/dist/enums/region.js +5 -0
  50. package/dist/enums/relation-mutate.js +6 -0
  51. package/dist/enums/relationship-type.js +7 -0
  52. package/dist/enums/resource-type.js +5 -0
  53. package/dist/enums/runtime.js +49 -0
  54. package/dist/enums/s-m-t-p-secure.js +4 -0
  55. package/dist/enums/shared/ApplicationLayout.js +5 -0
  56. package/dist/enums/shared/Colors.js +25 -0
  57. package/dist/enums/shared/InputType.js +7 -0
  58. package/dist/enums/shared/Periodicity.js +8 -0
  59. package/dist/enums/shared/SvgIcon.js +38 -0
  60. package/dist/enums/shared/Theme.js +5 -0
  61. package/dist/enums/sms-template-locale.js +134 -0
  62. package/dist/enums/sms-template-type.js +7 -0
  63. package/dist/enums/smtp-encryption.js +6 -0
  64. package/dist/enums/storage-usage-range.js +6 -0
  65. package/dist/enums/subscriptions/PricingModel.js +11 -0
  66. package/dist/enums/subscriptions/SubscriptionBillingPeriod.js +10 -0
  67. package/dist/enums/subscriptions/SubscriptionFeatureLimitType.js +12 -0
  68. package/dist/enums/subscriptions/SubscriptionPriceType.js +7 -0
  69. package/dist/enums/tenants/LinkedAccountStatus.js +6 -0
  70. package/dist/enums/tenants/TenantUserJoined.js +7 -0
  71. package/dist/enums/tenants/TenantUserStatus.js +7 -0
  72. package/dist/enums/tenants/TenantUserType.js +6 -0
  73. package/dist/enums/user-usage-range.js +6 -0
  74. package/dist/getAppcondaClient.js +42 -0
  75. package/dist/getSDKForCurrentUser.js +62 -0
  76. package/dist/id.js +44 -0
  77. package/dist/iife/sdk.js +7063 -7805
  78. package/dist/index.js +12558 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/inputFile.js +16 -0
  81. package/dist/lib/Registry/Registry.js +55 -0
  82. package/dist/lib/Registry/index.js +1 -0
  83. package/dist/models.js +1 -0
  84. package/dist/permission.js +53 -0
  85. package/dist/query.js +203 -0
  86. package/dist/role.js +93 -0
  87. package/dist/service-client.js +13 -0
  88. package/dist/service.js +22 -0
  89. package/dist/services/account.js +1259 -0
  90. package/dist/services/applets.js +39 -0
  91. package/dist/services/avatars.js +250 -0
  92. package/dist/services/community.js +68 -0
  93. package/dist/services/configuration.js +10 -0
  94. package/dist/services/databases.js +1735 -0
  95. package/dist/services/functions.js +809 -0
  96. package/dist/services/graphql.js +56 -0
  97. package/dist/services/health.js +462 -0
  98. package/dist/services/locale.js +143 -0
  99. package/dist/services/messaging.js +1919 -0
  100. package/dist/services/node.js +10 -0
  101. package/dist/services/permissions.js +89 -0
  102. package/dist/services/pricing.js +20 -0
  103. package/dist/services/projects.js +1525 -0
  104. package/dist/services/roles.js +71 -0
  105. package/dist/services/schema.js +47 -0
  106. package/dist/services/storage.js +473 -0
  107. package/dist/services/subscription.js +45 -0
  108. package/dist/services/teams.js +394 -0
  109. package/dist/services/tenant-subscription.js +51 -0
  110. package/dist/services/tenant.js +124 -0
  111. package/dist/services/users.js +1282 -0
  112. package/dist/services/waitlist.js +11 -0
  113. package/package.json +5 -12
  114. package/tsconfig.json +2 -1
  115. package/types/Cache/Adapter.d.ts +10 -0
  116. package/types/Cache/Adapters/Filesystem.d.ts +16 -0
  117. package/types/Cache/Adapters/Memory.d.ts +18 -0
  118. package/types/Cache/Adapters/None.d.ts +12 -0
  119. package/types/Cache/Adapters/Redis.d.ts +14 -0
  120. package/types/Cache/Adapters/Sharding.d.ts +17 -0
  121. package/types/Cache/Cache.d.ts +16 -0
  122. package/types/Cache/index.d.ts +5 -0
  123. package/types/Cache/test.d.ts +0 -0
  124. package/types/Services.d.ts +6 -0
  125. package/types/actions/actionClient.d.ts +4 -0
  126. package/types/actions/index.d.ts +1 -0
  127. package/types/actions/nodes.d.ts +4 -0
  128. package/types/client.d.ts +141 -0
  129. package/types/decorators/Cache.d.ts +1 -0
  130. package/types/decorators/CacheKey.d.ts +1 -0
  131. package/types/decorators/Invalidate.d.ts +1 -0
  132. package/types/enums/api-service.d.ts +13 -0
  133. package/types/enums/api.d.ts +5 -0
  134. package/types/enums/auth-method.d.ts +9 -0
  135. package/types/enums/authentication-factor.d.ts +6 -0
  136. package/types/enums/authenticator-type.d.ts +3 -0
  137. package/types/enums/browser.d.ts +16 -0
  138. package/types/enums/compression.d.ts +5 -0
  139. package/types/enums/credit-card.d.ts +18 -0
  140. package/types/enums/database-usage-range.d.ts +5 -0
  141. package/types/enums/email-template-locale.d.ts +133 -0
  142. package/types/enums/email-template-type.d.ts +9 -0
  143. package/types/enums/entities/EntityLimitType.d.ts +4 -0
  144. package/types/enums/entities/PropertyAttributeName.d.ts +27 -0
  145. package/types/enums/entities/PropertyCondition.d.ts +7 -0
  146. package/types/enums/entities/PropertyType.d.ts +12 -0
  147. package/types/enums/entities/PropertyValueType.d.ts +6 -0
  148. package/types/enums/entities/RowAccess.d.ts +2 -0
  149. package/types/enums/entities/ViewFilterCondition.d.ts +12 -0
  150. package/types/enums/execution-method.d.ts +8 -0
  151. package/types/enums/flag.d.ts +197 -0
  152. package/types/enums/function-usage-range.d.ts +5 -0
  153. package/types/enums/image-format.d.ts +7 -0
  154. package/types/enums/image-gravity.d.ts +11 -0
  155. package/types/enums/index-type.d.ts +5 -0
  156. package/types/enums/messaging-provider-type.d.ts +5 -0
  157. package/types/enums/name.d.ts +14 -0
  158. package/types/enums/o-auth-provider copy.d.ts +41 -0
  159. package/types/enums/o-auth-provider.d.ts +41 -0
  160. package/types/enums/password-hash.d.ts +13 -0
  161. package/types/enums/platform-type.d.ts +17 -0
  162. package/types/enums/project-usage-range.d.ts +4 -0
  163. package/types/enums/region.d.ts +4 -0
  164. package/types/enums/relation-mutate.d.ts +5 -0
  165. package/types/enums/relationship-type.d.ts +6 -0
  166. package/types/enums/resource-type.d.ts +4 -0
  167. package/types/enums/runtime.d.ts +48 -0
  168. package/types/enums/s-m-t-p-secure.d.ts +3 -0
  169. package/types/enums/shared/ApplicationLayout.d.ts +4 -0
  170. package/types/enums/shared/Colors.d.ts +24 -0
  171. package/types/enums/shared/InputType.d.ts +6 -0
  172. package/types/enums/shared/Periodicity.d.ts +7 -0
  173. package/types/enums/shared/SvgIcon.d.ts +37 -0
  174. package/types/enums/shared/Theme.d.ts +4 -0
  175. package/types/enums/sms-template-locale.d.ts +133 -0
  176. package/types/enums/sms-template-type.d.ts +6 -0
  177. package/types/enums/smtp-encryption.d.ts +5 -0
  178. package/types/enums/storage-usage-range.d.ts +5 -0
  179. package/types/enums/subscriptions/PricingModel.d.ts +11 -0
  180. package/types/enums/subscriptions/SubscriptionBillingPeriod.d.ts +10 -0
  181. package/types/enums/subscriptions/SubscriptionFeatureLimitType.d.ts +10 -0
  182. package/types/enums/subscriptions/SubscriptionPriceType.d.ts +7 -0
  183. package/types/enums/tenants/LinkedAccountStatus.d.ts +5 -0
  184. package/types/enums/tenants/TenantUserJoined.d.ts +6 -0
  185. package/types/enums/tenants/TenantUserStatus.d.ts +6 -0
  186. package/types/enums/tenants/TenantUserType.d.ts +5 -0
  187. package/types/enums/user-usage-range.d.ts +5 -0
  188. package/types/getAppcondaClient.d.ts +2 -0
  189. package/types/getSDKForCurrentUser.d.ts +33 -0
  190. package/types/id.d.ts +20 -0
  191. package/types/index.d.ts +39 -0
  192. package/types/inputFile.d.ts +6 -0
  193. package/types/lib/Registry/Registry.d.ts +38 -0
  194. package/types/lib/Registry/index.d.ts +1 -0
  195. package/types/models.d.ts +3272 -0
  196. package/types/permission.d.ts +43 -0
  197. package/types/query.d.ts +194 -0
  198. package/types/role.d.ts +70 -0
  199. package/types/service-client.d.ts +7 -0
  200. package/types/service.d.ts +11 -0
  201. package/types/services/account.d.ts +530 -0
  202. package/types/services/acl.d.ts +28 -0
  203. package/types/services/applets.d.ts +9 -0
  204. package/types/services/assistant.d.ts +14 -0
  205. package/types/services/avatars.d.ts +115 -0
  206. package/types/services/community.d.ts +19 -0
  207. package/types/services/configuration.d.ts +5 -0
  208. package/types/services/console.d.ts +15 -0
  209. package/types/services/databases.d.ts +613 -0
  210. package/types/services/functions.d.ts +319 -0
  211. package/types/services/graphql.d.ts +25 -0
  212. package/types/services/health.d.ts +231 -0
  213. package/types/services/locale.d.ts +80 -0
  214. package/types/services/messaging.d.ts +685 -0
  215. package/types/services/migrations.d.ts +185 -0
  216. package/types/services/node.d.ts +5 -0
  217. package/types/services/permissions.d.ts +20 -0
  218. package/types/services/pricing.d.ts +15 -0
  219. package/types/services/project.d.ts +70 -0
  220. package/types/services/projects.d.ts +542 -0
  221. package/types/services/proxy.d.ts +59 -0
  222. package/types/services/roles.d.ts +19 -0
  223. package/types/services/schema.d.ts +17 -0
  224. package/types/services/storage.d.ts +189 -0
  225. package/types/services/subscription-product.d.ts +77 -0
  226. package/types/services/subscription.d.ts +15 -0
  227. package/types/services/teams.d.ts +167 -0
  228. package/types/services/tenant-subscription.d.ts +12 -0
  229. package/types/services/tenant.d.ts +32 -0
  230. package/types/services/users.d.ts +499 -0
  231. package/types/services/vcs.d.ts +108 -0
  232. package/types/services/waitlist.d.ts +5 -0
  233. package/dist/cjs/sdk.js +0 -13300
  234. package/dist/cjs/sdk.js.map +0 -1
  235. package/dist/esm/sdk.js +0 -13278
  236. package/dist/esm/sdk.js.map +0 -1
@@ -0,0 +1,1919 @@
1
+ import { AppcondaException } from '../client';
2
+ export class Messaging {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * List messages
8
+ *
9
+ * Get a list of all messages from the current Appconda project.
10
+ *
11
+ * @param {string[]} queries
12
+ * @param {string} search
13
+ * @throws {AppcondaException}
14
+ * @returns {Promise<Models.MessageList>}
15
+ */
16
+ async listMessages(queries, search) {
17
+ const apiPath = '/messaging/messages';
18
+ const payload = {};
19
+ if (typeof queries !== 'undefined') {
20
+ payload['queries'] = queries;
21
+ }
22
+ if (typeof search !== 'undefined') {
23
+ payload['search'] = search;
24
+ }
25
+ const uri = new URL(this.client.config.endpoint + apiPath);
26
+ const apiHeaders = {
27
+ 'content-type': 'application/json',
28
+ };
29
+ return await this.client.call('get', uri, apiHeaders, payload);
30
+ }
31
+ /**
32
+ * Create email
33
+ *
34
+ * Create a new email message.
35
+ *
36
+ * @param {string} messageId
37
+ * @param {string} subject
38
+ * @param {string} content
39
+ * @param {string[]} topics
40
+ * @param {string[]} users
41
+ * @param {string[]} targets
42
+ * @param {string[]} cc
43
+ * @param {string[]} bcc
44
+ * @param {string[]} attachments
45
+ * @param {boolean} draft
46
+ * @param {boolean} html
47
+ * @param {string} scheduledAt
48
+ * @throws {AppcondaException}
49
+ * @returns {Promise<Models.Message>}
50
+ */
51
+ async createEmail(messageId, subject, content, topics, users, targets, cc, bcc, attachments, draft, html, scheduledAt) {
52
+ if (typeof messageId === 'undefined') {
53
+ throw new AppcondaException('Missing required parameter: "messageId"');
54
+ }
55
+ if (typeof subject === 'undefined') {
56
+ throw new AppcondaException('Missing required parameter: "subject"');
57
+ }
58
+ if (typeof content === 'undefined') {
59
+ throw new AppcondaException('Missing required parameter: "content"');
60
+ }
61
+ const apiPath = '/messaging/messages/email';
62
+ const payload = {};
63
+ if (typeof messageId !== 'undefined') {
64
+ payload['messageId'] = messageId;
65
+ }
66
+ if (typeof subject !== 'undefined') {
67
+ payload['subject'] = subject;
68
+ }
69
+ if (typeof content !== 'undefined') {
70
+ payload['content'] = content;
71
+ }
72
+ if (typeof topics !== 'undefined') {
73
+ payload['topics'] = topics;
74
+ }
75
+ if (typeof users !== 'undefined') {
76
+ payload['users'] = users;
77
+ }
78
+ if (typeof targets !== 'undefined') {
79
+ payload['targets'] = targets;
80
+ }
81
+ if (typeof cc !== 'undefined') {
82
+ payload['cc'] = cc;
83
+ }
84
+ if (typeof bcc !== 'undefined') {
85
+ payload['bcc'] = bcc;
86
+ }
87
+ if (typeof attachments !== 'undefined') {
88
+ payload['attachments'] = attachments;
89
+ }
90
+ if (typeof draft !== 'undefined') {
91
+ payload['draft'] = draft;
92
+ }
93
+ if (typeof html !== 'undefined') {
94
+ payload['html'] = html;
95
+ }
96
+ if (typeof scheduledAt !== 'undefined') {
97
+ payload['scheduledAt'] = scheduledAt;
98
+ }
99
+ const uri = new URL(this.client.config.endpoint + apiPath);
100
+ const apiHeaders = {
101
+ 'content-type': 'application/json',
102
+ };
103
+ return await this.client.call('post', uri, apiHeaders, payload);
104
+ }
105
+ /**
106
+ * Update email
107
+ *
108
+ * Update an email message by its unique ID.
109
+
110
+ *
111
+ * @param {string} messageId
112
+ * @param {string[]} topics
113
+ * @param {string[]} users
114
+ * @param {string[]} targets
115
+ * @param {string} subject
116
+ * @param {string} content
117
+ * @param {boolean} draft
118
+ * @param {boolean} html
119
+ * @param {string[]} cc
120
+ * @param {string[]} bcc
121
+ * @param {string} scheduledAt
122
+ * @param {string[]} attachments
123
+ * @throws {AppcondaException}
124
+ * @returns {Promise<Models.Message>}
125
+ */
126
+ async updateEmail(messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, attachments) {
127
+ if (typeof messageId === 'undefined') {
128
+ throw new AppcondaException('Missing required parameter: "messageId"');
129
+ }
130
+ const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
131
+ const payload = {};
132
+ if (typeof topics !== 'undefined') {
133
+ payload['topics'] = topics;
134
+ }
135
+ if (typeof users !== 'undefined') {
136
+ payload['users'] = users;
137
+ }
138
+ if (typeof targets !== 'undefined') {
139
+ payload['targets'] = targets;
140
+ }
141
+ if (typeof subject !== 'undefined') {
142
+ payload['subject'] = subject;
143
+ }
144
+ if (typeof content !== 'undefined') {
145
+ payload['content'] = content;
146
+ }
147
+ if (typeof draft !== 'undefined') {
148
+ payload['draft'] = draft;
149
+ }
150
+ if (typeof html !== 'undefined') {
151
+ payload['html'] = html;
152
+ }
153
+ if (typeof cc !== 'undefined') {
154
+ payload['cc'] = cc;
155
+ }
156
+ if (typeof bcc !== 'undefined') {
157
+ payload['bcc'] = bcc;
158
+ }
159
+ if (typeof scheduledAt !== 'undefined') {
160
+ payload['scheduledAt'] = scheduledAt;
161
+ }
162
+ if (typeof attachments !== 'undefined') {
163
+ payload['attachments'] = attachments;
164
+ }
165
+ const uri = new URL(this.client.config.endpoint + apiPath);
166
+ const apiHeaders = {
167
+ 'content-type': 'application/json',
168
+ };
169
+ return await this.client.call('patch', uri, apiHeaders, payload);
170
+ }
171
+ /**
172
+ * Create push notification
173
+ *
174
+ * Create a new push notification.
175
+ *
176
+ * @param {string} messageId
177
+ * @param {string} title
178
+ * @param {string} body
179
+ * @param {string[]} topics
180
+ * @param {string[]} users
181
+ * @param {string[]} targets
182
+ * @param {object} data
183
+ * @param {string} action
184
+ * @param {string} image
185
+ * @param {string} icon
186
+ * @param {string} sound
187
+ * @param {string} color
188
+ * @param {string} tag
189
+ * @param {string} badge
190
+ * @param {boolean} draft
191
+ * @param {string} scheduledAt
192
+ * @throws {AppcondaException}
193
+ * @returns {Promise<Models.Message>}
194
+ */
195
+ async createPush(messageId, title, body, topics, users, targets, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt) {
196
+ if (typeof messageId === 'undefined') {
197
+ throw new AppcondaException('Missing required parameter: "messageId"');
198
+ }
199
+ if (typeof title === 'undefined') {
200
+ throw new AppcondaException('Missing required parameter: "title"');
201
+ }
202
+ if (typeof body === 'undefined') {
203
+ throw new AppcondaException('Missing required parameter: "body"');
204
+ }
205
+ const apiPath = '/messaging/messages/push';
206
+ const payload = {};
207
+ if (typeof messageId !== 'undefined') {
208
+ payload['messageId'] = messageId;
209
+ }
210
+ if (typeof title !== 'undefined') {
211
+ payload['title'] = title;
212
+ }
213
+ if (typeof body !== 'undefined') {
214
+ payload['body'] = body;
215
+ }
216
+ if (typeof topics !== 'undefined') {
217
+ payload['topics'] = topics;
218
+ }
219
+ if (typeof users !== 'undefined') {
220
+ payload['users'] = users;
221
+ }
222
+ if (typeof targets !== 'undefined') {
223
+ payload['targets'] = targets;
224
+ }
225
+ if (typeof data !== 'undefined') {
226
+ payload['data'] = data;
227
+ }
228
+ if (typeof action !== 'undefined') {
229
+ payload['action'] = action;
230
+ }
231
+ if (typeof image !== 'undefined') {
232
+ payload['image'] = image;
233
+ }
234
+ if (typeof icon !== 'undefined') {
235
+ payload['icon'] = icon;
236
+ }
237
+ if (typeof sound !== 'undefined') {
238
+ payload['sound'] = sound;
239
+ }
240
+ if (typeof color !== 'undefined') {
241
+ payload['color'] = color;
242
+ }
243
+ if (typeof tag !== 'undefined') {
244
+ payload['tag'] = tag;
245
+ }
246
+ if (typeof badge !== 'undefined') {
247
+ payload['badge'] = badge;
248
+ }
249
+ if (typeof draft !== 'undefined') {
250
+ payload['draft'] = draft;
251
+ }
252
+ if (typeof scheduledAt !== 'undefined') {
253
+ payload['scheduledAt'] = scheduledAt;
254
+ }
255
+ const uri = new URL(this.client.config.endpoint + apiPath);
256
+ const apiHeaders = {
257
+ 'content-type': 'application/json',
258
+ };
259
+ return await this.client.call('post', uri, apiHeaders, payload);
260
+ }
261
+ /**
262
+ * Update push notification
263
+ *
264
+ * Update a push notification by its unique ID.
265
+
266
+ *
267
+ * @param {string} messageId
268
+ * @param {string[]} topics
269
+ * @param {string[]} users
270
+ * @param {string[]} targets
271
+ * @param {string} title
272
+ * @param {string} body
273
+ * @param {object} data
274
+ * @param {string} action
275
+ * @param {string} image
276
+ * @param {string} icon
277
+ * @param {string} sound
278
+ * @param {string} color
279
+ * @param {string} tag
280
+ * @param {number} badge
281
+ * @param {boolean} draft
282
+ * @param {string} scheduledAt
283
+ * @throws {AppcondaException}
284
+ * @returns {Promise<Models.Message>}
285
+ */
286
+ async updatePush(messageId, topics, users, targets, title, body, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt) {
287
+ if (typeof messageId === 'undefined') {
288
+ throw new AppcondaException('Missing required parameter: "messageId"');
289
+ }
290
+ const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
291
+ const payload = {};
292
+ if (typeof topics !== 'undefined') {
293
+ payload['topics'] = topics;
294
+ }
295
+ if (typeof users !== 'undefined') {
296
+ payload['users'] = users;
297
+ }
298
+ if (typeof targets !== 'undefined') {
299
+ payload['targets'] = targets;
300
+ }
301
+ if (typeof title !== 'undefined') {
302
+ payload['title'] = title;
303
+ }
304
+ if (typeof body !== 'undefined') {
305
+ payload['body'] = body;
306
+ }
307
+ if (typeof data !== 'undefined') {
308
+ payload['data'] = data;
309
+ }
310
+ if (typeof action !== 'undefined') {
311
+ payload['action'] = action;
312
+ }
313
+ if (typeof image !== 'undefined') {
314
+ payload['image'] = image;
315
+ }
316
+ if (typeof icon !== 'undefined') {
317
+ payload['icon'] = icon;
318
+ }
319
+ if (typeof sound !== 'undefined') {
320
+ payload['sound'] = sound;
321
+ }
322
+ if (typeof color !== 'undefined') {
323
+ payload['color'] = color;
324
+ }
325
+ if (typeof tag !== 'undefined') {
326
+ payload['tag'] = tag;
327
+ }
328
+ if (typeof badge !== 'undefined') {
329
+ payload['badge'] = badge;
330
+ }
331
+ if (typeof draft !== 'undefined') {
332
+ payload['draft'] = draft;
333
+ }
334
+ if (typeof scheduledAt !== 'undefined') {
335
+ payload['scheduledAt'] = scheduledAt;
336
+ }
337
+ const uri = new URL(this.client.config.endpoint + apiPath);
338
+ const apiHeaders = {
339
+ 'content-type': 'application/json',
340
+ };
341
+ return await this.client.call('patch', uri, apiHeaders, payload);
342
+ }
343
+ /**
344
+ * Create SMS
345
+ *
346
+ * Create a new SMS message.
347
+ *
348
+ * @param {string} messageId
349
+ * @param {string} content
350
+ * @param {string[]} topics
351
+ * @param {string[]} users
352
+ * @param {string[]} targets
353
+ * @param {boolean} draft
354
+ * @param {string} scheduledAt
355
+ * @throws {AppcondaException}
356
+ * @returns {Promise<Models.Message>}
357
+ */
358
+ async createSms(messageId, content, topics, users, targets, draft, scheduledAt) {
359
+ if (typeof messageId === 'undefined') {
360
+ throw new AppcondaException('Missing required parameter: "messageId"');
361
+ }
362
+ if (typeof content === 'undefined') {
363
+ throw new AppcondaException('Missing required parameter: "content"');
364
+ }
365
+ const apiPath = '/messaging/messages/sms';
366
+ const payload = {};
367
+ if (typeof messageId !== 'undefined') {
368
+ payload['messageId'] = messageId;
369
+ }
370
+ if (typeof content !== 'undefined') {
371
+ payload['content'] = content;
372
+ }
373
+ if (typeof topics !== 'undefined') {
374
+ payload['topics'] = topics;
375
+ }
376
+ if (typeof users !== 'undefined') {
377
+ payload['users'] = users;
378
+ }
379
+ if (typeof targets !== 'undefined') {
380
+ payload['targets'] = targets;
381
+ }
382
+ if (typeof draft !== 'undefined') {
383
+ payload['draft'] = draft;
384
+ }
385
+ if (typeof scheduledAt !== 'undefined') {
386
+ payload['scheduledAt'] = scheduledAt;
387
+ }
388
+ const uri = new URL(this.client.config.endpoint + apiPath);
389
+ const apiHeaders = {
390
+ 'content-type': 'application/json',
391
+ };
392
+ return await this.client.call('post', uri, apiHeaders, payload);
393
+ }
394
+ /**
395
+ * Update SMS
396
+ *
397
+ * Update an email message by its unique ID.
398
+
399
+ *
400
+ * @param {string} messageId
401
+ * @param {string[]} topics
402
+ * @param {string[]} users
403
+ * @param {string[]} targets
404
+ * @param {string} content
405
+ * @param {boolean} draft
406
+ * @param {string} scheduledAt
407
+ * @throws {AppcondaException}
408
+ * @returns {Promise<Models.Message>}
409
+ */
410
+ async updateSms(messageId, topics, users, targets, content, draft, scheduledAt) {
411
+ if (typeof messageId === 'undefined') {
412
+ throw new AppcondaException('Missing required parameter: "messageId"');
413
+ }
414
+ const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
415
+ const payload = {};
416
+ if (typeof topics !== 'undefined') {
417
+ payload['topics'] = topics;
418
+ }
419
+ if (typeof users !== 'undefined') {
420
+ payload['users'] = users;
421
+ }
422
+ if (typeof targets !== 'undefined') {
423
+ payload['targets'] = targets;
424
+ }
425
+ if (typeof content !== 'undefined') {
426
+ payload['content'] = content;
427
+ }
428
+ if (typeof draft !== 'undefined') {
429
+ payload['draft'] = draft;
430
+ }
431
+ if (typeof scheduledAt !== 'undefined') {
432
+ payload['scheduledAt'] = scheduledAt;
433
+ }
434
+ const uri = new URL(this.client.config.endpoint + apiPath);
435
+ const apiHeaders = {
436
+ 'content-type': 'application/json',
437
+ };
438
+ return await this.client.call('patch', uri, apiHeaders, payload);
439
+ }
440
+ /**
441
+ * Get message
442
+ *
443
+ * Get a message by its unique ID.
444
+
445
+ *
446
+ * @param {string} messageId
447
+ * @throws {AppcondaException}
448
+ * @returns {Promise<Models.Message>}
449
+ */
450
+ async getMessage(messageId) {
451
+ if (typeof messageId === 'undefined') {
452
+ throw new AppcondaException('Missing required parameter: "messageId"');
453
+ }
454
+ const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
455
+ const payload = {};
456
+ const uri = new URL(this.client.config.endpoint + apiPath);
457
+ const apiHeaders = {
458
+ 'content-type': 'application/json',
459
+ };
460
+ return await this.client.call('get', uri, apiHeaders, payload);
461
+ }
462
+ /**
463
+ * Delete message
464
+ *
465
+ * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
466
+ *
467
+ * @param {string} messageId
468
+ * @throws {AppcondaException}
469
+ * @returns {Promise<{}>}
470
+ */
471
+ async delete(messageId) {
472
+ if (typeof messageId === 'undefined') {
473
+ throw new AppcondaException('Missing required parameter: "messageId"');
474
+ }
475
+ const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
476
+ const payload = {};
477
+ const uri = new URL(this.client.config.endpoint + apiPath);
478
+ const apiHeaders = {
479
+ 'content-type': 'application/json',
480
+ };
481
+ return await this.client.call('delete', uri, apiHeaders, payload);
482
+ }
483
+ /**
484
+ * List message logs
485
+ *
486
+ * Get the message activity logs listed by its unique ID.
487
+ *
488
+ * @param {string} messageId
489
+ * @param {string[]} queries
490
+ * @throws {AppcondaException}
491
+ * @returns {Promise<Models.LogList>}
492
+ */
493
+ async listMessageLogs(messageId, queries) {
494
+ if (typeof messageId === 'undefined') {
495
+ throw new AppcondaException('Missing required parameter: "messageId"');
496
+ }
497
+ const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
498
+ const payload = {};
499
+ if (typeof queries !== 'undefined') {
500
+ payload['queries'] = queries;
501
+ }
502
+ const uri = new URL(this.client.config.endpoint + apiPath);
503
+ const apiHeaders = {
504
+ 'content-type': 'application/json',
505
+ };
506
+ return await this.client.call('get', uri, apiHeaders, payload);
507
+ }
508
+ /**
509
+ * List message targets
510
+ *
511
+ * Get a list of the targets associated with a message.
512
+ *
513
+ * @param {string} messageId
514
+ * @param {string[]} queries
515
+ * @throws {AppcondaException}
516
+ * @returns {Promise<Models.TargetList>}
517
+ */
518
+ async listTargets(messageId, queries) {
519
+ if (typeof messageId === 'undefined') {
520
+ throw new AppcondaException('Missing required parameter: "messageId"');
521
+ }
522
+ const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
523
+ const payload = {};
524
+ if (typeof queries !== 'undefined') {
525
+ payload['queries'] = queries;
526
+ }
527
+ const uri = new URL(this.client.config.endpoint + apiPath);
528
+ const apiHeaders = {
529
+ 'content-type': 'application/json',
530
+ };
531
+ return await this.client.call('get', uri, apiHeaders, payload);
532
+ }
533
+ /**
534
+ * List providers
535
+ *
536
+ * Get a list of all providers from the current Appconda project.
537
+ *
538
+ * @param {string[]} queries
539
+ * @param {string} search
540
+ * @throws {AppcondaException}
541
+ * @returns {Promise<Models.ProviderList>}
542
+ */
543
+ async listProviders(queries, search) {
544
+ const apiPath = '/messaging/providers';
545
+ const payload = {};
546
+ if (typeof queries !== 'undefined') {
547
+ payload['queries'] = queries;
548
+ }
549
+ if (typeof search !== 'undefined') {
550
+ payload['search'] = search;
551
+ }
552
+ const uri = new URL(this.client.config.endpoint + apiPath);
553
+ const apiHeaders = {
554
+ 'content-type': 'application/json',
555
+ };
556
+ return await this.client.call('get', uri, apiHeaders, payload);
557
+ }
558
+ /**
559
+ * Create APNS provider
560
+ *
561
+ * Create a new Apple Push Notification service provider.
562
+ *
563
+ * @param {string} providerId
564
+ * @param {string} name
565
+ * @param {string} authKey
566
+ * @param {string} authKeyId
567
+ * @param {string} teamId
568
+ * @param {string} bundleId
569
+ * @param {boolean} sandbox
570
+ * @param {boolean} enabled
571
+ * @throws {AppcondaException}
572
+ * @returns {Promise<Models.Provider>}
573
+ */
574
+ async createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId, sandbox, enabled) {
575
+ if (typeof providerId === 'undefined') {
576
+ throw new AppcondaException('Missing required parameter: "providerId"');
577
+ }
578
+ if (typeof name === 'undefined') {
579
+ throw new AppcondaException('Missing required parameter: "name"');
580
+ }
581
+ const apiPath = '/messaging/providers/apns';
582
+ const payload = {};
583
+ if (typeof providerId !== 'undefined') {
584
+ payload['providerId'] = providerId;
585
+ }
586
+ if (typeof name !== 'undefined') {
587
+ payload['name'] = name;
588
+ }
589
+ if (typeof authKey !== 'undefined') {
590
+ payload['authKey'] = authKey;
591
+ }
592
+ if (typeof authKeyId !== 'undefined') {
593
+ payload['authKeyId'] = authKeyId;
594
+ }
595
+ if (typeof teamId !== 'undefined') {
596
+ payload['teamId'] = teamId;
597
+ }
598
+ if (typeof bundleId !== 'undefined') {
599
+ payload['bundleId'] = bundleId;
600
+ }
601
+ if (typeof sandbox !== 'undefined') {
602
+ payload['sandbox'] = sandbox;
603
+ }
604
+ if (typeof enabled !== 'undefined') {
605
+ payload['enabled'] = enabled;
606
+ }
607
+ const uri = new URL(this.client.config.endpoint + apiPath);
608
+ const apiHeaders = {
609
+ 'content-type': 'application/json',
610
+ };
611
+ return await this.client.call('post', uri, apiHeaders, payload);
612
+ }
613
+ /**
614
+ * Update APNS provider
615
+ *
616
+ * Update a Apple Push Notification service provider by its unique ID.
617
+ *
618
+ * @param {string} providerId
619
+ * @param {string} name
620
+ * @param {boolean} enabled
621
+ * @param {string} authKey
622
+ * @param {string} authKeyId
623
+ * @param {string} teamId
624
+ * @param {string} bundleId
625
+ * @param {boolean} sandbox
626
+ * @throws {AppcondaException}
627
+ * @returns {Promise<Models.Provider>}
628
+ */
629
+ async updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId, sandbox) {
630
+ if (typeof providerId === 'undefined') {
631
+ throw new AppcondaException('Missing required parameter: "providerId"');
632
+ }
633
+ const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
634
+ const payload = {};
635
+ if (typeof name !== 'undefined') {
636
+ payload['name'] = name;
637
+ }
638
+ if (typeof enabled !== 'undefined') {
639
+ payload['enabled'] = enabled;
640
+ }
641
+ if (typeof authKey !== 'undefined') {
642
+ payload['authKey'] = authKey;
643
+ }
644
+ if (typeof authKeyId !== 'undefined') {
645
+ payload['authKeyId'] = authKeyId;
646
+ }
647
+ if (typeof teamId !== 'undefined') {
648
+ payload['teamId'] = teamId;
649
+ }
650
+ if (typeof bundleId !== 'undefined') {
651
+ payload['bundleId'] = bundleId;
652
+ }
653
+ if (typeof sandbox !== 'undefined') {
654
+ payload['sandbox'] = sandbox;
655
+ }
656
+ const uri = new URL(this.client.config.endpoint + apiPath);
657
+ const apiHeaders = {
658
+ 'content-type': 'application/json',
659
+ };
660
+ return await this.client.call('patch', uri, apiHeaders, payload);
661
+ }
662
+ /**
663
+ * Create FCM provider
664
+ *
665
+ * Create a new Firebase Cloud Messaging provider.
666
+ *
667
+ * @param {string} providerId
668
+ * @param {string} name
669
+ * @param {object} serviceAccountJSON
670
+ * @param {boolean} enabled
671
+ * @throws {AppcondaException}
672
+ * @returns {Promise<Models.Provider>}
673
+ */
674
+ async createFcmProvider(providerId, name, serviceAccountJSON, enabled) {
675
+ if (typeof providerId === 'undefined') {
676
+ throw new AppcondaException('Missing required parameter: "providerId"');
677
+ }
678
+ if (typeof name === 'undefined') {
679
+ throw new AppcondaException('Missing required parameter: "name"');
680
+ }
681
+ const apiPath = '/messaging/providers/fcm';
682
+ const payload = {};
683
+ if (typeof providerId !== 'undefined') {
684
+ payload['providerId'] = providerId;
685
+ }
686
+ if (typeof name !== 'undefined') {
687
+ payload['name'] = name;
688
+ }
689
+ if (typeof serviceAccountJSON !== 'undefined') {
690
+ payload['serviceAccountJSON'] = serviceAccountJSON;
691
+ }
692
+ if (typeof enabled !== 'undefined') {
693
+ payload['enabled'] = enabled;
694
+ }
695
+ const uri = new URL(this.client.config.endpoint + apiPath);
696
+ const apiHeaders = {
697
+ 'content-type': 'application/json',
698
+ };
699
+ return await this.client.call('post', uri, apiHeaders, payload);
700
+ }
701
+ /**
702
+ * Update FCM provider
703
+ *
704
+ * Update a Firebase Cloud Messaging provider by its unique ID.
705
+ *
706
+ * @param {string} providerId
707
+ * @param {string} name
708
+ * @param {boolean} enabled
709
+ * @param {object} serviceAccountJSON
710
+ * @throws {AppcondaException}
711
+ * @returns {Promise<Models.Provider>}
712
+ */
713
+ async updateFcmProvider(providerId, name, enabled, serviceAccountJSON) {
714
+ if (typeof providerId === 'undefined') {
715
+ throw new AppcondaException('Missing required parameter: "providerId"');
716
+ }
717
+ const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
718
+ const payload = {};
719
+ if (typeof name !== 'undefined') {
720
+ payload['name'] = name;
721
+ }
722
+ if (typeof enabled !== 'undefined') {
723
+ payload['enabled'] = enabled;
724
+ }
725
+ if (typeof serviceAccountJSON !== 'undefined') {
726
+ payload['serviceAccountJSON'] = serviceAccountJSON;
727
+ }
728
+ const uri = new URL(this.client.config.endpoint + apiPath);
729
+ const apiHeaders = {
730
+ 'content-type': 'application/json',
731
+ };
732
+ return await this.client.call('patch', uri, apiHeaders, payload);
733
+ }
734
+ /**
735
+ * Create Mailgun provider
736
+ *
737
+ * Create a new Mailgun provider.
738
+ *
739
+ * @param {string} providerId
740
+ * @param {string} name
741
+ * @param {string} apiKey
742
+ * @param {string} domain
743
+ * @param {boolean} isEuRegion
744
+ * @param {string} fromName
745
+ * @param {string} fromEmail
746
+ * @param {string} replyToName
747
+ * @param {string} replyToEmail
748
+ * @param {boolean} enabled
749
+ * @throws {AppcondaException}
750
+ * @returns {Promise<Models.Provider>}
751
+ */
752
+ async createMailgunProvider(providerId, name, apiKey, domain, isEuRegion, fromName, fromEmail, replyToName, replyToEmail, enabled) {
753
+ if (typeof providerId === 'undefined') {
754
+ throw new AppcondaException('Missing required parameter: "providerId"');
755
+ }
756
+ if (typeof name === 'undefined') {
757
+ throw new AppcondaException('Missing required parameter: "name"');
758
+ }
759
+ const apiPath = '/messaging/providers/mailgun';
760
+ const payload = {};
761
+ if (typeof providerId !== 'undefined') {
762
+ payload['providerId'] = providerId;
763
+ }
764
+ if (typeof name !== 'undefined') {
765
+ payload['name'] = name;
766
+ }
767
+ if (typeof apiKey !== 'undefined') {
768
+ payload['apiKey'] = apiKey;
769
+ }
770
+ if (typeof domain !== 'undefined') {
771
+ payload['domain'] = domain;
772
+ }
773
+ if (typeof isEuRegion !== 'undefined') {
774
+ payload['isEuRegion'] = isEuRegion;
775
+ }
776
+ if (typeof fromName !== 'undefined') {
777
+ payload['fromName'] = fromName;
778
+ }
779
+ if (typeof fromEmail !== 'undefined') {
780
+ payload['fromEmail'] = fromEmail;
781
+ }
782
+ if (typeof replyToName !== 'undefined') {
783
+ payload['replyToName'] = replyToName;
784
+ }
785
+ if (typeof replyToEmail !== 'undefined') {
786
+ payload['replyToEmail'] = replyToEmail;
787
+ }
788
+ if (typeof enabled !== 'undefined') {
789
+ payload['enabled'] = enabled;
790
+ }
791
+ const uri = new URL(this.client.config.endpoint + apiPath);
792
+ const apiHeaders = {
793
+ 'content-type': 'application/json',
794
+ };
795
+ return await this.client.call('post', uri, apiHeaders, payload);
796
+ }
797
+ /**
798
+ * Update Mailgun provider
799
+ *
800
+ * Update a Mailgun provider by its unique ID.
801
+ *
802
+ * @param {string} providerId
803
+ * @param {string} name
804
+ * @param {string} apiKey
805
+ * @param {string} domain
806
+ * @param {boolean} isEuRegion
807
+ * @param {boolean} enabled
808
+ * @param {string} fromName
809
+ * @param {string} fromEmail
810
+ * @param {string} replyToName
811
+ * @param {string} replyToEmail
812
+ * @throws {AppcondaException}
813
+ * @returns {Promise<Models.Provider>}
814
+ */
815
+ async updateMailgunProvider(providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail) {
816
+ if (typeof providerId === 'undefined') {
817
+ throw new AppcondaException('Missing required parameter: "providerId"');
818
+ }
819
+ const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
820
+ const payload = {};
821
+ if (typeof name !== 'undefined') {
822
+ payload['name'] = name;
823
+ }
824
+ if (typeof apiKey !== 'undefined') {
825
+ payload['apiKey'] = apiKey;
826
+ }
827
+ if (typeof domain !== 'undefined') {
828
+ payload['domain'] = domain;
829
+ }
830
+ if (typeof isEuRegion !== 'undefined') {
831
+ payload['isEuRegion'] = isEuRegion;
832
+ }
833
+ if (typeof enabled !== 'undefined') {
834
+ payload['enabled'] = enabled;
835
+ }
836
+ if (typeof fromName !== 'undefined') {
837
+ payload['fromName'] = fromName;
838
+ }
839
+ if (typeof fromEmail !== 'undefined') {
840
+ payload['fromEmail'] = fromEmail;
841
+ }
842
+ if (typeof replyToName !== 'undefined') {
843
+ payload['replyToName'] = replyToName;
844
+ }
845
+ if (typeof replyToEmail !== 'undefined') {
846
+ payload['replyToEmail'] = replyToEmail;
847
+ }
848
+ const uri = new URL(this.client.config.endpoint + apiPath);
849
+ const apiHeaders = {
850
+ 'content-type': 'application/json',
851
+ };
852
+ return await this.client.call('patch', uri, apiHeaders, payload);
853
+ }
854
+ /**
855
+ * Create Msg91 provider
856
+ *
857
+ * Create a new MSG91 provider.
858
+ *
859
+ * @param {string} providerId
860
+ * @param {string} name
861
+ * @param {string} templateId
862
+ * @param {string} senderId
863
+ * @param {string} authKey
864
+ * @param {boolean} enabled
865
+ * @throws {AppcondaException}
866
+ * @returns {Promise<Models.Provider>}
867
+ */
868
+ async createMsg91Provider(providerId, name, templateId, senderId, authKey, enabled) {
869
+ if (typeof providerId === 'undefined') {
870
+ throw new AppcondaException('Missing required parameter: "providerId"');
871
+ }
872
+ if (typeof name === 'undefined') {
873
+ throw new AppcondaException('Missing required parameter: "name"');
874
+ }
875
+ const apiPath = '/messaging/providers/msg91';
876
+ const payload = {};
877
+ if (typeof providerId !== 'undefined') {
878
+ payload['providerId'] = providerId;
879
+ }
880
+ if (typeof name !== 'undefined') {
881
+ payload['name'] = name;
882
+ }
883
+ if (typeof templateId !== 'undefined') {
884
+ payload['templateId'] = templateId;
885
+ }
886
+ if (typeof senderId !== 'undefined') {
887
+ payload['senderId'] = senderId;
888
+ }
889
+ if (typeof authKey !== 'undefined') {
890
+ payload['authKey'] = authKey;
891
+ }
892
+ if (typeof enabled !== 'undefined') {
893
+ payload['enabled'] = enabled;
894
+ }
895
+ const uri = new URL(this.client.config.endpoint + apiPath);
896
+ const apiHeaders = {
897
+ 'content-type': 'application/json',
898
+ };
899
+ return await this.client.call('post', uri, apiHeaders, payload);
900
+ }
901
+ /**
902
+ * Update Msg91 provider
903
+ *
904
+ * Update a MSG91 provider by its unique ID.
905
+ *
906
+ * @param {string} providerId
907
+ * @param {string} name
908
+ * @param {boolean} enabled
909
+ * @param {string} templateId
910
+ * @param {string} senderId
911
+ * @param {string} authKey
912
+ * @throws {AppcondaException}
913
+ * @returns {Promise<Models.Provider>}
914
+ */
915
+ async updateMsg91Provider(providerId, name, enabled, templateId, senderId, authKey) {
916
+ if (typeof providerId === 'undefined') {
917
+ throw new AppcondaException('Missing required parameter: "providerId"');
918
+ }
919
+ const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
920
+ const payload = {};
921
+ if (typeof name !== 'undefined') {
922
+ payload['name'] = name;
923
+ }
924
+ if (typeof enabled !== 'undefined') {
925
+ payload['enabled'] = enabled;
926
+ }
927
+ if (typeof templateId !== 'undefined') {
928
+ payload['templateId'] = templateId;
929
+ }
930
+ if (typeof senderId !== 'undefined') {
931
+ payload['senderId'] = senderId;
932
+ }
933
+ if (typeof authKey !== 'undefined') {
934
+ payload['authKey'] = authKey;
935
+ }
936
+ const uri = new URL(this.client.config.endpoint + apiPath);
937
+ const apiHeaders = {
938
+ 'content-type': 'application/json',
939
+ };
940
+ return await this.client.call('patch', uri, apiHeaders, payload);
941
+ }
942
+ /**
943
+ * Create Sendgrid provider
944
+ *
945
+ * Create a new Sendgrid provider.
946
+ *
947
+ * @param {string} providerId
948
+ * @param {string} name
949
+ * @param {string} apiKey
950
+ * @param {string} fromName
951
+ * @param {string} fromEmail
952
+ * @param {string} replyToName
953
+ * @param {string} replyToEmail
954
+ * @param {boolean} enabled
955
+ * @throws {AppcondaException}
956
+ * @returns {Promise<Models.Provider>}
957
+ */
958
+ async createSendgridProvider(providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled) {
959
+ if (typeof providerId === 'undefined') {
960
+ throw new AppcondaException('Missing required parameter: "providerId"');
961
+ }
962
+ if (typeof name === 'undefined') {
963
+ throw new AppcondaException('Missing required parameter: "name"');
964
+ }
965
+ const apiPath = '/messaging/providers/sendgrid';
966
+ const payload = {};
967
+ if (typeof providerId !== 'undefined') {
968
+ payload['providerId'] = providerId;
969
+ }
970
+ if (typeof name !== 'undefined') {
971
+ payload['name'] = name;
972
+ }
973
+ if (typeof apiKey !== 'undefined') {
974
+ payload['apiKey'] = apiKey;
975
+ }
976
+ if (typeof fromName !== 'undefined') {
977
+ payload['fromName'] = fromName;
978
+ }
979
+ if (typeof fromEmail !== 'undefined') {
980
+ payload['fromEmail'] = fromEmail;
981
+ }
982
+ if (typeof replyToName !== 'undefined') {
983
+ payload['replyToName'] = replyToName;
984
+ }
985
+ if (typeof replyToEmail !== 'undefined') {
986
+ payload['replyToEmail'] = replyToEmail;
987
+ }
988
+ if (typeof enabled !== 'undefined') {
989
+ payload['enabled'] = enabled;
990
+ }
991
+ const uri = new URL(this.client.config.endpoint + apiPath);
992
+ const apiHeaders = {
993
+ 'content-type': 'application/json',
994
+ };
995
+ return await this.client.call('post', uri, apiHeaders, payload);
996
+ }
997
+ /**
998
+ * Update Sendgrid provider
999
+ *
1000
+ * Update a Sendgrid provider by its unique ID.
1001
+ *
1002
+ * @param {string} providerId
1003
+ * @param {string} name
1004
+ * @param {boolean} enabled
1005
+ * @param {string} apiKey
1006
+ * @param {string} fromName
1007
+ * @param {string} fromEmail
1008
+ * @param {string} replyToName
1009
+ * @param {string} replyToEmail
1010
+ * @throws {AppcondaException}
1011
+ * @returns {Promise<Models.Provider>}
1012
+ */
1013
+ async updateSendgridProvider(providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail) {
1014
+ if (typeof providerId === 'undefined') {
1015
+ throw new AppcondaException('Missing required parameter: "providerId"');
1016
+ }
1017
+ const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
1018
+ const payload = {};
1019
+ if (typeof name !== 'undefined') {
1020
+ payload['name'] = name;
1021
+ }
1022
+ if (typeof enabled !== 'undefined') {
1023
+ payload['enabled'] = enabled;
1024
+ }
1025
+ if (typeof apiKey !== 'undefined') {
1026
+ payload['apiKey'] = apiKey;
1027
+ }
1028
+ if (typeof fromName !== 'undefined') {
1029
+ payload['fromName'] = fromName;
1030
+ }
1031
+ if (typeof fromEmail !== 'undefined') {
1032
+ payload['fromEmail'] = fromEmail;
1033
+ }
1034
+ if (typeof replyToName !== 'undefined') {
1035
+ payload['replyToName'] = replyToName;
1036
+ }
1037
+ if (typeof replyToEmail !== 'undefined') {
1038
+ payload['replyToEmail'] = replyToEmail;
1039
+ }
1040
+ const uri = new URL(this.client.config.endpoint + apiPath);
1041
+ const apiHeaders = {
1042
+ 'content-type': 'application/json',
1043
+ };
1044
+ return await this.client.call('patch', uri, apiHeaders, payload);
1045
+ }
1046
+ /**
1047
+ * Create SMTP provider
1048
+ *
1049
+ * Create a new SMTP provider.
1050
+ *
1051
+ * @param {string} providerId
1052
+ * @param {string} name
1053
+ * @param {string} host
1054
+ * @param {number} port
1055
+ * @param {string} username
1056
+ * @param {string} password
1057
+ * @param {SmtpEncryption} encryption
1058
+ * @param {boolean} autoTLS
1059
+ * @param {string} mailer
1060
+ * @param {string} fromName
1061
+ * @param {string} fromEmail
1062
+ * @param {string} replyToName
1063
+ * @param {string} replyToEmail
1064
+ * @param {boolean} enabled
1065
+ * @throws {AppcondaException}
1066
+ * @returns {Promise<Models.Provider>}
1067
+ */
1068
+ async createSmtpProvider(providerId, name, host, port, username, password, encryption, autoTLS, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled) {
1069
+ if (typeof providerId === 'undefined') {
1070
+ throw new AppcondaException('Missing required parameter: "providerId"');
1071
+ }
1072
+ if (typeof name === 'undefined') {
1073
+ throw new AppcondaException('Missing required parameter: "name"');
1074
+ }
1075
+ if (typeof host === 'undefined') {
1076
+ throw new AppcondaException('Missing required parameter: "host"');
1077
+ }
1078
+ const apiPath = '/messaging/providers/smtp';
1079
+ const payload = {};
1080
+ if (typeof providerId !== 'undefined') {
1081
+ payload['providerId'] = providerId;
1082
+ }
1083
+ if (typeof name !== 'undefined') {
1084
+ payload['name'] = name;
1085
+ }
1086
+ if (typeof host !== 'undefined') {
1087
+ payload['host'] = host;
1088
+ }
1089
+ if (typeof port !== 'undefined') {
1090
+ payload['port'] = port;
1091
+ }
1092
+ if (typeof username !== 'undefined') {
1093
+ payload['username'] = username;
1094
+ }
1095
+ if (typeof password !== 'undefined') {
1096
+ payload['password'] = password;
1097
+ }
1098
+ if (typeof encryption !== 'undefined') {
1099
+ payload['encryption'] = encryption;
1100
+ }
1101
+ if (typeof autoTLS !== 'undefined') {
1102
+ payload['autoTLS'] = autoTLS;
1103
+ }
1104
+ if (typeof mailer !== 'undefined') {
1105
+ payload['mailer'] = mailer;
1106
+ }
1107
+ if (typeof fromName !== 'undefined') {
1108
+ payload['fromName'] = fromName;
1109
+ }
1110
+ if (typeof fromEmail !== 'undefined') {
1111
+ payload['fromEmail'] = fromEmail;
1112
+ }
1113
+ if (typeof replyToName !== 'undefined') {
1114
+ payload['replyToName'] = replyToName;
1115
+ }
1116
+ if (typeof replyToEmail !== 'undefined') {
1117
+ payload['replyToEmail'] = replyToEmail;
1118
+ }
1119
+ if (typeof enabled !== 'undefined') {
1120
+ payload['enabled'] = enabled;
1121
+ }
1122
+ const uri = new URL(this.client.config.endpoint + apiPath);
1123
+ const apiHeaders = {
1124
+ 'content-type': 'application/json',
1125
+ };
1126
+ return await this.client.call('post', uri, apiHeaders, payload);
1127
+ }
1128
+ /**
1129
+ * Update SMTP provider
1130
+ *
1131
+ * Update a SMTP provider by its unique ID.
1132
+ *
1133
+ * @param {string} providerId
1134
+ * @param {string} name
1135
+ * @param {string} host
1136
+ * @param {number} port
1137
+ * @param {string} username
1138
+ * @param {string} password
1139
+ * @param {SmtpEncryption} encryption
1140
+ * @param {boolean} autoTLS
1141
+ * @param {string} mailer
1142
+ * @param {string} fromName
1143
+ * @param {string} fromEmail
1144
+ * @param {string} replyToName
1145
+ * @param {string} replyToEmail
1146
+ * @param {boolean} enabled
1147
+ * @throws {AppcondaException}
1148
+ * @returns {Promise<Models.Provider>}
1149
+ */
1150
+ async updateSmtpProvider(providerId, name, host, port, username, password, encryption, autoTLS, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled) {
1151
+ if (typeof providerId === 'undefined') {
1152
+ throw new AppcondaException('Missing required parameter: "providerId"');
1153
+ }
1154
+ const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
1155
+ const payload = {};
1156
+ if (typeof name !== 'undefined') {
1157
+ payload['name'] = name;
1158
+ }
1159
+ if (typeof host !== 'undefined') {
1160
+ payload['host'] = host;
1161
+ }
1162
+ if (typeof port !== 'undefined') {
1163
+ payload['port'] = port;
1164
+ }
1165
+ if (typeof username !== 'undefined') {
1166
+ payload['username'] = username;
1167
+ }
1168
+ if (typeof password !== 'undefined') {
1169
+ payload['password'] = password;
1170
+ }
1171
+ if (typeof encryption !== 'undefined') {
1172
+ payload['encryption'] = encryption;
1173
+ }
1174
+ if (typeof autoTLS !== 'undefined') {
1175
+ payload['autoTLS'] = autoTLS;
1176
+ }
1177
+ if (typeof mailer !== 'undefined') {
1178
+ payload['mailer'] = mailer;
1179
+ }
1180
+ if (typeof fromName !== 'undefined') {
1181
+ payload['fromName'] = fromName;
1182
+ }
1183
+ if (typeof fromEmail !== 'undefined') {
1184
+ payload['fromEmail'] = fromEmail;
1185
+ }
1186
+ if (typeof replyToName !== 'undefined') {
1187
+ payload['replyToName'] = replyToName;
1188
+ }
1189
+ if (typeof replyToEmail !== 'undefined') {
1190
+ payload['replyToEmail'] = replyToEmail;
1191
+ }
1192
+ if (typeof enabled !== 'undefined') {
1193
+ payload['enabled'] = enabled;
1194
+ }
1195
+ const uri = new URL(this.client.config.endpoint + apiPath);
1196
+ const apiHeaders = {
1197
+ 'content-type': 'application/json',
1198
+ };
1199
+ return await this.client.call('patch', uri, apiHeaders, payload);
1200
+ }
1201
+ /**
1202
+ * Create Telesign provider
1203
+ *
1204
+ * Create a new Telesign provider.
1205
+ *
1206
+ * @param {string} providerId
1207
+ * @param {string} name
1208
+ * @param {string} from
1209
+ * @param {string} customerId
1210
+ * @param {string} apiKey
1211
+ * @param {boolean} enabled
1212
+ * @throws {AppcondaException}
1213
+ * @returns {Promise<Models.Provider>}
1214
+ */
1215
+ async createTelesignProvider(providerId, name, from, customerId, apiKey, enabled) {
1216
+ if (typeof providerId === 'undefined') {
1217
+ throw new AppcondaException('Missing required parameter: "providerId"');
1218
+ }
1219
+ if (typeof name === 'undefined') {
1220
+ throw new AppcondaException('Missing required parameter: "name"');
1221
+ }
1222
+ const apiPath = '/messaging/providers/telesign';
1223
+ const payload = {};
1224
+ if (typeof providerId !== 'undefined') {
1225
+ payload['providerId'] = providerId;
1226
+ }
1227
+ if (typeof name !== 'undefined') {
1228
+ payload['name'] = name;
1229
+ }
1230
+ if (typeof from !== 'undefined') {
1231
+ payload['from'] = from;
1232
+ }
1233
+ if (typeof customerId !== 'undefined') {
1234
+ payload['customerId'] = customerId;
1235
+ }
1236
+ if (typeof apiKey !== 'undefined') {
1237
+ payload['apiKey'] = apiKey;
1238
+ }
1239
+ if (typeof enabled !== 'undefined') {
1240
+ payload['enabled'] = enabled;
1241
+ }
1242
+ const uri = new URL(this.client.config.endpoint + apiPath);
1243
+ const apiHeaders = {
1244
+ 'content-type': 'application/json',
1245
+ };
1246
+ return await this.client.call('post', uri, apiHeaders, payload);
1247
+ }
1248
+ /**
1249
+ * Update Telesign provider
1250
+ *
1251
+ * Update a Telesign provider by its unique ID.
1252
+ *
1253
+ * @param {string} providerId
1254
+ * @param {string} name
1255
+ * @param {boolean} enabled
1256
+ * @param {string} customerId
1257
+ * @param {string} apiKey
1258
+ * @param {string} from
1259
+ * @throws {AppcondaException}
1260
+ * @returns {Promise<Models.Provider>}
1261
+ */
1262
+ async updateTelesignProvider(providerId, name, enabled, customerId, apiKey, from) {
1263
+ if (typeof providerId === 'undefined') {
1264
+ throw new AppcondaException('Missing required parameter: "providerId"');
1265
+ }
1266
+ const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
1267
+ const payload = {};
1268
+ if (typeof name !== 'undefined') {
1269
+ payload['name'] = name;
1270
+ }
1271
+ if (typeof enabled !== 'undefined') {
1272
+ payload['enabled'] = enabled;
1273
+ }
1274
+ if (typeof customerId !== 'undefined') {
1275
+ payload['customerId'] = customerId;
1276
+ }
1277
+ if (typeof apiKey !== 'undefined') {
1278
+ payload['apiKey'] = apiKey;
1279
+ }
1280
+ if (typeof from !== 'undefined') {
1281
+ payload['from'] = from;
1282
+ }
1283
+ const uri = new URL(this.client.config.endpoint + apiPath);
1284
+ const apiHeaders = {
1285
+ 'content-type': 'application/json',
1286
+ };
1287
+ return await this.client.call('patch', uri, apiHeaders, payload);
1288
+ }
1289
+ /**
1290
+ * Create Textmagic provider
1291
+ *
1292
+ * Create a new Textmagic provider.
1293
+ *
1294
+ * @param {string} providerId
1295
+ * @param {string} name
1296
+ * @param {string} from
1297
+ * @param {string} username
1298
+ * @param {string} apiKey
1299
+ * @param {boolean} enabled
1300
+ * @throws {AppcondaException}
1301
+ * @returns {Promise<Models.Provider>}
1302
+ */
1303
+ async createTextmagicProvider(providerId, name, from, username, apiKey, enabled) {
1304
+ if (typeof providerId === 'undefined') {
1305
+ throw new AppcondaException('Missing required parameter: "providerId"');
1306
+ }
1307
+ if (typeof name === 'undefined') {
1308
+ throw new AppcondaException('Missing required parameter: "name"');
1309
+ }
1310
+ const apiPath = '/messaging/providers/textmagic';
1311
+ const payload = {};
1312
+ if (typeof providerId !== 'undefined') {
1313
+ payload['providerId'] = providerId;
1314
+ }
1315
+ if (typeof name !== 'undefined') {
1316
+ payload['name'] = name;
1317
+ }
1318
+ if (typeof from !== 'undefined') {
1319
+ payload['from'] = from;
1320
+ }
1321
+ if (typeof username !== 'undefined') {
1322
+ payload['username'] = username;
1323
+ }
1324
+ if (typeof apiKey !== 'undefined') {
1325
+ payload['apiKey'] = apiKey;
1326
+ }
1327
+ if (typeof enabled !== 'undefined') {
1328
+ payload['enabled'] = enabled;
1329
+ }
1330
+ const uri = new URL(this.client.config.endpoint + apiPath);
1331
+ const apiHeaders = {
1332
+ 'content-type': 'application/json',
1333
+ };
1334
+ return await this.client.call('post', uri, apiHeaders, payload);
1335
+ }
1336
+ /**
1337
+ * Update Textmagic provider
1338
+ *
1339
+ * Update a Textmagic provider by its unique ID.
1340
+ *
1341
+ * @param {string} providerId
1342
+ * @param {string} name
1343
+ * @param {boolean} enabled
1344
+ * @param {string} username
1345
+ * @param {string} apiKey
1346
+ * @param {string} from
1347
+ * @throws {AppcondaException}
1348
+ * @returns {Promise<Models.Provider>}
1349
+ */
1350
+ async updateTextmagicProvider(providerId, name, enabled, username, apiKey, from) {
1351
+ if (typeof providerId === 'undefined') {
1352
+ throw new AppcondaException('Missing required parameter: "providerId"');
1353
+ }
1354
+ const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
1355
+ const payload = {};
1356
+ if (typeof name !== 'undefined') {
1357
+ payload['name'] = name;
1358
+ }
1359
+ if (typeof enabled !== 'undefined') {
1360
+ payload['enabled'] = enabled;
1361
+ }
1362
+ if (typeof username !== 'undefined') {
1363
+ payload['username'] = username;
1364
+ }
1365
+ if (typeof apiKey !== 'undefined') {
1366
+ payload['apiKey'] = apiKey;
1367
+ }
1368
+ if (typeof from !== 'undefined') {
1369
+ payload['from'] = from;
1370
+ }
1371
+ const uri = new URL(this.client.config.endpoint + apiPath);
1372
+ const apiHeaders = {
1373
+ 'content-type': 'application/json',
1374
+ };
1375
+ return await this.client.call('patch', uri, apiHeaders, payload);
1376
+ }
1377
+ /**
1378
+ * Create Twilio provider
1379
+ *
1380
+ * Create a new Twilio provider.
1381
+ *
1382
+ * @param {string} providerId
1383
+ * @param {string} name
1384
+ * @param {string} from
1385
+ * @param {string} accountSid
1386
+ * @param {string} authToken
1387
+ * @param {boolean} enabled
1388
+ * @throws {AppcondaException}
1389
+ * @returns {Promise<Models.Provider>}
1390
+ */
1391
+ async createTwilioProvider(providerId, name, from, accountSid, authToken, enabled) {
1392
+ if (typeof providerId === 'undefined') {
1393
+ throw new AppcondaException('Missing required parameter: "providerId"');
1394
+ }
1395
+ if (typeof name === 'undefined') {
1396
+ throw new AppcondaException('Missing required parameter: "name"');
1397
+ }
1398
+ const apiPath = '/messaging/providers/twilio';
1399
+ const payload = {};
1400
+ if (typeof providerId !== 'undefined') {
1401
+ payload['providerId'] = providerId;
1402
+ }
1403
+ if (typeof name !== 'undefined') {
1404
+ payload['name'] = name;
1405
+ }
1406
+ if (typeof from !== 'undefined') {
1407
+ payload['from'] = from;
1408
+ }
1409
+ if (typeof accountSid !== 'undefined') {
1410
+ payload['accountSid'] = accountSid;
1411
+ }
1412
+ if (typeof authToken !== 'undefined') {
1413
+ payload['authToken'] = authToken;
1414
+ }
1415
+ if (typeof enabled !== 'undefined') {
1416
+ payload['enabled'] = enabled;
1417
+ }
1418
+ const uri = new URL(this.client.config.endpoint + apiPath);
1419
+ const apiHeaders = {
1420
+ 'content-type': 'application/json',
1421
+ };
1422
+ return await this.client.call('post', uri, apiHeaders, payload);
1423
+ }
1424
+ /**
1425
+ * Update Twilio provider
1426
+ *
1427
+ * Update a Twilio provider by its unique ID.
1428
+ *
1429
+ * @param {string} providerId
1430
+ * @param {string} name
1431
+ * @param {boolean} enabled
1432
+ * @param {string} accountSid
1433
+ * @param {string} authToken
1434
+ * @param {string} from
1435
+ * @throws {AppcondaException}
1436
+ * @returns {Promise<Models.Provider>}
1437
+ */
1438
+ async updateTwilioProvider(providerId, name, enabled, accountSid, authToken, from) {
1439
+ if (typeof providerId === 'undefined') {
1440
+ throw new AppcondaException('Missing required parameter: "providerId"');
1441
+ }
1442
+ const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
1443
+ const payload = {};
1444
+ if (typeof name !== 'undefined') {
1445
+ payload['name'] = name;
1446
+ }
1447
+ if (typeof enabled !== 'undefined') {
1448
+ payload['enabled'] = enabled;
1449
+ }
1450
+ if (typeof accountSid !== 'undefined') {
1451
+ payload['accountSid'] = accountSid;
1452
+ }
1453
+ if (typeof authToken !== 'undefined') {
1454
+ payload['authToken'] = authToken;
1455
+ }
1456
+ if (typeof from !== 'undefined') {
1457
+ payload['from'] = from;
1458
+ }
1459
+ const uri = new URL(this.client.config.endpoint + apiPath);
1460
+ const apiHeaders = {
1461
+ 'content-type': 'application/json',
1462
+ };
1463
+ return await this.client.call('patch', uri, apiHeaders, payload);
1464
+ }
1465
+ /**
1466
+ * Create Vonage provider
1467
+ *
1468
+ * Create a new Vonage provider.
1469
+ *
1470
+ * @param {string} providerId
1471
+ * @param {string} name
1472
+ * @param {string} from
1473
+ * @param {string} apiKey
1474
+ * @param {string} apiSecret
1475
+ * @param {boolean} enabled
1476
+ * @throws {AppcondaException}
1477
+ * @returns {Promise<Models.Provider>}
1478
+ */
1479
+ async createVonageProvider(providerId, name, from, apiKey, apiSecret, enabled) {
1480
+ if (typeof providerId === 'undefined') {
1481
+ throw new AppcondaException('Missing required parameter: "providerId"');
1482
+ }
1483
+ if (typeof name === 'undefined') {
1484
+ throw new AppcondaException('Missing required parameter: "name"');
1485
+ }
1486
+ const apiPath = '/messaging/providers/vonage';
1487
+ const payload = {};
1488
+ if (typeof providerId !== 'undefined') {
1489
+ payload['providerId'] = providerId;
1490
+ }
1491
+ if (typeof name !== 'undefined') {
1492
+ payload['name'] = name;
1493
+ }
1494
+ if (typeof from !== 'undefined') {
1495
+ payload['from'] = from;
1496
+ }
1497
+ if (typeof apiKey !== 'undefined') {
1498
+ payload['apiKey'] = apiKey;
1499
+ }
1500
+ if (typeof apiSecret !== 'undefined') {
1501
+ payload['apiSecret'] = apiSecret;
1502
+ }
1503
+ if (typeof enabled !== 'undefined') {
1504
+ payload['enabled'] = enabled;
1505
+ }
1506
+ const uri = new URL(this.client.config.endpoint + apiPath);
1507
+ const apiHeaders = {
1508
+ 'content-type': 'application/json',
1509
+ };
1510
+ return await this.client.call('post', uri, apiHeaders, payload);
1511
+ }
1512
+ /**
1513
+ * Update Vonage provider
1514
+ *
1515
+ * Update a Vonage provider by its unique ID.
1516
+ *
1517
+ * @param {string} providerId
1518
+ * @param {string} name
1519
+ * @param {boolean} enabled
1520
+ * @param {string} apiKey
1521
+ * @param {string} apiSecret
1522
+ * @param {string} from
1523
+ * @throws {AppcondaException}
1524
+ * @returns {Promise<Models.Provider>}
1525
+ */
1526
+ async updateVonageProvider(providerId, name, enabled, apiKey, apiSecret, from) {
1527
+ if (typeof providerId === 'undefined') {
1528
+ throw new AppcondaException('Missing required parameter: "providerId"');
1529
+ }
1530
+ const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
1531
+ const payload = {};
1532
+ if (typeof name !== 'undefined') {
1533
+ payload['name'] = name;
1534
+ }
1535
+ if (typeof enabled !== 'undefined') {
1536
+ payload['enabled'] = enabled;
1537
+ }
1538
+ if (typeof apiKey !== 'undefined') {
1539
+ payload['apiKey'] = apiKey;
1540
+ }
1541
+ if (typeof apiSecret !== 'undefined') {
1542
+ payload['apiSecret'] = apiSecret;
1543
+ }
1544
+ if (typeof from !== 'undefined') {
1545
+ payload['from'] = from;
1546
+ }
1547
+ const uri = new URL(this.client.config.endpoint + apiPath);
1548
+ const apiHeaders = {
1549
+ 'content-type': 'application/json',
1550
+ };
1551
+ return await this.client.call('patch', uri, apiHeaders, payload);
1552
+ }
1553
+ /**
1554
+ * Get provider
1555
+ *
1556
+ * Get a provider by its unique ID.
1557
+
1558
+ *
1559
+ * @param {string} providerId
1560
+ * @throws {AppcondaException}
1561
+ * @returns {Promise<Models.Provider>}
1562
+ */
1563
+ async getProvider(providerId) {
1564
+ if (typeof providerId === 'undefined') {
1565
+ throw new AppcondaException('Missing required parameter: "providerId"');
1566
+ }
1567
+ const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1568
+ const payload = {};
1569
+ const uri = new URL(this.client.config.endpoint + apiPath);
1570
+ const apiHeaders = {
1571
+ 'content-type': 'application/json',
1572
+ };
1573
+ return await this.client.call('get', uri, apiHeaders, payload);
1574
+ }
1575
+ /**
1576
+ * Delete provider
1577
+ *
1578
+ * Delete a provider by its unique ID.
1579
+ *
1580
+ * @param {string} providerId
1581
+ * @throws {AppcondaException}
1582
+ * @returns {Promise<{}>}
1583
+ */
1584
+ async deleteProvider(providerId) {
1585
+ if (typeof providerId === 'undefined') {
1586
+ throw new AppcondaException('Missing required parameter: "providerId"');
1587
+ }
1588
+ const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1589
+ const payload = {};
1590
+ const uri = new URL(this.client.config.endpoint + apiPath);
1591
+ const apiHeaders = {
1592
+ 'content-type': 'application/json',
1593
+ };
1594
+ return await this.client.call('delete', uri, apiHeaders, payload);
1595
+ }
1596
+ /**
1597
+ * List provider logs
1598
+ *
1599
+ * Get the provider activity logs listed by its unique ID.
1600
+ *
1601
+ * @param {string} providerId
1602
+ * @param {string[]} queries
1603
+ * @throws {AppcondaException}
1604
+ * @returns {Promise<Models.LogList>}
1605
+ */
1606
+ async listProviderLogs(providerId, queries) {
1607
+ if (typeof providerId === 'undefined') {
1608
+ throw new AppcondaException('Missing required parameter: "providerId"');
1609
+ }
1610
+ const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
1611
+ const payload = {};
1612
+ if (typeof queries !== 'undefined') {
1613
+ payload['queries'] = queries;
1614
+ }
1615
+ const uri = new URL(this.client.config.endpoint + apiPath);
1616
+ const apiHeaders = {
1617
+ 'content-type': 'application/json',
1618
+ };
1619
+ return await this.client.call('get', uri, apiHeaders, payload);
1620
+ }
1621
+ /**
1622
+ * List subscriber logs
1623
+ *
1624
+ * Get the subscriber activity logs listed by its unique ID.
1625
+ *
1626
+ * @param {string} subscriberId
1627
+ * @param {string[]} queries
1628
+ * @throws {AppcondaException}
1629
+ * @returns {Promise<Models.LogList>}
1630
+ */
1631
+ async listSubscriberLogs(subscriberId, queries) {
1632
+ if (typeof subscriberId === 'undefined') {
1633
+ throw new AppcondaException('Missing required parameter: "subscriberId"');
1634
+ }
1635
+ const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
1636
+ const payload = {};
1637
+ if (typeof queries !== 'undefined') {
1638
+ payload['queries'] = queries;
1639
+ }
1640
+ const uri = new URL(this.client.config.endpoint + apiPath);
1641
+ const apiHeaders = {
1642
+ 'content-type': 'application/json',
1643
+ };
1644
+ return await this.client.call('get', uri, apiHeaders, payload);
1645
+ }
1646
+ /**
1647
+ * List topics
1648
+ *
1649
+ * Get a list of all topics from the current Appconda project.
1650
+ *
1651
+ * @param {string[]} queries
1652
+ * @param {string} search
1653
+ * @throws {AppcondaException}
1654
+ * @returns {Promise<Models.TopicList>}
1655
+ */
1656
+ async listTopics(queries, search) {
1657
+ const apiPath = '/messaging/topics';
1658
+ const payload = {};
1659
+ if (typeof queries !== 'undefined') {
1660
+ payload['queries'] = queries;
1661
+ }
1662
+ if (typeof search !== 'undefined') {
1663
+ payload['search'] = search;
1664
+ }
1665
+ const uri = new URL(this.client.config.endpoint + apiPath);
1666
+ const apiHeaders = {
1667
+ 'content-type': 'application/json',
1668
+ };
1669
+ return await this.client.call('get', uri, apiHeaders, payload);
1670
+ }
1671
+ /**
1672
+ * Create topic
1673
+ *
1674
+ * Create a new topic.
1675
+ *
1676
+ * @param {string} topicId
1677
+ * @param {string} name
1678
+ * @param {string[]} subscribe
1679
+ * @throws {AppcondaException}
1680
+ * @returns {Promise<Models.Topic>}
1681
+ */
1682
+ async createTopic(topicId, name, subscribe) {
1683
+ if (typeof topicId === 'undefined') {
1684
+ throw new AppcondaException('Missing required parameter: "topicId"');
1685
+ }
1686
+ if (typeof name === 'undefined') {
1687
+ throw new AppcondaException('Missing required parameter: "name"');
1688
+ }
1689
+ const apiPath = '/messaging/topics';
1690
+ const payload = {};
1691
+ if (typeof topicId !== 'undefined') {
1692
+ payload['topicId'] = topicId;
1693
+ }
1694
+ if (typeof name !== 'undefined') {
1695
+ payload['name'] = name;
1696
+ }
1697
+ if (typeof subscribe !== 'undefined') {
1698
+ payload['subscribe'] = subscribe;
1699
+ }
1700
+ const uri = new URL(this.client.config.endpoint + apiPath);
1701
+ const apiHeaders = {
1702
+ 'content-type': 'application/json',
1703
+ };
1704
+ return await this.client.call('post', uri, apiHeaders, payload);
1705
+ }
1706
+ /**
1707
+ * Get topic
1708
+ *
1709
+ * Get a topic by its unique ID.
1710
+
1711
+ *
1712
+ * @param {string} topicId
1713
+ * @throws {AppcondaException}
1714
+ * @returns {Promise<Models.Topic>}
1715
+ */
1716
+ async getTopic(topicId) {
1717
+ if (typeof topicId === 'undefined') {
1718
+ throw new AppcondaException('Missing required parameter: "topicId"');
1719
+ }
1720
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
1721
+ const payload = {};
1722
+ const uri = new URL(this.client.config.endpoint + apiPath);
1723
+ const apiHeaders = {
1724
+ 'content-type': 'application/json',
1725
+ };
1726
+ return await this.client.call('get', uri, apiHeaders, payload);
1727
+ }
1728
+ /**
1729
+ * Update topic
1730
+ *
1731
+ * Update a topic by its unique ID.
1732
+
1733
+ *
1734
+ * @param {string} topicId
1735
+ * @param {string} name
1736
+ * @param {string[]} subscribe
1737
+ * @throws {AppcondaException}
1738
+ * @returns {Promise<Models.Topic>}
1739
+ */
1740
+ async updateTopic(topicId, name, subscribe) {
1741
+ if (typeof topicId === 'undefined') {
1742
+ throw new AppcondaException('Missing required parameter: "topicId"');
1743
+ }
1744
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
1745
+ const payload = {};
1746
+ if (typeof name !== 'undefined') {
1747
+ payload['name'] = name;
1748
+ }
1749
+ if (typeof subscribe !== 'undefined') {
1750
+ payload['subscribe'] = subscribe;
1751
+ }
1752
+ const uri = new URL(this.client.config.endpoint + apiPath);
1753
+ const apiHeaders = {
1754
+ 'content-type': 'application/json',
1755
+ };
1756
+ return await this.client.call('patch', uri, apiHeaders, payload);
1757
+ }
1758
+ /**
1759
+ * Delete topic
1760
+ *
1761
+ * Delete a topic by its unique ID.
1762
+ *
1763
+ * @param {string} topicId
1764
+ * @throws {AppcondaException}
1765
+ * @returns {Promise<{}>}
1766
+ */
1767
+ async deleteTopic(topicId) {
1768
+ if (typeof topicId === 'undefined') {
1769
+ throw new AppcondaException('Missing required parameter: "topicId"');
1770
+ }
1771
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
1772
+ const payload = {};
1773
+ const uri = new URL(this.client.config.endpoint + apiPath);
1774
+ const apiHeaders = {
1775
+ 'content-type': 'application/json',
1776
+ };
1777
+ return await this.client.call('delete', uri, apiHeaders, payload);
1778
+ }
1779
+ /**
1780
+ * List topic logs
1781
+ *
1782
+ * Get the topic activity logs listed by its unique ID.
1783
+ *
1784
+ * @param {string} topicId
1785
+ * @param {string[]} queries
1786
+ * @throws {AppcondaException}
1787
+ * @returns {Promise<Models.LogList>}
1788
+ */
1789
+ async listTopicLogs(topicId, queries) {
1790
+ if (typeof topicId === 'undefined') {
1791
+ throw new AppcondaException('Missing required parameter: "topicId"');
1792
+ }
1793
+ const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
1794
+ const payload = {};
1795
+ if (typeof queries !== 'undefined') {
1796
+ payload['queries'] = queries;
1797
+ }
1798
+ const uri = new URL(this.client.config.endpoint + apiPath);
1799
+ const apiHeaders = {
1800
+ 'content-type': 'application/json',
1801
+ };
1802
+ return await this.client.call('get', uri, apiHeaders, payload);
1803
+ }
1804
+ /**
1805
+ * List subscribers
1806
+ *
1807
+ * Get a list of all subscribers from the current Appconda project.
1808
+ *
1809
+ * @param {string} topicId
1810
+ * @param {string[]} queries
1811
+ * @param {string} search
1812
+ * @throws {AppcondaException}
1813
+ * @returns {Promise<Models.SubscriberList>}
1814
+ */
1815
+ async listSubscribers(topicId, queries, search) {
1816
+ if (typeof topicId === 'undefined') {
1817
+ throw new AppcondaException('Missing required parameter: "topicId"');
1818
+ }
1819
+ const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
1820
+ const payload = {};
1821
+ if (typeof queries !== 'undefined') {
1822
+ payload['queries'] = queries;
1823
+ }
1824
+ if (typeof search !== 'undefined') {
1825
+ payload['search'] = search;
1826
+ }
1827
+ const uri = new URL(this.client.config.endpoint + apiPath);
1828
+ const apiHeaders = {
1829
+ 'content-type': 'application/json',
1830
+ };
1831
+ return await this.client.call('get', uri, apiHeaders, payload);
1832
+ }
1833
+ /**
1834
+ * Create subscriber
1835
+ *
1836
+ * Create a new subscriber.
1837
+ *
1838
+ * @param {string} topicId
1839
+ * @param {string} subscriberId
1840
+ * @param {string} targetId
1841
+ * @throws {AppcondaException}
1842
+ * @returns {Promise<Models.Subscriber>}
1843
+ */
1844
+ async createSubscriber(topicId, subscriberId, targetId) {
1845
+ if (typeof topicId === 'undefined') {
1846
+ throw new AppcondaException('Missing required parameter: "topicId"');
1847
+ }
1848
+ if (typeof subscriberId === 'undefined') {
1849
+ throw new AppcondaException('Missing required parameter: "subscriberId"');
1850
+ }
1851
+ if (typeof targetId === 'undefined') {
1852
+ throw new AppcondaException('Missing required parameter: "targetId"');
1853
+ }
1854
+ const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
1855
+ const payload = {};
1856
+ if (typeof subscriberId !== 'undefined') {
1857
+ payload['subscriberId'] = subscriberId;
1858
+ }
1859
+ if (typeof targetId !== 'undefined') {
1860
+ payload['targetId'] = targetId;
1861
+ }
1862
+ const uri = new URL(this.client.config.endpoint + apiPath);
1863
+ const apiHeaders = {
1864
+ 'content-type': 'application/json',
1865
+ };
1866
+ return await this.client.call('post', uri, apiHeaders, payload);
1867
+ }
1868
+ /**
1869
+ * Get subscriber
1870
+ *
1871
+ * Get a subscriber by its unique ID.
1872
+
1873
+ *
1874
+ * @param {string} topicId
1875
+ * @param {string} subscriberId
1876
+ * @throws {AppcondaException}
1877
+ * @returns {Promise<Models.Subscriber>}
1878
+ */
1879
+ async getSubscriber(topicId, subscriberId) {
1880
+ if (typeof topicId === 'undefined') {
1881
+ throw new AppcondaException('Missing required parameter: "topicId"');
1882
+ }
1883
+ if (typeof subscriberId === 'undefined') {
1884
+ throw new AppcondaException('Missing required parameter: "subscriberId"');
1885
+ }
1886
+ const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
1887
+ const payload = {};
1888
+ const uri = new URL(this.client.config.endpoint + apiPath);
1889
+ const apiHeaders = {
1890
+ 'content-type': 'application/json',
1891
+ };
1892
+ return await this.client.call('get', uri, apiHeaders, payload);
1893
+ }
1894
+ /**
1895
+ * Delete subscriber
1896
+ *
1897
+ * Delete a subscriber by its unique ID.
1898
+ *
1899
+ * @param {string} topicId
1900
+ * @param {string} subscriberId
1901
+ * @throws {AppcondaException}
1902
+ * @returns {Promise<{}>}
1903
+ */
1904
+ async deleteSubscriber(topicId, subscriberId) {
1905
+ if (typeof topicId === 'undefined') {
1906
+ throw new AppcondaException('Missing required parameter: "topicId"');
1907
+ }
1908
+ if (typeof subscriberId === 'undefined') {
1909
+ throw new AppcondaException('Missing required parameter: "subscriberId"');
1910
+ }
1911
+ const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
1912
+ const payload = {};
1913
+ const uri = new URL(this.client.config.endpoint + apiPath);
1914
+ const apiHeaders = {
1915
+ 'content-type': 'application/json',
1916
+ };
1917
+ return await this.client.call('delete', uri, apiHeaders, payload);
1918
+ }
1919
+ }