@revenexx/sdk 0.0.2

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 (182) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -0
  3. package/dist/cjs/package.json +3 -0
  4. package/dist/cjs/sdk.js +16340 -0
  5. package/dist/cjs/sdk.js.map +1 -0
  6. package/dist/esm/package.json +3 -0
  7. package/dist/esm/sdk.js +16250 -0
  8. package/dist/esm/sdk.js.map +1 -0
  9. package/dist/iife/sdk.js +20101 -0
  10. package/package.json +56 -0
  11. package/src/channel.ts +158 -0
  12. package/src/client.ts +950 -0
  13. package/src/enums/adapter.ts +4 -0
  14. package/src/enums/attribute-boolean-status.ts +7 -0
  15. package/src/enums/attribute-datetime-status.ts +7 -0
  16. package/src/enums/attribute-email-status.ts +7 -0
  17. package/src/enums/attribute-enum-status.ts +7 -0
  18. package/src/enums/attribute-float-status.ts +7 -0
  19. package/src/enums/attribute-integer-status.ts +7 -0
  20. package/src/enums/attribute-ip-status.ts +7 -0
  21. package/src/enums/attribute-line-status.ts +7 -0
  22. package/src/enums/attribute-longtext-status.ts +7 -0
  23. package/src/enums/attribute-mediumtext-status.ts +7 -0
  24. package/src/enums/attribute-point-status.ts +7 -0
  25. package/src/enums/attribute-polygon-status.ts +7 -0
  26. package/src/enums/attribute-relationship-status.ts +7 -0
  27. package/src/enums/attribute-string-status.ts +7 -0
  28. package/src/enums/attribute-text-status.ts +7 -0
  29. package/src/enums/attribute-url-status.ts +7 -0
  30. package/src/enums/attribute-varchar-status.ts +7 -0
  31. package/src/enums/build-runtime.ts +73 -0
  32. package/src/enums/code.ts +16 -0
  33. package/src/enums/collection.ts +4 -0
  34. package/src/enums/column-boolean-status.ts +7 -0
  35. package/src/enums/column-datetime-status.ts +7 -0
  36. package/src/enums/column-email-status.ts +7 -0
  37. package/src/enums/column-enum-status.ts +7 -0
  38. package/src/enums/column-float-status.ts +7 -0
  39. package/src/enums/column-integer-status.ts +7 -0
  40. package/src/enums/column-ip-status.ts +7 -0
  41. package/src/enums/column-line-status.ts +7 -0
  42. package/src/enums/column-longtext-status.ts +7 -0
  43. package/src/enums/column-mediumtext-status.ts +7 -0
  44. package/src/enums/column-point-status.ts +7 -0
  45. package/src/enums/column-polygon-status.ts +7 -0
  46. package/src/enums/column-relationship-status.ts +7 -0
  47. package/src/enums/column-string-status.ts +7 -0
  48. package/src/enums/column-text-status.ts +7 -0
  49. package/src/enums/column-url-status.ts +7 -0
  50. package/src/enums/column-varchar-status.ts +7 -0
  51. package/src/enums/compression.ts +5 -0
  52. package/src/enums/database-type.ts +4 -0
  53. package/src/enums/deployment-status.ts +8 -0
  54. package/src/enums/execution-status.ts +7 -0
  55. package/src/enums/execution-trigger.ts +5 -0
  56. package/src/enums/framework.ts +17 -0
  57. package/src/enums/gravity.ts +11 -0
  58. package/src/enums/health-antivirus-status.ts +5 -0
  59. package/src/enums/health-status-status.ts +4 -0
  60. package/src/enums/index-status.ts +7 -0
  61. package/src/enums/message-status.ts +7 -0
  62. package/src/enums/method.ts +9 -0
  63. package/src/enums/output.ts +9 -0
  64. package/src/enums/permissions.ts +22 -0
  65. package/src/enums/priority.ts +4 -0
  66. package/src/enums/range.ts +5 -0
  67. package/src/enums/runtime.ts +73 -0
  68. package/src/enums/runtimes.ts +73 -0
  69. package/src/enums/scopes.ts +57 -0
  70. package/src/enums/theme.ts +4 -0
  71. package/src/enums/timezone.ts +421 -0
  72. package/src/enums/type.ts +5 -0
  73. package/src/enums/use-cases.ts +9 -0
  74. package/src/id.ts +47 -0
  75. package/src/index.ts +92 -0
  76. package/src/models.ts +6013 -0
  77. package/src/operator.ts +308 -0
  78. package/src/permission.ts +57 -0
  79. package/src/query.ts +576 -0
  80. package/src/role.ts +100 -0
  81. package/src/service.ts +30 -0
  82. package/src/services/apps.ts +2473 -0
  83. package/src/services/avatars.ts +744 -0
  84. package/src/services/carts.ts +1057 -0
  85. package/src/services/channels.ts +227 -0
  86. package/src/services/customers.ts +729 -0
  87. package/src/services/greetings.ts +294 -0
  88. package/src/services/locale.ts +198 -0
  89. package/src/services/markets.ts +796 -0
  90. package/src/services/messaging.ts +3463 -0
  91. package/src/services/products.ts +3100 -0
  92. package/src/services/realtime.ts +537 -0
  93. package/src/services/search.ts +346 -0
  94. package/src/services/sites.ts +1847 -0
  95. package/src/services/storage.ts +1076 -0
  96. package/src/services/tokens.ts +314 -0
  97. package/types/channel.d.ts +74 -0
  98. package/types/client.d.ts +211 -0
  99. package/types/enums/adapter.d.ts +4 -0
  100. package/types/enums/attribute-boolean-status.d.ts +7 -0
  101. package/types/enums/attribute-datetime-status.d.ts +7 -0
  102. package/types/enums/attribute-email-status.d.ts +7 -0
  103. package/types/enums/attribute-enum-status.d.ts +7 -0
  104. package/types/enums/attribute-float-status.d.ts +7 -0
  105. package/types/enums/attribute-integer-status.d.ts +7 -0
  106. package/types/enums/attribute-ip-status.d.ts +7 -0
  107. package/types/enums/attribute-line-status.d.ts +7 -0
  108. package/types/enums/attribute-longtext-status.d.ts +7 -0
  109. package/types/enums/attribute-mediumtext-status.d.ts +7 -0
  110. package/types/enums/attribute-point-status.d.ts +7 -0
  111. package/types/enums/attribute-polygon-status.d.ts +7 -0
  112. package/types/enums/attribute-relationship-status.d.ts +7 -0
  113. package/types/enums/attribute-string-status.d.ts +7 -0
  114. package/types/enums/attribute-text-status.d.ts +7 -0
  115. package/types/enums/attribute-url-status.d.ts +7 -0
  116. package/types/enums/attribute-varchar-status.d.ts +7 -0
  117. package/types/enums/build-runtime.d.ts +73 -0
  118. package/types/enums/code.d.ts +16 -0
  119. package/types/enums/collection.d.ts +4 -0
  120. package/types/enums/column-boolean-status.d.ts +7 -0
  121. package/types/enums/column-datetime-status.d.ts +7 -0
  122. package/types/enums/column-email-status.d.ts +7 -0
  123. package/types/enums/column-enum-status.d.ts +7 -0
  124. package/types/enums/column-float-status.d.ts +7 -0
  125. package/types/enums/column-integer-status.d.ts +7 -0
  126. package/types/enums/column-ip-status.d.ts +7 -0
  127. package/types/enums/column-line-status.d.ts +7 -0
  128. package/types/enums/column-longtext-status.d.ts +7 -0
  129. package/types/enums/column-mediumtext-status.d.ts +7 -0
  130. package/types/enums/column-point-status.d.ts +7 -0
  131. package/types/enums/column-polygon-status.d.ts +7 -0
  132. package/types/enums/column-relationship-status.d.ts +7 -0
  133. package/types/enums/column-string-status.d.ts +7 -0
  134. package/types/enums/column-text-status.d.ts +7 -0
  135. package/types/enums/column-url-status.d.ts +7 -0
  136. package/types/enums/column-varchar-status.d.ts +7 -0
  137. package/types/enums/compression.d.ts +5 -0
  138. package/types/enums/database-type.d.ts +4 -0
  139. package/types/enums/deployment-status.d.ts +8 -0
  140. package/types/enums/execution-status.d.ts +7 -0
  141. package/types/enums/execution-trigger.d.ts +5 -0
  142. package/types/enums/framework.d.ts +17 -0
  143. package/types/enums/gravity.d.ts +11 -0
  144. package/types/enums/health-antivirus-status.d.ts +5 -0
  145. package/types/enums/health-status-status.d.ts +4 -0
  146. package/types/enums/index-status.d.ts +7 -0
  147. package/types/enums/message-status.d.ts +7 -0
  148. package/types/enums/method.d.ts +9 -0
  149. package/types/enums/output.d.ts +9 -0
  150. package/types/enums/permissions.d.ts +22 -0
  151. package/types/enums/priority.d.ts +4 -0
  152. package/types/enums/range.d.ts +5 -0
  153. package/types/enums/runtime.d.ts +73 -0
  154. package/types/enums/runtimes.d.ts +73 -0
  155. package/types/enums/scopes.d.ts +57 -0
  156. package/types/enums/theme.d.ts +4 -0
  157. package/types/enums/timezone.d.ts +421 -0
  158. package/types/enums/type.d.ts +5 -0
  159. package/types/enums/use-cases.d.ts +9 -0
  160. package/types/id.d.ts +20 -0
  161. package/types/index.d.ts +92 -0
  162. package/types/models.d.ts +5830 -0
  163. package/types/operator.d.ts +180 -0
  164. package/types/permission.d.ts +43 -0
  165. package/types/query.d.ts +442 -0
  166. package/types/role.d.ts +70 -0
  167. package/types/service.d.ts +11 -0
  168. package/types/services/apps.d.ts +932 -0
  169. package/types/services/avatars.d.ts +318 -0
  170. package/types/services/carts.d.ts +352 -0
  171. package/types/services/channels.d.ts +75 -0
  172. package/types/services/customers.d.ts +231 -0
  173. package/types/services/greetings.d.ts +101 -0
  174. package/types/services/locale.d.ts +64 -0
  175. package/types/services/markets.d.ts +274 -0
  176. package/types/services/messaging.d.ts +1324 -0
  177. package/types/services/products.d.ts +1014 -0
  178. package/types/services/realtime.d.ts +134 -0
  179. package/types/services/search.d.ts +131 -0
  180. package/types/services/sites.d.ts +689 -0
  181. package/types/services/storage.d.ts +421 -0
  182. package/types/services/tokens.d.ts +119 -0
@@ -0,0 +1,3463 @@
1
+ import { Service } from '../service';
2
+ import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+ import { Priority } from '../enums/priority';
6
+
7
+ export class Messaging {
8
+ client: Client;
9
+
10
+ constructor(client: Client) {
11
+ this.client = client;
12
+ }
13
+
14
+ /**
15
+ * Get a list of all messages from the current Revenexx project.
16
+ *
17
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
18
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
19
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
20
+ * @throws {RevenexxException}
21
+ * @returns {Promise<Models.MessageList>}
22
+ */
23
+ messagingListMessages(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.MessageList>;
24
+ /**
25
+ * Get a list of all messages from the current Revenexx project.
26
+ *
27
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
28
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
29
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
30
+ * @throws {RevenexxException}
31
+ * @returns {Promise<Models.MessageList>}
32
+ * @deprecated Use the object parameter style method for a better developer experience.
33
+ */
34
+ messagingListMessages(queries?: string[], search?: string, total?: boolean): Promise<Models.MessageList>;
35
+ messagingListMessages(
36
+ paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
37
+ ...rest: [(string)?, (boolean)?]
38
+ ): Promise<Models.MessageList> {
39
+ let params: { queries?: string[], search?: string, total?: boolean };
40
+
41
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
42
+ params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
43
+ } else {
44
+ params = {
45
+ queries: paramsOrFirst as string[],
46
+ search: rest[0] as string,
47
+ total: rest[1] as boolean
48
+ };
49
+ }
50
+
51
+ const queries = params.queries;
52
+ const search = params.search;
53
+ const total = params.total;
54
+
55
+
56
+ const apiPath = '/v1/messaging/messages';
57
+ const payload: Payload = {};
58
+ if (typeof queries !== 'undefined') {
59
+ payload['queries'] = queries;
60
+ }
61
+ if (typeof search !== 'undefined') {
62
+ payload['search'] = search;
63
+ }
64
+ if (typeof total !== 'undefined') {
65
+ payload['total'] = total;
66
+ }
67
+ const uri = new URL(this.client.config.endpoint + apiPath);
68
+
69
+ const apiHeaders: { [header: string]: string } = {
70
+ }
71
+
72
+ return this.client.call(
73
+ 'get',
74
+ uri,
75
+ apiHeaders,
76
+ payload
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Create a new email message.
82
+ *
83
+ * @param {string} params.content - Email Content.
84
+ * @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
85
+ * @param {string} params.subject - Email Subject.
86
+ * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
87
+ * @param {string[]} params.bcc - Array of target IDs to be added as BCC.
88
+ * @param {string[]} params.cc - Array of target IDs to be added as CC.
89
+ * @param {boolean} params.draft - Is message a draft
90
+ * @param {boolean} params.html - Is content of type HTML
91
+ * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
92
+ * @param {string[]} params.targets - List of Targets IDs.
93
+ * @param {string[]} params.topics - List of Topic IDs.
94
+ * @param {string[]} params.users - List of User IDs.
95
+ * @throws {RevenexxException}
96
+ * @returns {Promise<Models.Message>}
97
+ */
98
+ messagingCreateEmail(params: { content: string, messageId: string, subject: string, attachments?: string[], bcc?: string[], cc?: string[], draft?: boolean, html?: boolean, scheduledAt?: string, targets?: string[], topics?: string[], users?: string[] }): Promise<Models.Message>;
99
+ /**
100
+ * Create a new email message.
101
+ *
102
+ * @param {string} content - Email Content.
103
+ * @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
104
+ * @param {string} subject - Email Subject.
105
+ * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
106
+ * @param {string[]} bcc - Array of target IDs to be added as BCC.
107
+ * @param {string[]} cc - Array of target IDs to be added as CC.
108
+ * @param {boolean} draft - Is message a draft
109
+ * @param {boolean} html - Is content of type HTML
110
+ * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
111
+ * @param {string[]} targets - List of Targets IDs.
112
+ * @param {string[]} topics - List of Topic IDs.
113
+ * @param {string[]} users - List of User IDs.
114
+ * @throws {RevenexxException}
115
+ * @returns {Promise<Models.Message>}
116
+ * @deprecated Use the object parameter style method for a better developer experience.
117
+ */
118
+ messagingCreateEmail(content: string, messageId: string, subject: string, attachments?: string[], bcc?: string[], cc?: string[], draft?: boolean, html?: boolean, scheduledAt?: string, targets?: string[], topics?: string[], users?: string[]): Promise<Models.Message>;
119
+ messagingCreateEmail(
120
+ paramsOrFirst: { content: string, messageId: string, subject: string, attachments?: string[], bcc?: string[], cc?: string[], draft?: boolean, html?: boolean, scheduledAt?: string, targets?: string[], topics?: string[], users?: string[] } | string,
121
+ ...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (boolean)?, (boolean)?, (string)?, (string[])?, (string[])?, (string[])?]
122
+ ): Promise<Models.Message> {
123
+ let params: { content: string, messageId: string, subject: string, attachments?: string[], bcc?: string[], cc?: string[], draft?: boolean, html?: boolean, scheduledAt?: string, targets?: string[], topics?: string[], users?: string[] };
124
+
125
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
126
+ params = (paramsOrFirst || {}) as { content: string, messageId: string, subject: string, attachments?: string[], bcc?: string[], cc?: string[], draft?: boolean, html?: boolean, scheduledAt?: string, targets?: string[], topics?: string[], users?: string[] };
127
+ } else {
128
+ params = {
129
+ content: paramsOrFirst as string,
130
+ messageId: rest[0] as string,
131
+ subject: rest[1] as string,
132
+ attachments: rest[2] as string[],
133
+ bcc: rest[3] as string[],
134
+ cc: rest[4] as string[],
135
+ draft: rest[5] as boolean,
136
+ html: rest[6] as boolean,
137
+ scheduledAt: rest[7] as string,
138
+ targets: rest[8] as string[],
139
+ topics: rest[9] as string[],
140
+ users: rest[10] as string[]
141
+ };
142
+ }
143
+
144
+ const content = params.content;
145
+ const messageId = params.messageId;
146
+ const subject = params.subject;
147
+ const attachments = params.attachments;
148
+ const bcc = params.bcc;
149
+ const cc = params.cc;
150
+ const draft = params.draft;
151
+ const html = params.html;
152
+ const scheduledAt = params.scheduledAt;
153
+ const targets = params.targets;
154
+ const topics = params.topics;
155
+ const users = params.users;
156
+
157
+ if (typeof content === 'undefined') {
158
+ throw new RevenexxException('Missing required parameter: "content"');
159
+ }
160
+ if (typeof messageId === 'undefined') {
161
+ throw new RevenexxException('Missing required parameter: "messageId"');
162
+ }
163
+ if (typeof subject === 'undefined') {
164
+ throw new RevenexxException('Missing required parameter: "subject"');
165
+ }
166
+
167
+ const apiPath = '/v1/messaging/messages/email';
168
+ const payload: Payload = {};
169
+ if (typeof attachments !== 'undefined') {
170
+ payload['attachments'] = attachments;
171
+ }
172
+ if (typeof bcc !== 'undefined') {
173
+ payload['bcc'] = bcc;
174
+ }
175
+ if (typeof cc !== 'undefined') {
176
+ payload['cc'] = cc;
177
+ }
178
+ if (typeof content !== 'undefined') {
179
+ payload['content'] = content;
180
+ }
181
+ if (typeof draft !== 'undefined') {
182
+ payload['draft'] = draft;
183
+ }
184
+ if (typeof html !== 'undefined') {
185
+ payload['html'] = html;
186
+ }
187
+ if (typeof messageId !== 'undefined') {
188
+ payload['messageId'] = messageId;
189
+ }
190
+ if (typeof scheduledAt !== 'undefined') {
191
+ payload['scheduledAt'] = scheduledAt;
192
+ }
193
+ if (typeof subject !== 'undefined') {
194
+ payload['subject'] = subject;
195
+ }
196
+ if (typeof targets !== 'undefined') {
197
+ payload['targets'] = targets;
198
+ }
199
+ if (typeof topics !== 'undefined') {
200
+ payload['topics'] = topics;
201
+ }
202
+ if (typeof users !== 'undefined') {
203
+ payload['users'] = users;
204
+ }
205
+ const uri = new URL(this.client.config.endpoint + apiPath);
206
+
207
+ const apiHeaders: { [header: string]: string } = {
208
+ 'content-type': 'application/json',
209
+ }
210
+
211
+ return this.client.call(
212
+ 'post',
213
+ uri,
214
+ apiHeaders,
215
+ payload
216
+ );
217
+ }
218
+
219
+ /**
220
+ * Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
221
+ *
222
+ *
223
+ * @param {string} params.messageId - Message ID.
224
+ * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
225
+ * @param {string[]} params.bcc - Array of target IDs to be added as BCC.
226
+ * @param {string[]} params.cc - Array of target IDs to be added as CC.
227
+ * @param {string} params.content - Email Content.
228
+ * @param {boolean} params.draft - Is message a draft
229
+ * @param {boolean} params.html - Is content of type HTML
230
+ * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
231
+ * @param {string} params.subject - Email Subject.
232
+ * @param {string[]} params.targets - List of Targets IDs.
233
+ * @param {string[]} params.topics - List of Topic IDs.
234
+ * @param {string[]} params.users - List of User IDs.
235
+ * @throws {RevenexxException}
236
+ * @returns {Promise<Models.Message>}
237
+ */
238
+ messagingUpdateEmail(params: { messageId: string, attachments?: string[], bcc?: string[], cc?: string[], content?: string, draft?: boolean, html?: boolean, scheduledAt?: string, subject?: string, targets?: string[], topics?: string[], users?: string[] }): Promise<Models.Message>;
239
+ /**
240
+ * Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
241
+ *
242
+ *
243
+ * @param {string} messageId - Message ID.
244
+ * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
245
+ * @param {string[]} bcc - Array of target IDs to be added as BCC.
246
+ * @param {string[]} cc - Array of target IDs to be added as CC.
247
+ * @param {string} content - Email Content.
248
+ * @param {boolean} draft - Is message a draft
249
+ * @param {boolean} html - Is content of type HTML
250
+ * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
251
+ * @param {string} subject - Email Subject.
252
+ * @param {string[]} targets - List of Targets IDs.
253
+ * @param {string[]} topics - List of Topic IDs.
254
+ * @param {string[]} users - List of User IDs.
255
+ * @throws {RevenexxException}
256
+ * @returns {Promise<Models.Message>}
257
+ * @deprecated Use the object parameter style method for a better developer experience.
258
+ */
259
+ messagingUpdateEmail(messageId: string, attachments?: string[], bcc?: string[], cc?: string[], content?: string, draft?: boolean, html?: boolean, scheduledAt?: string, subject?: string, targets?: string[], topics?: string[], users?: string[]): Promise<Models.Message>;
260
+ messagingUpdateEmail(
261
+ paramsOrFirst: { messageId: string, attachments?: string[], bcc?: string[], cc?: string[], content?: string, draft?: boolean, html?: boolean, scheduledAt?: string, subject?: string, targets?: string[], topics?: string[], users?: string[] } | string,
262
+ ...rest: [(string[])?, (string[])?, (string[])?, (string)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string[])?, (string[])?]
263
+ ): Promise<Models.Message> {
264
+ let params: { messageId: string, attachments?: string[], bcc?: string[], cc?: string[], content?: string, draft?: boolean, html?: boolean, scheduledAt?: string, subject?: string, targets?: string[], topics?: string[], users?: string[] };
265
+
266
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
267
+ params = (paramsOrFirst || {}) as { messageId: string, attachments?: string[], bcc?: string[], cc?: string[], content?: string, draft?: boolean, html?: boolean, scheduledAt?: string, subject?: string, targets?: string[], topics?: string[], users?: string[] };
268
+ } else {
269
+ params = {
270
+ messageId: paramsOrFirst as string,
271
+ attachments: rest[0] as string[],
272
+ bcc: rest[1] as string[],
273
+ cc: rest[2] as string[],
274
+ content: rest[3] as string,
275
+ draft: rest[4] as boolean,
276
+ html: rest[5] as boolean,
277
+ scheduledAt: rest[6] as string,
278
+ subject: rest[7] as string,
279
+ targets: rest[8] as string[],
280
+ topics: rest[9] as string[],
281
+ users: rest[10] as string[]
282
+ };
283
+ }
284
+
285
+ const messageId = params.messageId;
286
+ const attachments = params.attachments;
287
+ const bcc = params.bcc;
288
+ const cc = params.cc;
289
+ const content = params.content;
290
+ const draft = params.draft;
291
+ const html = params.html;
292
+ const scheduledAt = params.scheduledAt;
293
+ const subject = params.subject;
294
+ const targets = params.targets;
295
+ const topics = params.topics;
296
+ const users = params.users;
297
+
298
+ if (typeof messageId === 'undefined') {
299
+ throw new RevenexxException('Missing required parameter: "messageId"');
300
+ }
301
+
302
+ const apiPath = '/v1/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
303
+ const payload: Payload = {};
304
+ if (typeof attachments !== 'undefined') {
305
+ payload['attachments'] = attachments;
306
+ }
307
+ if (typeof bcc !== 'undefined') {
308
+ payload['bcc'] = bcc;
309
+ }
310
+ if (typeof cc !== 'undefined') {
311
+ payload['cc'] = cc;
312
+ }
313
+ if (typeof content !== 'undefined') {
314
+ payload['content'] = content;
315
+ }
316
+ if (typeof draft !== 'undefined') {
317
+ payload['draft'] = draft;
318
+ }
319
+ if (typeof html !== 'undefined') {
320
+ payload['html'] = html;
321
+ }
322
+ if (typeof scheduledAt !== 'undefined') {
323
+ payload['scheduledAt'] = scheduledAt;
324
+ }
325
+ if (typeof subject !== 'undefined') {
326
+ payload['subject'] = subject;
327
+ }
328
+ if (typeof targets !== 'undefined') {
329
+ payload['targets'] = targets;
330
+ }
331
+ if (typeof topics !== 'undefined') {
332
+ payload['topics'] = topics;
333
+ }
334
+ if (typeof users !== 'undefined') {
335
+ payload['users'] = users;
336
+ }
337
+ const uri = new URL(this.client.config.endpoint + apiPath);
338
+
339
+ const apiHeaders: { [header: string]: string } = {
340
+ 'content-type': 'application/json',
341
+ }
342
+
343
+ return this.client.call(
344
+ 'patch',
345
+ uri,
346
+ apiHeaders,
347
+ payload
348
+ );
349
+ }
350
+
351
+ /**
352
+ * Create a new push notification.
353
+ *
354
+ * @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
355
+ * @param {string} params.action - Action for push notification.
356
+ * @param {number} params.badge - Badge for push notification. Available only for iOS Platform.
357
+ * @param {string} params.body - Body for push notification.
358
+ * @param {string} params.color - Color for push notification. Available only for Android Platform.
359
+ * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
360
+ * @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
361
+ * @param {object} params.data - Additional key-value pair data for push notification.
362
+ * @param {boolean} params.draft - Is message a draft
363
+ * @param {string} params.icon - Icon for push notification. Available only for Android and Web Platform.
364
+ * @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
365
+ * @param {Priority} params.priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
366
+ * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
367
+ * @param {string} params.sound - Sound for push notification. Available only for Android and iOS Platform.
368
+ * @param {string} params.tag - Tag for push notification. Available only for Android Platform.
369
+ * @param {string[]} params.targets - List of Targets IDs.
370
+ * @param {string} params.title - Title for push notification.
371
+ * @param {string[]} params.topics - List of Topic IDs.
372
+ * @param {string[]} params.users - List of User IDs.
373
+ * @throws {RevenexxException}
374
+ * @returns {Promise<Models.Message>}
375
+ */
376
+ messagingCreatePush(params: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] }): Promise<Models.Message>;
377
+ /**
378
+ * Create a new push notification.
379
+ *
380
+ * @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
381
+ * @param {string} action - Action for push notification.
382
+ * @param {number} badge - Badge for push notification. Available only for iOS Platform.
383
+ * @param {string} body - Body for push notification.
384
+ * @param {string} color - Color for push notification. Available only for Android Platform.
385
+ * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
386
+ * @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
387
+ * @param {object} data - Additional key-value pair data for push notification.
388
+ * @param {boolean} draft - Is message a draft
389
+ * @param {string} icon - Icon for push notification. Available only for Android and Web Platform.
390
+ * @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
391
+ * @param {Priority} priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
392
+ * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
393
+ * @param {string} sound - Sound for push notification. Available only for Android and iOS Platform.
394
+ * @param {string} tag - Tag for push notification. Available only for Android Platform.
395
+ * @param {string[]} targets - List of Targets IDs.
396
+ * @param {string} title - Title for push notification.
397
+ * @param {string[]} topics - List of Topic IDs.
398
+ * @param {string[]} users - List of User IDs.
399
+ * @throws {RevenexxException}
400
+ * @returns {Promise<Models.Message>}
401
+ * @deprecated Use the object parameter style method for a better developer experience.
402
+ */
403
+ messagingCreatePush(messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[]): Promise<Models.Message>;
404
+ messagingCreatePush(
405
+ paramsOrFirst: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] } | string,
406
+ ...rest: [(string)?, (number)?, (string)?, (string)?, (boolean)?, (boolean)?, (object)?, (boolean)?, (string)?, (string)?, (Priority)?, (string)?, (string)?, (string)?, (string[])?, (string)?, (string[])?, (string[])?]
407
+ ): Promise<Models.Message> {
408
+ let params: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] };
409
+
410
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
411
+ params = (paramsOrFirst || {}) as { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] };
412
+ } else {
413
+ params = {
414
+ messageId: paramsOrFirst as string,
415
+ action: rest[0] as string,
416
+ badge: rest[1] as number,
417
+ body: rest[2] as string,
418
+ color: rest[3] as string,
419
+ contentAvailable: rest[4] as boolean,
420
+ critical: rest[5] as boolean,
421
+ data: rest[6] as object,
422
+ draft: rest[7] as boolean,
423
+ icon: rest[8] as string,
424
+ image: rest[9] as string,
425
+ priority: rest[10] as Priority,
426
+ scheduledAt: rest[11] as string,
427
+ sound: rest[12] as string,
428
+ tag: rest[13] as string,
429
+ targets: rest[14] as string[],
430
+ title: rest[15] as string,
431
+ topics: rest[16] as string[],
432
+ users: rest[17] as string[]
433
+ };
434
+ }
435
+
436
+ const messageId = params.messageId;
437
+ const action = params.action;
438
+ const badge = params.badge;
439
+ const body = params.body;
440
+ const color = params.color;
441
+ const contentAvailable = params.contentAvailable;
442
+ const critical = params.critical;
443
+ const data = params.data;
444
+ const draft = params.draft;
445
+ const icon = params.icon;
446
+ const image = params.image;
447
+ const priority = params.priority;
448
+ const scheduledAt = params.scheduledAt;
449
+ const sound = params.sound;
450
+ const tag = params.tag;
451
+ const targets = params.targets;
452
+ const title = params.title;
453
+ const topics = params.topics;
454
+ const users = params.users;
455
+
456
+ if (typeof messageId === 'undefined') {
457
+ throw new RevenexxException('Missing required parameter: "messageId"');
458
+ }
459
+
460
+ const apiPath = '/v1/messaging/messages/push';
461
+ const payload: Payload = {};
462
+ if (typeof action !== 'undefined') {
463
+ payload['action'] = action;
464
+ }
465
+ if (typeof badge !== 'undefined') {
466
+ payload['badge'] = badge;
467
+ }
468
+ if (typeof body !== 'undefined') {
469
+ payload['body'] = body;
470
+ }
471
+ if (typeof color !== 'undefined') {
472
+ payload['color'] = color;
473
+ }
474
+ if (typeof contentAvailable !== 'undefined') {
475
+ payload['contentAvailable'] = contentAvailable;
476
+ }
477
+ if (typeof critical !== 'undefined') {
478
+ payload['critical'] = critical;
479
+ }
480
+ if (typeof data !== 'undefined') {
481
+ payload['data'] = data;
482
+ }
483
+ if (typeof draft !== 'undefined') {
484
+ payload['draft'] = draft;
485
+ }
486
+ if (typeof icon !== 'undefined') {
487
+ payload['icon'] = icon;
488
+ }
489
+ if (typeof image !== 'undefined') {
490
+ payload['image'] = image;
491
+ }
492
+ if (typeof messageId !== 'undefined') {
493
+ payload['messageId'] = messageId;
494
+ }
495
+ if (typeof priority !== 'undefined') {
496
+ payload['priority'] = priority;
497
+ }
498
+ if (typeof scheduledAt !== 'undefined') {
499
+ payload['scheduledAt'] = scheduledAt;
500
+ }
501
+ if (typeof sound !== 'undefined') {
502
+ payload['sound'] = sound;
503
+ }
504
+ if (typeof tag !== 'undefined') {
505
+ payload['tag'] = tag;
506
+ }
507
+ if (typeof targets !== 'undefined') {
508
+ payload['targets'] = targets;
509
+ }
510
+ if (typeof title !== 'undefined') {
511
+ payload['title'] = title;
512
+ }
513
+ if (typeof topics !== 'undefined') {
514
+ payload['topics'] = topics;
515
+ }
516
+ if (typeof users !== 'undefined') {
517
+ payload['users'] = users;
518
+ }
519
+ const uri = new URL(this.client.config.endpoint + apiPath);
520
+
521
+ const apiHeaders: { [header: string]: string } = {
522
+ 'content-type': 'application/json',
523
+ }
524
+
525
+ return this.client.call(
526
+ 'post',
527
+ uri,
528
+ apiHeaders,
529
+ payload
530
+ );
531
+ }
532
+
533
+ /**
534
+ * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
535
+ *
536
+ *
537
+ * @param {string} params.messageId - Message ID.
538
+ * @param {string} params.action - Action for push notification.
539
+ * @param {number} params.badge - Badge for push notification. Available only for iOS platforms.
540
+ * @param {string} params.body - Body for push notification.
541
+ * @param {string} params.color - Color for push notification. Available only for Android platforms.
542
+ * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
543
+ * @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
544
+ * @param {object} params.data - Additional Data for push notification.
545
+ * @param {boolean} params.draft - Is message a draft
546
+ * @param {string} params.icon - Icon for push notification. Available only for Android and Web platforms.
547
+ * @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
548
+ * @param {Priority} params.priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
549
+ * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
550
+ * @param {string} params.sound - Sound for push notification. Available only for Android and iOS platforms.
551
+ * @param {string} params.tag - Tag for push notification. Available only for Android platforms.
552
+ * @param {string[]} params.targets - List of Targets IDs.
553
+ * @param {string} params.title - Title for push notification.
554
+ * @param {string[]} params.topics - List of Topic IDs.
555
+ * @param {string[]} params.users - List of User IDs.
556
+ * @throws {RevenexxException}
557
+ * @returns {Promise<Models.Message>}
558
+ */
559
+ messagingUpdatePush(params: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] }): Promise<Models.Message>;
560
+ /**
561
+ * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
562
+ *
563
+ *
564
+ * @param {string} messageId - Message ID.
565
+ * @param {string} action - Action for push notification.
566
+ * @param {number} badge - Badge for push notification. Available only for iOS platforms.
567
+ * @param {string} body - Body for push notification.
568
+ * @param {string} color - Color for push notification. Available only for Android platforms.
569
+ * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
570
+ * @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
571
+ * @param {object} data - Additional Data for push notification.
572
+ * @param {boolean} draft - Is message a draft
573
+ * @param {string} icon - Icon for push notification. Available only for Android and Web platforms.
574
+ * @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
575
+ * @param {Priority} priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
576
+ * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
577
+ * @param {string} sound - Sound for push notification. Available only for Android and iOS platforms.
578
+ * @param {string} tag - Tag for push notification. Available only for Android platforms.
579
+ * @param {string[]} targets - List of Targets IDs.
580
+ * @param {string} title - Title for push notification.
581
+ * @param {string[]} topics - List of Topic IDs.
582
+ * @param {string[]} users - List of User IDs.
583
+ * @throws {RevenexxException}
584
+ * @returns {Promise<Models.Message>}
585
+ * @deprecated Use the object parameter style method for a better developer experience.
586
+ */
587
+ messagingUpdatePush(messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[]): Promise<Models.Message>;
588
+ messagingUpdatePush(
589
+ paramsOrFirst: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] } | string,
590
+ ...rest: [(string)?, (number)?, (string)?, (string)?, (boolean)?, (boolean)?, (object)?, (boolean)?, (string)?, (string)?, (Priority)?, (string)?, (string)?, (string)?, (string[])?, (string)?, (string[])?, (string[])?]
591
+ ): Promise<Models.Message> {
592
+ let params: { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] };
593
+
594
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
595
+ params = (paramsOrFirst || {}) as { messageId: string, action?: string, badge?: number, body?: string, color?: string, contentAvailable?: boolean, critical?: boolean, data?: object, draft?: boolean, icon?: string, image?: string, priority?: Priority, scheduledAt?: string, sound?: string, tag?: string, targets?: string[], title?: string, topics?: string[], users?: string[] };
596
+ } else {
597
+ params = {
598
+ messageId: paramsOrFirst as string,
599
+ action: rest[0] as string,
600
+ badge: rest[1] as number,
601
+ body: rest[2] as string,
602
+ color: rest[3] as string,
603
+ contentAvailable: rest[4] as boolean,
604
+ critical: rest[5] as boolean,
605
+ data: rest[6] as object,
606
+ draft: rest[7] as boolean,
607
+ icon: rest[8] as string,
608
+ image: rest[9] as string,
609
+ priority: rest[10] as Priority,
610
+ scheduledAt: rest[11] as string,
611
+ sound: rest[12] as string,
612
+ tag: rest[13] as string,
613
+ targets: rest[14] as string[],
614
+ title: rest[15] as string,
615
+ topics: rest[16] as string[],
616
+ users: rest[17] as string[]
617
+ };
618
+ }
619
+
620
+ const messageId = params.messageId;
621
+ const action = params.action;
622
+ const badge = params.badge;
623
+ const body = params.body;
624
+ const color = params.color;
625
+ const contentAvailable = params.contentAvailable;
626
+ const critical = params.critical;
627
+ const data = params.data;
628
+ const draft = params.draft;
629
+ const icon = params.icon;
630
+ const image = params.image;
631
+ const priority = params.priority;
632
+ const scheduledAt = params.scheduledAt;
633
+ const sound = params.sound;
634
+ const tag = params.tag;
635
+ const targets = params.targets;
636
+ const title = params.title;
637
+ const topics = params.topics;
638
+ const users = params.users;
639
+
640
+ if (typeof messageId === 'undefined') {
641
+ throw new RevenexxException('Missing required parameter: "messageId"');
642
+ }
643
+
644
+ const apiPath = '/v1/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
645
+ const payload: Payload = {};
646
+ if (typeof action !== 'undefined') {
647
+ payload['action'] = action;
648
+ }
649
+ if (typeof badge !== 'undefined') {
650
+ payload['badge'] = badge;
651
+ }
652
+ if (typeof body !== 'undefined') {
653
+ payload['body'] = body;
654
+ }
655
+ if (typeof color !== 'undefined') {
656
+ payload['color'] = color;
657
+ }
658
+ if (typeof contentAvailable !== 'undefined') {
659
+ payload['contentAvailable'] = contentAvailable;
660
+ }
661
+ if (typeof critical !== 'undefined') {
662
+ payload['critical'] = critical;
663
+ }
664
+ if (typeof data !== 'undefined') {
665
+ payload['data'] = data;
666
+ }
667
+ if (typeof draft !== 'undefined') {
668
+ payload['draft'] = draft;
669
+ }
670
+ if (typeof icon !== 'undefined') {
671
+ payload['icon'] = icon;
672
+ }
673
+ if (typeof image !== 'undefined') {
674
+ payload['image'] = image;
675
+ }
676
+ if (typeof priority !== 'undefined') {
677
+ payload['priority'] = priority;
678
+ }
679
+ if (typeof scheduledAt !== 'undefined') {
680
+ payload['scheduledAt'] = scheduledAt;
681
+ }
682
+ if (typeof sound !== 'undefined') {
683
+ payload['sound'] = sound;
684
+ }
685
+ if (typeof tag !== 'undefined') {
686
+ payload['tag'] = tag;
687
+ }
688
+ if (typeof targets !== 'undefined') {
689
+ payload['targets'] = targets;
690
+ }
691
+ if (typeof title !== 'undefined') {
692
+ payload['title'] = title;
693
+ }
694
+ if (typeof topics !== 'undefined') {
695
+ payload['topics'] = topics;
696
+ }
697
+ if (typeof users !== 'undefined') {
698
+ payload['users'] = users;
699
+ }
700
+ const uri = new URL(this.client.config.endpoint + apiPath);
701
+
702
+ const apiHeaders: { [header: string]: string } = {
703
+ 'content-type': 'application/json',
704
+ }
705
+
706
+ return this.client.call(
707
+ 'patch',
708
+ uri,
709
+ apiHeaders,
710
+ payload
711
+ );
712
+ }
713
+
714
+ /**
715
+ * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
716
+ *
717
+ * @param {string} params.messageId - Message ID.
718
+ * @throws {RevenexxException}
719
+ * @returns {Promise<{}>}
720
+ */
721
+ messagingDelete(params: { messageId: string }): Promise<{}>;
722
+ /**
723
+ * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
724
+ *
725
+ * @param {string} messageId - Message ID.
726
+ * @throws {RevenexxException}
727
+ * @returns {Promise<{}>}
728
+ * @deprecated Use the object parameter style method for a better developer experience.
729
+ */
730
+ messagingDelete(messageId: string): Promise<{}>;
731
+ messagingDelete(
732
+ paramsOrFirst: { messageId: string } | string
733
+ ): Promise<{}> {
734
+ let params: { messageId: string };
735
+
736
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
737
+ params = (paramsOrFirst || {}) as { messageId: string };
738
+ } else {
739
+ params = {
740
+ messageId: paramsOrFirst as string
741
+ };
742
+ }
743
+
744
+ const messageId = params.messageId;
745
+
746
+ if (typeof messageId === 'undefined') {
747
+ throw new RevenexxException('Missing required parameter: "messageId"');
748
+ }
749
+
750
+ const apiPath = '/v1/messaging/messages/{messageId}'.replace('{messageId}', messageId);
751
+ const payload: Payload = {};
752
+ const uri = new URL(this.client.config.endpoint + apiPath);
753
+
754
+ const apiHeaders: { [header: string]: string } = {
755
+ }
756
+
757
+ return this.client.call(
758
+ 'delete',
759
+ uri,
760
+ apiHeaders,
761
+ payload
762
+ );
763
+ }
764
+
765
+ /**
766
+ * Get a message by its unique ID.
767
+ *
768
+ *
769
+ * @param {string} params.messageId - Message ID.
770
+ * @throws {RevenexxException}
771
+ * @returns {Promise<Models.Message>}
772
+ */
773
+ messagingGetMessage(params: { messageId: string }): Promise<Models.Message>;
774
+ /**
775
+ * Get a message by its unique ID.
776
+ *
777
+ *
778
+ * @param {string} messageId - Message ID.
779
+ * @throws {RevenexxException}
780
+ * @returns {Promise<Models.Message>}
781
+ * @deprecated Use the object parameter style method for a better developer experience.
782
+ */
783
+ messagingGetMessage(messageId: string): Promise<Models.Message>;
784
+ messagingGetMessage(
785
+ paramsOrFirst: { messageId: string } | string
786
+ ): Promise<Models.Message> {
787
+ let params: { messageId: string };
788
+
789
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
790
+ params = (paramsOrFirst || {}) as { messageId: string };
791
+ } else {
792
+ params = {
793
+ messageId: paramsOrFirst as string
794
+ };
795
+ }
796
+
797
+ const messageId = params.messageId;
798
+
799
+ if (typeof messageId === 'undefined') {
800
+ throw new RevenexxException('Missing required parameter: "messageId"');
801
+ }
802
+
803
+ const apiPath = '/v1/messaging/messages/{messageId}'.replace('{messageId}', messageId);
804
+ const payload: Payload = {};
805
+ const uri = new URL(this.client.config.endpoint + apiPath);
806
+
807
+ const apiHeaders: { [header: string]: string } = {
808
+ }
809
+
810
+ return this.client.call(
811
+ 'get',
812
+ uri,
813
+ apiHeaders,
814
+ payload
815
+ );
816
+ }
817
+
818
+ /**
819
+ * Get the message activity logs listed by its unique ID.
820
+ *
821
+ * @param {string} params.messageId - Message ID.
822
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
823
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
824
+ * @throws {RevenexxException}
825
+ * @returns {Promise<Models.LogList>}
826
+ */
827
+ messagingListMessageLogs(params: { messageId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
828
+ /**
829
+ * Get the message activity logs listed by its unique ID.
830
+ *
831
+ * @param {string} messageId - Message ID.
832
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
833
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
834
+ * @throws {RevenexxException}
835
+ * @returns {Promise<Models.LogList>}
836
+ * @deprecated Use the object parameter style method for a better developer experience.
837
+ */
838
+ messagingListMessageLogs(messageId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
839
+ messagingListMessageLogs(
840
+ paramsOrFirst: { messageId: string, queries?: string[], total?: boolean } | string,
841
+ ...rest: [(string[])?, (boolean)?]
842
+ ): Promise<Models.LogList> {
843
+ let params: { messageId: string, queries?: string[], total?: boolean };
844
+
845
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
846
+ params = (paramsOrFirst || {}) as { messageId: string, queries?: string[], total?: boolean };
847
+ } else {
848
+ params = {
849
+ messageId: paramsOrFirst as string,
850
+ queries: rest[0] as string[],
851
+ total: rest[1] as boolean
852
+ };
853
+ }
854
+
855
+ const messageId = params.messageId;
856
+ const queries = params.queries;
857
+ const total = params.total;
858
+
859
+ if (typeof messageId === 'undefined') {
860
+ throw new RevenexxException('Missing required parameter: "messageId"');
861
+ }
862
+
863
+ const apiPath = '/v1/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
864
+ const payload: Payload = {};
865
+ if (typeof queries !== 'undefined') {
866
+ payload['queries'] = queries;
867
+ }
868
+ if (typeof total !== 'undefined') {
869
+ payload['total'] = total;
870
+ }
871
+ const uri = new URL(this.client.config.endpoint + apiPath);
872
+
873
+ const apiHeaders: { [header: string]: string } = {
874
+ }
875
+
876
+ return this.client.call(
877
+ 'get',
878
+ uri,
879
+ apiHeaders,
880
+ payload
881
+ );
882
+ }
883
+
884
+ /**
885
+ * Get a list of the targets associated with a message.
886
+ *
887
+ * @param {string} params.messageId - Message ID.
888
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
889
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
890
+ * @throws {RevenexxException}
891
+ * @returns {Promise<Models.TargetList>}
892
+ */
893
+ messagingListTargets(params: { messageId: string, queries?: string[], total?: boolean }): Promise<Models.TargetList>;
894
+ /**
895
+ * Get a list of the targets associated with a message.
896
+ *
897
+ * @param {string} messageId - Message ID.
898
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
899
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
900
+ * @throws {RevenexxException}
901
+ * @returns {Promise<Models.TargetList>}
902
+ * @deprecated Use the object parameter style method for a better developer experience.
903
+ */
904
+ messagingListTargets(messageId: string, queries?: string[], total?: boolean): Promise<Models.TargetList>;
905
+ messagingListTargets(
906
+ paramsOrFirst: { messageId: string, queries?: string[], total?: boolean } | string,
907
+ ...rest: [(string[])?, (boolean)?]
908
+ ): Promise<Models.TargetList> {
909
+ let params: { messageId: string, queries?: string[], total?: boolean };
910
+
911
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
912
+ params = (paramsOrFirst || {}) as { messageId: string, queries?: string[], total?: boolean };
913
+ } else {
914
+ params = {
915
+ messageId: paramsOrFirst as string,
916
+ queries: rest[0] as string[],
917
+ total: rest[1] as boolean
918
+ };
919
+ }
920
+
921
+ const messageId = params.messageId;
922
+ const queries = params.queries;
923
+ const total = params.total;
924
+
925
+ if (typeof messageId === 'undefined') {
926
+ throw new RevenexxException('Missing required parameter: "messageId"');
927
+ }
928
+
929
+ const apiPath = '/v1/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
930
+ const payload: Payload = {};
931
+ if (typeof queries !== 'undefined') {
932
+ payload['queries'] = queries;
933
+ }
934
+ if (typeof total !== 'undefined') {
935
+ payload['total'] = total;
936
+ }
937
+ const uri = new URL(this.client.config.endpoint + apiPath);
938
+
939
+ const apiHeaders: { [header: string]: string } = {
940
+ }
941
+
942
+ return this.client.call(
943
+ 'get',
944
+ uri,
945
+ apiHeaders,
946
+ payload
947
+ );
948
+ }
949
+
950
+ /**
951
+ * Get a list of all providers from the current Revenexx project.
952
+ *
953
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
954
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
955
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
956
+ * @throws {RevenexxException}
957
+ * @returns {Promise<Models.ProviderList>}
958
+ */
959
+ messagingListProviders(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.ProviderList>;
960
+ /**
961
+ * Get a list of all providers from the current Revenexx project.
962
+ *
963
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
964
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
965
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
966
+ * @throws {RevenexxException}
967
+ * @returns {Promise<Models.ProviderList>}
968
+ * @deprecated Use the object parameter style method for a better developer experience.
969
+ */
970
+ messagingListProviders(queries?: string[], search?: string, total?: boolean): Promise<Models.ProviderList>;
971
+ messagingListProviders(
972
+ paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
973
+ ...rest: [(string)?, (boolean)?]
974
+ ): Promise<Models.ProviderList> {
975
+ let params: { queries?: string[], search?: string, total?: boolean };
976
+
977
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
978
+ params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
979
+ } else {
980
+ params = {
981
+ queries: paramsOrFirst as string[],
982
+ search: rest[0] as string,
983
+ total: rest[1] as boolean
984
+ };
985
+ }
986
+
987
+ const queries = params.queries;
988
+ const search = params.search;
989
+ const total = params.total;
990
+
991
+
992
+ const apiPath = '/v1/messaging/providers';
993
+ const payload: Payload = {};
994
+ if (typeof queries !== 'undefined') {
995
+ payload['queries'] = queries;
996
+ }
997
+ if (typeof search !== 'undefined') {
998
+ payload['search'] = search;
999
+ }
1000
+ if (typeof total !== 'undefined') {
1001
+ payload['total'] = total;
1002
+ }
1003
+ const uri = new URL(this.client.config.endpoint + apiPath);
1004
+
1005
+ const apiHeaders: { [header: string]: string } = {
1006
+ }
1007
+
1008
+ return this.client.call(
1009
+ 'get',
1010
+ uri,
1011
+ apiHeaders,
1012
+ payload
1013
+ );
1014
+ }
1015
+
1016
+ /**
1017
+ * Create a new Mailgun provider.
1018
+ *
1019
+ * @param {string} params.name - Provider name.
1020
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1021
+ * @param {string} params.apiKey - Mailgun API Key.
1022
+ * @param {string} params.domain - Mailgun Domain.
1023
+ * @param {boolean} params.enabled - Set as enabled.
1024
+ * @param {string} params.fromEmail - Sender email address.
1025
+ * @param {string} params.fromName - Sender Name.
1026
+ * @param {boolean} params.isEuRegion - Set as EU region.
1027
+ * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
1028
+ * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
1029
+ * @throws {RevenexxException}
1030
+ * @returns {Promise<Models.Provider>}
1031
+ */
1032
+ messagingCreateMailgunProvider(params: { name: string, providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1033
+ /**
1034
+ * Create a new Mailgun provider.
1035
+ *
1036
+ * @param {string} name - Provider name.
1037
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1038
+ * @param {string} apiKey - Mailgun API Key.
1039
+ * @param {string} domain - Mailgun Domain.
1040
+ * @param {boolean} enabled - Set as enabled.
1041
+ * @param {string} fromEmail - Sender email address.
1042
+ * @param {string} fromName - Sender Name.
1043
+ * @param {boolean} isEuRegion - Set as EU region.
1044
+ * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
1045
+ * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
1046
+ * @throws {RevenexxException}
1047
+ * @returns {Promise<Models.Provider>}
1048
+ * @deprecated Use the object parameter style method for a better developer experience.
1049
+ */
1050
+ messagingCreateMailgunProvider(name: string, providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1051
+ messagingCreateMailgunProvider(
1052
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, replyToEmail?: string, replyToName?: string } | string,
1053
+ ...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (boolean)?, (string)?, (string)?]
1054
+ ): Promise<Models.Provider> {
1055
+ let params: { name: string, providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, replyToEmail?: string, replyToName?: string };
1056
+
1057
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1058
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, replyToEmail?: string, replyToName?: string };
1059
+ } else {
1060
+ params = {
1061
+ name: paramsOrFirst as string,
1062
+ providerId: rest[0] as string,
1063
+ apiKey: rest[1] as string,
1064
+ domain: rest[2] as string,
1065
+ enabled: rest[3] as boolean,
1066
+ fromEmail: rest[4] as string,
1067
+ fromName: rest[5] as string,
1068
+ isEuRegion: rest[6] as boolean,
1069
+ replyToEmail: rest[7] as string,
1070
+ replyToName: rest[8] as string
1071
+ };
1072
+ }
1073
+
1074
+ const name = params.name;
1075
+ const providerId = params.providerId;
1076
+ const apiKey = params.apiKey;
1077
+ const domain = params.domain;
1078
+ const enabled = params.enabled;
1079
+ const fromEmail = params.fromEmail;
1080
+ const fromName = params.fromName;
1081
+ const isEuRegion = params.isEuRegion;
1082
+ const replyToEmail = params.replyToEmail;
1083
+ const replyToName = params.replyToName;
1084
+
1085
+ if (typeof name === 'undefined') {
1086
+ throw new RevenexxException('Missing required parameter: "name"');
1087
+ }
1088
+ if (typeof providerId === 'undefined') {
1089
+ throw new RevenexxException('Missing required parameter: "providerId"');
1090
+ }
1091
+
1092
+ const apiPath = '/v1/messaging/providers/mailgun';
1093
+ const payload: Payload = {};
1094
+ if (typeof apiKey !== 'undefined') {
1095
+ payload['apiKey'] = apiKey;
1096
+ }
1097
+ if (typeof domain !== 'undefined') {
1098
+ payload['domain'] = domain;
1099
+ }
1100
+ if (typeof enabled !== 'undefined') {
1101
+ payload['enabled'] = enabled;
1102
+ }
1103
+ if (typeof fromEmail !== 'undefined') {
1104
+ payload['fromEmail'] = fromEmail;
1105
+ }
1106
+ if (typeof fromName !== 'undefined') {
1107
+ payload['fromName'] = fromName;
1108
+ }
1109
+ if (typeof isEuRegion !== 'undefined') {
1110
+ payload['isEuRegion'] = isEuRegion;
1111
+ }
1112
+ if (typeof name !== 'undefined') {
1113
+ payload['name'] = name;
1114
+ }
1115
+ if (typeof providerId !== 'undefined') {
1116
+ payload['providerId'] = providerId;
1117
+ }
1118
+ if (typeof replyToEmail !== 'undefined') {
1119
+ payload['replyToEmail'] = replyToEmail;
1120
+ }
1121
+ if (typeof replyToName !== 'undefined') {
1122
+ payload['replyToName'] = replyToName;
1123
+ }
1124
+ const uri = new URL(this.client.config.endpoint + apiPath);
1125
+
1126
+ const apiHeaders: { [header: string]: string } = {
1127
+ 'content-type': 'application/json',
1128
+ }
1129
+
1130
+ return this.client.call(
1131
+ 'post',
1132
+ uri,
1133
+ apiHeaders,
1134
+ payload
1135
+ );
1136
+ }
1137
+
1138
+ /**
1139
+ * Update a Mailgun provider by its unique ID.
1140
+ *
1141
+ * @param {string} params.providerId - Provider ID.
1142
+ * @param {string} params.apiKey - Mailgun API Key.
1143
+ * @param {string} params.domain - Mailgun Domain.
1144
+ * @param {boolean} params.enabled - Set as enabled.
1145
+ * @param {string} params.fromEmail - Sender email address.
1146
+ * @param {string} params.fromName - Sender Name.
1147
+ * @param {boolean} params.isEuRegion - Set as EU region.
1148
+ * @param {string} params.name - Provider name.
1149
+ * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1150
+ * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
1151
+ * @throws {RevenexxException}
1152
+ * @returns {Promise<Models.Provider>}
1153
+ */
1154
+ messagingUpdateMailgunProvider(params: { providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, name?: string, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1155
+ /**
1156
+ * Update a Mailgun provider by its unique ID.
1157
+ *
1158
+ * @param {string} providerId - Provider ID.
1159
+ * @param {string} apiKey - Mailgun API Key.
1160
+ * @param {string} domain - Mailgun Domain.
1161
+ * @param {boolean} enabled - Set as enabled.
1162
+ * @param {string} fromEmail - Sender email address.
1163
+ * @param {string} fromName - Sender Name.
1164
+ * @param {boolean} isEuRegion - Set as EU region.
1165
+ * @param {string} name - Provider name.
1166
+ * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1167
+ * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
1168
+ * @throws {RevenexxException}
1169
+ * @returns {Promise<Models.Provider>}
1170
+ * @deprecated Use the object parameter style method for a better developer experience.
1171
+ */
1172
+ messagingUpdateMailgunProvider(providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, name?: string, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1173
+ messagingUpdateMailgunProvider(
1174
+ paramsOrFirst: { providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, name?: string, replyToEmail?: string, replyToName?: string } | string,
1175
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?]
1176
+ ): Promise<Models.Provider> {
1177
+ let params: { providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, name?: string, replyToEmail?: string, replyToName?: string };
1178
+
1179
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1180
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, domain?: string, enabled?: boolean, fromEmail?: string, fromName?: string, isEuRegion?: boolean, name?: string, replyToEmail?: string, replyToName?: string };
1181
+ } else {
1182
+ params = {
1183
+ providerId: paramsOrFirst as string,
1184
+ apiKey: rest[0] as string,
1185
+ domain: rest[1] as string,
1186
+ enabled: rest[2] as boolean,
1187
+ fromEmail: rest[3] as string,
1188
+ fromName: rest[4] as string,
1189
+ isEuRegion: rest[5] as boolean,
1190
+ name: rest[6] as string,
1191
+ replyToEmail: rest[7] as string,
1192
+ replyToName: rest[8] as string
1193
+ };
1194
+ }
1195
+
1196
+ const providerId = params.providerId;
1197
+ const apiKey = params.apiKey;
1198
+ const domain = params.domain;
1199
+ const enabled = params.enabled;
1200
+ const fromEmail = params.fromEmail;
1201
+ const fromName = params.fromName;
1202
+ const isEuRegion = params.isEuRegion;
1203
+ const name = params.name;
1204
+ const replyToEmail = params.replyToEmail;
1205
+ const replyToName = params.replyToName;
1206
+
1207
+ if (typeof providerId === 'undefined') {
1208
+ throw new RevenexxException('Missing required parameter: "providerId"');
1209
+ }
1210
+
1211
+ const apiPath = '/v1/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
1212
+ const payload: Payload = {};
1213
+ if (typeof apiKey !== 'undefined') {
1214
+ payload['apiKey'] = apiKey;
1215
+ }
1216
+ if (typeof domain !== 'undefined') {
1217
+ payload['domain'] = domain;
1218
+ }
1219
+ if (typeof enabled !== 'undefined') {
1220
+ payload['enabled'] = enabled;
1221
+ }
1222
+ if (typeof fromEmail !== 'undefined') {
1223
+ payload['fromEmail'] = fromEmail;
1224
+ }
1225
+ if (typeof fromName !== 'undefined') {
1226
+ payload['fromName'] = fromName;
1227
+ }
1228
+ if (typeof isEuRegion !== 'undefined') {
1229
+ payload['isEuRegion'] = isEuRegion;
1230
+ }
1231
+ if (typeof name !== 'undefined') {
1232
+ payload['name'] = name;
1233
+ }
1234
+ if (typeof replyToEmail !== 'undefined') {
1235
+ payload['replyToEmail'] = replyToEmail;
1236
+ }
1237
+ if (typeof replyToName !== 'undefined') {
1238
+ payload['replyToName'] = replyToName;
1239
+ }
1240
+ const uri = new URL(this.client.config.endpoint + apiPath);
1241
+
1242
+ const apiHeaders: { [header: string]: string } = {
1243
+ 'content-type': 'application/json',
1244
+ }
1245
+
1246
+ return this.client.call(
1247
+ 'patch',
1248
+ uri,
1249
+ apiHeaders,
1250
+ payload
1251
+ );
1252
+ }
1253
+
1254
+ /**
1255
+ * Create a new MSG91 provider.
1256
+ *
1257
+ * @param {string} params.name - Provider name.
1258
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1259
+ * @param {string} params.authKey - Msg91 auth key.
1260
+ * @param {boolean} params.enabled - Set as enabled.
1261
+ * @param {string} params.senderId - Msg91 sender ID.
1262
+ * @param {string} params.templateId - Msg91 template ID
1263
+ * @throws {RevenexxException}
1264
+ * @returns {Promise<Models.Provider>}
1265
+ */
1266
+ messagingCreateMsg91Provider(params: { name: string, providerId: string, authKey?: string, enabled?: boolean, senderId?: string, templateId?: string }): Promise<Models.Provider>;
1267
+ /**
1268
+ * Create a new MSG91 provider.
1269
+ *
1270
+ * @param {string} name - Provider name.
1271
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1272
+ * @param {string} authKey - Msg91 auth key.
1273
+ * @param {boolean} enabled - Set as enabled.
1274
+ * @param {string} senderId - Msg91 sender ID.
1275
+ * @param {string} templateId - Msg91 template ID
1276
+ * @throws {RevenexxException}
1277
+ * @returns {Promise<Models.Provider>}
1278
+ * @deprecated Use the object parameter style method for a better developer experience.
1279
+ */
1280
+ messagingCreateMsg91Provider(name: string, providerId: string, authKey?: string, enabled?: boolean, senderId?: string, templateId?: string): Promise<Models.Provider>;
1281
+ messagingCreateMsg91Provider(
1282
+ paramsOrFirst: { name: string, providerId: string, authKey?: string, enabled?: boolean, senderId?: string, templateId?: string } | string,
1283
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
1284
+ ): Promise<Models.Provider> {
1285
+ let params: { name: string, providerId: string, authKey?: string, enabled?: boolean, senderId?: string, templateId?: string };
1286
+
1287
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1288
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, authKey?: string, enabled?: boolean, senderId?: string, templateId?: string };
1289
+ } else {
1290
+ params = {
1291
+ name: paramsOrFirst as string,
1292
+ providerId: rest[0] as string,
1293
+ authKey: rest[1] as string,
1294
+ enabled: rest[2] as boolean,
1295
+ senderId: rest[3] as string,
1296
+ templateId: rest[4] as string
1297
+ };
1298
+ }
1299
+
1300
+ const name = params.name;
1301
+ const providerId = params.providerId;
1302
+ const authKey = params.authKey;
1303
+ const enabled = params.enabled;
1304
+ const senderId = params.senderId;
1305
+ const templateId = params.templateId;
1306
+
1307
+ if (typeof name === 'undefined') {
1308
+ throw new RevenexxException('Missing required parameter: "name"');
1309
+ }
1310
+ if (typeof providerId === 'undefined') {
1311
+ throw new RevenexxException('Missing required parameter: "providerId"');
1312
+ }
1313
+
1314
+ const apiPath = '/v1/messaging/providers/msg91';
1315
+ const payload: Payload = {};
1316
+ if (typeof authKey !== 'undefined') {
1317
+ payload['authKey'] = authKey;
1318
+ }
1319
+ if (typeof enabled !== 'undefined') {
1320
+ payload['enabled'] = enabled;
1321
+ }
1322
+ if (typeof name !== 'undefined') {
1323
+ payload['name'] = name;
1324
+ }
1325
+ if (typeof providerId !== 'undefined') {
1326
+ payload['providerId'] = providerId;
1327
+ }
1328
+ if (typeof senderId !== 'undefined') {
1329
+ payload['senderId'] = senderId;
1330
+ }
1331
+ if (typeof templateId !== 'undefined') {
1332
+ payload['templateId'] = templateId;
1333
+ }
1334
+ const uri = new URL(this.client.config.endpoint + apiPath);
1335
+
1336
+ const apiHeaders: { [header: string]: string } = {
1337
+ 'content-type': 'application/json',
1338
+ }
1339
+
1340
+ return this.client.call(
1341
+ 'post',
1342
+ uri,
1343
+ apiHeaders,
1344
+ payload
1345
+ );
1346
+ }
1347
+
1348
+ /**
1349
+ * Update a MSG91 provider by its unique ID.
1350
+ *
1351
+ * @param {string} params.providerId - Provider ID.
1352
+ * @param {string} params.authKey - Msg91 auth key.
1353
+ * @param {boolean} params.enabled - Set as enabled.
1354
+ * @param {string} params.name - Provider name.
1355
+ * @param {string} params.senderId - Msg91 sender ID.
1356
+ * @param {string} params.templateId - Msg91 template ID.
1357
+ * @throws {RevenexxException}
1358
+ * @returns {Promise<Models.Provider>}
1359
+ */
1360
+ messagingUpdateMsg91Provider(params: { providerId: string, authKey?: string, enabled?: boolean, name?: string, senderId?: string, templateId?: string }): Promise<Models.Provider>;
1361
+ /**
1362
+ * Update a MSG91 provider by its unique ID.
1363
+ *
1364
+ * @param {string} providerId - Provider ID.
1365
+ * @param {string} authKey - Msg91 auth key.
1366
+ * @param {boolean} enabled - Set as enabled.
1367
+ * @param {string} name - Provider name.
1368
+ * @param {string} senderId - Msg91 sender ID.
1369
+ * @param {string} templateId - Msg91 template ID.
1370
+ * @throws {RevenexxException}
1371
+ * @returns {Promise<Models.Provider>}
1372
+ * @deprecated Use the object parameter style method for a better developer experience.
1373
+ */
1374
+ messagingUpdateMsg91Provider(providerId: string, authKey?: string, enabled?: boolean, name?: string, senderId?: string, templateId?: string): Promise<Models.Provider>;
1375
+ messagingUpdateMsg91Provider(
1376
+ paramsOrFirst: { providerId: string, authKey?: string, enabled?: boolean, name?: string, senderId?: string, templateId?: string } | string,
1377
+ ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
1378
+ ): Promise<Models.Provider> {
1379
+ let params: { providerId: string, authKey?: string, enabled?: boolean, name?: string, senderId?: string, templateId?: string };
1380
+
1381
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1382
+ params = (paramsOrFirst || {}) as { providerId: string, authKey?: string, enabled?: boolean, name?: string, senderId?: string, templateId?: string };
1383
+ } else {
1384
+ params = {
1385
+ providerId: paramsOrFirst as string,
1386
+ authKey: rest[0] as string,
1387
+ enabled: rest[1] as boolean,
1388
+ name: rest[2] as string,
1389
+ senderId: rest[3] as string,
1390
+ templateId: rest[4] as string
1391
+ };
1392
+ }
1393
+
1394
+ const providerId = params.providerId;
1395
+ const authKey = params.authKey;
1396
+ const enabled = params.enabled;
1397
+ const name = params.name;
1398
+ const senderId = params.senderId;
1399
+ const templateId = params.templateId;
1400
+
1401
+ if (typeof providerId === 'undefined') {
1402
+ throw new RevenexxException('Missing required parameter: "providerId"');
1403
+ }
1404
+
1405
+ const apiPath = '/v1/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
1406
+ const payload: Payload = {};
1407
+ if (typeof authKey !== 'undefined') {
1408
+ payload['authKey'] = authKey;
1409
+ }
1410
+ if (typeof enabled !== 'undefined') {
1411
+ payload['enabled'] = enabled;
1412
+ }
1413
+ if (typeof name !== 'undefined') {
1414
+ payload['name'] = name;
1415
+ }
1416
+ if (typeof senderId !== 'undefined') {
1417
+ payload['senderId'] = senderId;
1418
+ }
1419
+ if (typeof templateId !== 'undefined') {
1420
+ payload['templateId'] = templateId;
1421
+ }
1422
+ const uri = new URL(this.client.config.endpoint + apiPath);
1423
+
1424
+ const apiHeaders: { [header: string]: string } = {
1425
+ 'content-type': 'application/json',
1426
+ }
1427
+
1428
+ return this.client.call(
1429
+ 'patch',
1430
+ uri,
1431
+ apiHeaders,
1432
+ payload
1433
+ );
1434
+ }
1435
+
1436
+ /**
1437
+ * Create a new Resend provider.
1438
+ *
1439
+ * @param {string} params.name - Provider name.
1440
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1441
+ * @param {string} params.apiKey - Resend API key.
1442
+ * @param {boolean} params.enabled - Set as enabled.
1443
+ * @param {string} params.fromEmail - Sender email address.
1444
+ * @param {string} params.fromName - Sender Name.
1445
+ * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1446
+ * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
1447
+ * @throws {RevenexxException}
1448
+ * @returns {Promise<Models.Provider>}
1449
+ */
1450
+ messagingCreateResendProvider(params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1451
+ /**
1452
+ * Create a new Resend provider.
1453
+ *
1454
+ * @param {string} name - Provider name.
1455
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1456
+ * @param {string} apiKey - Resend API key.
1457
+ * @param {boolean} enabled - Set as enabled.
1458
+ * @param {string} fromEmail - Sender email address.
1459
+ * @param {string} fromName - Sender Name.
1460
+ * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1461
+ * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
1462
+ * @throws {RevenexxException}
1463
+ * @returns {Promise<Models.Provider>}
1464
+ * @deprecated Use the object parameter style method for a better developer experience.
1465
+ */
1466
+ messagingCreateResendProvider(name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1467
+ messagingCreateResendProvider(
1468
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string } | string,
1469
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?]
1470
+ ): Promise<Models.Provider> {
1471
+ let params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string };
1472
+
1473
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1474
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string };
1475
+ } else {
1476
+ params = {
1477
+ name: paramsOrFirst as string,
1478
+ providerId: rest[0] as string,
1479
+ apiKey: rest[1] as string,
1480
+ enabled: rest[2] as boolean,
1481
+ fromEmail: rest[3] as string,
1482
+ fromName: rest[4] as string,
1483
+ replyToEmail: rest[5] as string,
1484
+ replyToName: rest[6] as string
1485
+ };
1486
+ }
1487
+
1488
+ const name = params.name;
1489
+ const providerId = params.providerId;
1490
+ const apiKey = params.apiKey;
1491
+ const enabled = params.enabled;
1492
+ const fromEmail = params.fromEmail;
1493
+ const fromName = params.fromName;
1494
+ const replyToEmail = params.replyToEmail;
1495
+ const replyToName = params.replyToName;
1496
+
1497
+ if (typeof name === 'undefined') {
1498
+ throw new RevenexxException('Missing required parameter: "name"');
1499
+ }
1500
+ if (typeof providerId === 'undefined') {
1501
+ throw new RevenexxException('Missing required parameter: "providerId"');
1502
+ }
1503
+
1504
+ const apiPath = '/v1/messaging/providers/resend';
1505
+ const payload: Payload = {};
1506
+ if (typeof apiKey !== 'undefined') {
1507
+ payload['apiKey'] = apiKey;
1508
+ }
1509
+ if (typeof enabled !== 'undefined') {
1510
+ payload['enabled'] = enabled;
1511
+ }
1512
+ if (typeof fromEmail !== 'undefined') {
1513
+ payload['fromEmail'] = fromEmail;
1514
+ }
1515
+ if (typeof fromName !== 'undefined') {
1516
+ payload['fromName'] = fromName;
1517
+ }
1518
+ if (typeof name !== 'undefined') {
1519
+ payload['name'] = name;
1520
+ }
1521
+ if (typeof providerId !== 'undefined') {
1522
+ payload['providerId'] = providerId;
1523
+ }
1524
+ if (typeof replyToEmail !== 'undefined') {
1525
+ payload['replyToEmail'] = replyToEmail;
1526
+ }
1527
+ if (typeof replyToName !== 'undefined') {
1528
+ payload['replyToName'] = replyToName;
1529
+ }
1530
+ const uri = new URL(this.client.config.endpoint + apiPath);
1531
+
1532
+ const apiHeaders: { [header: string]: string } = {
1533
+ 'content-type': 'application/json',
1534
+ }
1535
+
1536
+ return this.client.call(
1537
+ 'post',
1538
+ uri,
1539
+ apiHeaders,
1540
+ payload
1541
+ );
1542
+ }
1543
+
1544
+ /**
1545
+ * Update a Resend provider by its unique ID.
1546
+ *
1547
+ * @param {string} params.providerId - Provider ID.
1548
+ * @param {string} params.apiKey - Resend API key.
1549
+ * @param {boolean} params.enabled - Set as enabled.
1550
+ * @param {string} params.fromEmail - Sender email address.
1551
+ * @param {string} params.fromName - Sender Name.
1552
+ * @param {string} params.name - Provider name.
1553
+ * @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
1554
+ * @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
1555
+ * @throws {RevenexxException}
1556
+ * @returns {Promise<Models.Provider>}
1557
+ */
1558
+ messagingUpdateResendProvider(params: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1559
+ /**
1560
+ * Update a Resend provider by its unique ID.
1561
+ *
1562
+ * @param {string} providerId - Provider ID.
1563
+ * @param {string} apiKey - Resend API key.
1564
+ * @param {boolean} enabled - Set as enabled.
1565
+ * @param {string} fromEmail - Sender email address.
1566
+ * @param {string} fromName - Sender Name.
1567
+ * @param {string} name - Provider name.
1568
+ * @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
1569
+ * @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
1570
+ * @throws {RevenexxException}
1571
+ * @returns {Promise<Models.Provider>}
1572
+ * @deprecated Use the object parameter style method for a better developer experience.
1573
+ */
1574
+ messagingUpdateResendProvider(providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1575
+ messagingUpdateResendProvider(
1576
+ paramsOrFirst: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string } | string,
1577
+ ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?]
1578
+ ): Promise<Models.Provider> {
1579
+ let params: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string };
1580
+
1581
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1582
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string };
1583
+ } else {
1584
+ params = {
1585
+ providerId: paramsOrFirst as string,
1586
+ apiKey: rest[0] as string,
1587
+ enabled: rest[1] as boolean,
1588
+ fromEmail: rest[2] as string,
1589
+ fromName: rest[3] as string,
1590
+ name: rest[4] as string,
1591
+ replyToEmail: rest[5] as string,
1592
+ replyToName: rest[6] as string
1593
+ };
1594
+ }
1595
+
1596
+ const providerId = params.providerId;
1597
+ const apiKey = params.apiKey;
1598
+ const enabled = params.enabled;
1599
+ const fromEmail = params.fromEmail;
1600
+ const fromName = params.fromName;
1601
+ const name = params.name;
1602
+ const replyToEmail = params.replyToEmail;
1603
+ const replyToName = params.replyToName;
1604
+
1605
+ if (typeof providerId === 'undefined') {
1606
+ throw new RevenexxException('Missing required parameter: "providerId"');
1607
+ }
1608
+
1609
+ const apiPath = '/v1/messaging/providers/resend/{providerId}'.replace('{providerId}', providerId);
1610
+ const payload: Payload = {};
1611
+ if (typeof apiKey !== 'undefined') {
1612
+ payload['apiKey'] = apiKey;
1613
+ }
1614
+ if (typeof enabled !== 'undefined') {
1615
+ payload['enabled'] = enabled;
1616
+ }
1617
+ if (typeof fromEmail !== 'undefined') {
1618
+ payload['fromEmail'] = fromEmail;
1619
+ }
1620
+ if (typeof fromName !== 'undefined') {
1621
+ payload['fromName'] = fromName;
1622
+ }
1623
+ if (typeof name !== 'undefined') {
1624
+ payload['name'] = name;
1625
+ }
1626
+ if (typeof replyToEmail !== 'undefined') {
1627
+ payload['replyToEmail'] = replyToEmail;
1628
+ }
1629
+ if (typeof replyToName !== 'undefined') {
1630
+ payload['replyToName'] = replyToName;
1631
+ }
1632
+ const uri = new URL(this.client.config.endpoint + apiPath);
1633
+
1634
+ const apiHeaders: { [header: string]: string } = {
1635
+ 'content-type': 'application/json',
1636
+ }
1637
+
1638
+ return this.client.call(
1639
+ 'patch',
1640
+ uri,
1641
+ apiHeaders,
1642
+ payload
1643
+ );
1644
+ }
1645
+
1646
+ /**
1647
+ * Create a new Sendgrid provider.
1648
+ *
1649
+ * @param {string} params.name - Provider name.
1650
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1651
+ * @param {string} params.apiKey - Sendgrid API key.
1652
+ * @param {boolean} params.enabled - Set as enabled.
1653
+ * @param {string} params.fromEmail - Sender email address.
1654
+ * @param {string} params.fromName - Sender Name.
1655
+ * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1656
+ * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
1657
+ * @throws {RevenexxException}
1658
+ * @returns {Promise<Models.Provider>}
1659
+ */
1660
+ messagingCreateSendgridProvider(params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1661
+ /**
1662
+ * Create a new Sendgrid provider.
1663
+ *
1664
+ * @param {string} name - Provider name.
1665
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1666
+ * @param {string} apiKey - Sendgrid API key.
1667
+ * @param {boolean} enabled - Set as enabled.
1668
+ * @param {string} fromEmail - Sender email address.
1669
+ * @param {string} fromName - Sender Name.
1670
+ * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
1671
+ * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
1672
+ * @throws {RevenexxException}
1673
+ * @returns {Promise<Models.Provider>}
1674
+ * @deprecated Use the object parameter style method for a better developer experience.
1675
+ */
1676
+ messagingCreateSendgridProvider(name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1677
+ messagingCreateSendgridProvider(
1678
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string } | string,
1679
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?]
1680
+ ): Promise<Models.Provider> {
1681
+ let params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string };
1682
+
1683
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1684
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, replyToEmail?: string, replyToName?: string };
1685
+ } else {
1686
+ params = {
1687
+ name: paramsOrFirst as string,
1688
+ providerId: rest[0] as string,
1689
+ apiKey: rest[1] as string,
1690
+ enabled: rest[2] as boolean,
1691
+ fromEmail: rest[3] as string,
1692
+ fromName: rest[4] as string,
1693
+ replyToEmail: rest[5] as string,
1694
+ replyToName: rest[6] as string
1695
+ };
1696
+ }
1697
+
1698
+ const name = params.name;
1699
+ const providerId = params.providerId;
1700
+ const apiKey = params.apiKey;
1701
+ const enabled = params.enabled;
1702
+ const fromEmail = params.fromEmail;
1703
+ const fromName = params.fromName;
1704
+ const replyToEmail = params.replyToEmail;
1705
+ const replyToName = params.replyToName;
1706
+
1707
+ if (typeof name === 'undefined') {
1708
+ throw new RevenexxException('Missing required parameter: "name"');
1709
+ }
1710
+ if (typeof providerId === 'undefined') {
1711
+ throw new RevenexxException('Missing required parameter: "providerId"');
1712
+ }
1713
+
1714
+ const apiPath = '/v1/messaging/providers/sendgrid';
1715
+ const payload: Payload = {};
1716
+ if (typeof apiKey !== 'undefined') {
1717
+ payload['apiKey'] = apiKey;
1718
+ }
1719
+ if (typeof enabled !== 'undefined') {
1720
+ payload['enabled'] = enabled;
1721
+ }
1722
+ if (typeof fromEmail !== 'undefined') {
1723
+ payload['fromEmail'] = fromEmail;
1724
+ }
1725
+ if (typeof fromName !== 'undefined') {
1726
+ payload['fromName'] = fromName;
1727
+ }
1728
+ if (typeof name !== 'undefined') {
1729
+ payload['name'] = name;
1730
+ }
1731
+ if (typeof providerId !== 'undefined') {
1732
+ payload['providerId'] = providerId;
1733
+ }
1734
+ if (typeof replyToEmail !== 'undefined') {
1735
+ payload['replyToEmail'] = replyToEmail;
1736
+ }
1737
+ if (typeof replyToName !== 'undefined') {
1738
+ payload['replyToName'] = replyToName;
1739
+ }
1740
+ const uri = new URL(this.client.config.endpoint + apiPath);
1741
+
1742
+ const apiHeaders: { [header: string]: string } = {
1743
+ 'content-type': 'application/json',
1744
+ }
1745
+
1746
+ return this.client.call(
1747
+ 'post',
1748
+ uri,
1749
+ apiHeaders,
1750
+ payload
1751
+ );
1752
+ }
1753
+
1754
+ /**
1755
+ * Update a Sendgrid provider by its unique ID.
1756
+ *
1757
+ * @param {string} params.providerId - Provider ID.
1758
+ * @param {string} params.apiKey - Sendgrid API key.
1759
+ * @param {boolean} params.enabled - Set as enabled.
1760
+ * @param {string} params.fromEmail - Sender email address.
1761
+ * @param {string} params.fromName - Sender Name.
1762
+ * @param {string} params.name - Provider name.
1763
+ * @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
1764
+ * @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
1765
+ * @throws {RevenexxException}
1766
+ * @returns {Promise<Models.Provider>}
1767
+ */
1768
+ messagingUpdateSendgridProvider(params: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string }): Promise<Models.Provider>;
1769
+ /**
1770
+ * Update a Sendgrid provider by its unique ID.
1771
+ *
1772
+ * @param {string} providerId - Provider ID.
1773
+ * @param {string} apiKey - Sendgrid API key.
1774
+ * @param {boolean} enabled - Set as enabled.
1775
+ * @param {string} fromEmail - Sender email address.
1776
+ * @param {string} fromName - Sender Name.
1777
+ * @param {string} name - Provider name.
1778
+ * @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
1779
+ * @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
1780
+ * @throws {RevenexxException}
1781
+ * @returns {Promise<Models.Provider>}
1782
+ * @deprecated Use the object parameter style method for a better developer experience.
1783
+ */
1784
+ messagingUpdateSendgridProvider(providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string): Promise<Models.Provider>;
1785
+ messagingUpdateSendgridProvider(
1786
+ paramsOrFirst: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string } | string,
1787
+ ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?]
1788
+ ): Promise<Models.Provider> {
1789
+ let params: { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string };
1790
+
1791
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1792
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, enabled?: boolean, fromEmail?: string, fromName?: string, name?: string, replyToEmail?: string, replyToName?: string };
1793
+ } else {
1794
+ params = {
1795
+ providerId: paramsOrFirst as string,
1796
+ apiKey: rest[0] as string,
1797
+ enabled: rest[1] as boolean,
1798
+ fromEmail: rest[2] as string,
1799
+ fromName: rest[3] as string,
1800
+ name: rest[4] as string,
1801
+ replyToEmail: rest[5] as string,
1802
+ replyToName: rest[6] as string
1803
+ };
1804
+ }
1805
+
1806
+ const providerId = params.providerId;
1807
+ const apiKey = params.apiKey;
1808
+ const enabled = params.enabled;
1809
+ const fromEmail = params.fromEmail;
1810
+ const fromName = params.fromName;
1811
+ const name = params.name;
1812
+ const replyToEmail = params.replyToEmail;
1813
+ const replyToName = params.replyToName;
1814
+
1815
+ if (typeof providerId === 'undefined') {
1816
+ throw new RevenexxException('Missing required parameter: "providerId"');
1817
+ }
1818
+
1819
+ const apiPath = '/v1/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
1820
+ const payload: Payload = {};
1821
+ if (typeof apiKey !== 'undefined') {
1822
+ payload['apiKey'] = apiKey;
1823
+ }
1824
+ if (typeof enabled !== 'undefined') {
1825
+ payload['enabled'] = enabled;
1826
+ }
1827
+ if (typeof fromEmail !== 'undefined') {
1828
+ payload['fromEmail'] = fromEmail;
1829
+ }
1830
+ if (typeof fromName !== 'undefined') {
1831
+ payload['fromName'] = fromName;
1832
+ }
1833
+ if (typeof name !== 'undefined') {
1834
+ payload['name'] = name;
1835
+ }
1836
+ if (typeof replyToEmail !== 'undefined') {
1837
+ payload['replyToEmail'] = replyToEmail;
1838
+ }
1839
+ if (typeof replyToName !== 'undefined') {
1840
+ payload['replyToName'] = replyToName;
1841
+ }
1842
+ const uri = new URL(this.client.config.endpoint + apiPath);
1843
+
1844
+ const apiHeaders: { [header: string]: string } = {
1845
+ 'content-type': 'application/json',
1846
+ }
1847
+
1848
+ return this.client.call(
1849
+ 'patch',
1850
+ uri,
1851
+ apiHeaders,
1852
+ payload
1853
+ );
1854
+ }
1855
+
1856
+ /**
1857
+ * Create a new Telesign provider.
1858
+ *
1859
+ * @param {string} params.name - Provider name.
1860
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1861
+ * @param {string} params.apiKey - Telesign API key.
1862
+ * @param {string} params.customerId - Telesign customer ID.
1863
+ * @param {boolean} params.enabled - Set as enabled.
1864
+ * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1865
+ * @throws {RevenexxException}
1866
+ * @returns {Promise<Models.Provider>}
1867
+ */
1868
+ messagingCreateTelesignProvider(params: { name: string, providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string }): Promise<Models.Provider>;
1869
+ /**
1870
+ * Create a new Telesign provider.
1871
+ *
1872
+ * @param {string} name - Provider name.
1873
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1874
+ * @param {string} apiKey - Telesign API key.
1875
+ * @param {string} customerId - Telesign customer ID.
1876
+ * @param {boolean} enabled - Set as enabled.
1877
+ * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1878
+ * @throws {RevenexxException}
1879
+ * @returns {Promise<Models.Provider>}
1880
+ * @deprecated Use the object parameter style method for a better developer experience.
1881
+ */
1882
+ messagingCreateTelesignProvider(name: string, providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string): Promise<Models.Provider>;
1883
+ messagingCreateTelesignProvider(
1884
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string } | string,
1885
+ ...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?]
1886
+ ): Promise<Models.Provider> {
1887
+ let params: { name: string, providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string };
1888
+
1889
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1890
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string };
1891
+ } else {
1892
+ params = {
1893
+ name: paramsOrFirst as string,
1894
+ providerId: rest[0] as string,
1895
+ apiKey: rest[1] as string,
1896
+ customerId: rest[2] as string,
1897
+ enabled: rest[3] as boolean,
1898
+ from: rest[4] as string
1899
+ };
1900
+ }
1901
+
1902
+ const name = params.name;
1903
+ const providerId = params.providerId;
1904
+ const apiKey = params.apiKey;
1905
+ const customerId = params.customerId;
1906
+ const enabled = params.enabled;
1907
+ const from = params.from;
1908
+
1909
+ if (typeof name === 'undefined') {
1910
+ throw new RevenexxException('Missing required parameter: "name"');
1911
+ }
1912
+ if (typeof providerId === 'undefined') {
1913
+ throw new RevenexxException('Missing required parameter: "providerId"');
1914
+ }
1915
+
1916
+ const apiPath = '/v1/messaging/providers/telesign';
1917
+ const payload: Payload = {};
1918
+ if (typeof apiKey !== 'undefined') {
1919
+ payload['apiKey'] = apiKey;
1920
+ }
1921
+ if (typeof customerId !== 'undefined') {
1922
+ payload['customerId'] = customerId;
1923
+ }
1924
+ if (typeof enabled !== 'undefined') {
1925
+ payload['enabled'] = enabled;
1926
+ }
1927
+ if (typeof from !== 'undefined') {
1928
+ payload['from'] = from;
1929
+ }
1930
+ if (typeof name !== 'undefined') {
1931
+ payload['name'] = name;
1932
+ }
1933
+ if (typeof providerId !== 'undefined') {
1934
+ payload['providerId'] = providerId;
1935
+ }
1936
+ const uri = new URL(this.client.config.endpoint + apiPath);
1937
+
1938
+ const apiHeaders: { [header: string]: string } = {
1939
+ 'content-type': 'application/json',
1940
+ }
1941
+
1942
+ return this.client.call(
1943
+ 'post',
1944
+ uri,
1945
+ apiHeaders,
1946
+ payload
1947
+ );
1948
+ }
1949
+
1950
+ /**
1951
+ * Update a Telesign provider by its unique ID.
1952
+ *
1953
+ * @param {string} params.providerId - Provider ID.
1954
+ * @param {string} params.apiKey - Telesign API key.
1955
+ * @param {string} params.customerId - Telesign customer ID.
1956
+ * @param {boolean} params.enabled - Set as enabled.
1957
+ * @param {string} params.from - Sender number.
1958
+ * @param {string} params.name - Provider name.
1959
+ * @throws {RevenexxException}
1960
+ * @returns {Promise<Models.Provider>}
1961
+ */
1962
+ messagingUpdateTelesignProvider(params: { providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string, name?: string }): Promise<Models.Provider>;
1963
+ /**
1964
+ * Update a Telesign provider by its unique ID.
1965
+ *
1966
+ * @param {string} providerId - Provider ID.
1967
+ * @param {string} apiKey - Telesign API key.
1968
+ * @param {string} customerId - Telesign customer ID.
1969
+ * @param {boolean} enabled - Set as enabled.
1970
+ * @param {string} from - Sender number.
1971
+ * @param {string} name - Provider name.
1972
+ * @throws {RevenexxException}
1973
+ * @returns {Promise<Models.Provider>}
1974
+ * @deprecated Use the object parameter style method for a better developer experience.
1975
+ */
1976
+ messagingUpdateTelesignProvider(providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string, name?: string): Promise<Models.Provider>;
1977
+ messagingUpdateTelesignProvider(
1978
+ paramsOrFirst: { providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string, name?: string } | string,
1979
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
1980
+ ): Promise<Models.Provider> {
1981
+ let params: { providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string, name?: string };
1982
+
1983
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1984
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, customerId?: string, enabled?: boolean, from?: string, name?: string };
1985
+ } else {
1986
+ params = {
1987
+ providerId: paramsOrFirst as string,
1988
+ apiKey: rest[0] as string,
1989
+ customerId: rest[1] as string,
1990
+ enabled: rest[2] as boolean,
1991
+ from: rest[3] as string,
1992
+ name: rest[4] as string
1993
+ };
1994
+ }
1995
+
1996
+ const providerId = params.providerId;
1997
+ const apiKey = params.apiKey;
1998
+ const customerId = params.customerId;
1999
+ const enabled = params.enabled;
2000
+ const from = params.from;
2001
+ const name = params.name;
2002
+
2003
+ if (typeof providerId === 'undefined') {
2004
+ throw new RevenexxException('Missing required parameter: "providerId"');
2005
+ }
2006
+
2007
+ const apiPath = '/v1/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
2008
+ const payload: Payload = {};
2009
+ if (typeof apiKey !== 'undefined') {
2010
+ payload['apiKey'] = apiKey;
2011
+ }
2012
+ if (typeof customerId !== 'undefined') {
2013
+ payload['customerId'] = customerId;
2014
+ }
2015
+ if (typeof enabled !== 'undefined') {
2016
+ payload['enabled'] = enabled;
2017
+ }
2018
+ if (typeof from !== 'undefined') {
2019
+ payload['from'] = from;
2020
+ }
2021
+ if (typeof name !== 'undefined') {
2022
+ payload['name'] = name;
2023
+ }
2024
+ const uri = new URL(this.client.config.endpoint + apiPath);
2025
+
2026
+ const apiHeaders: { [header: string]: string } = {
2027
+ 'content-type': 'application/json',
2028
+ }
2029
+
2030
+ return this.client.call(
2031
+ 'patch',
2032
+ uri,
2033
+ apiHeaders,
2034
+ payload
2035
+ );
2036
+ }
2037
+
2038
+ /**
2039
+ * Create a new Textmagic provider.
2040
+ *
2041
+ * @param {string} params.name - Provider name.
2042
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2043
+ * @param {string} params.apiKey - Textmagic apiKey.
2044
+ * @param {boolean} params.enabled - Set as enabled.
2045
+ * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2046
+ * @param {string} params.username - Textmagic username.
2047
+ * @throws {RevenexxException}
2048
+ * @returns {Promise<Models.Provider>}
2049
+ */
2050
+ messagingCreateTextmagicProvider(params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, from?: string, username?: string }): Promise<Models.Provider>;
2051
+ /**
2052
+ * Create a new Textmagic provider.
2053
+ *
2054
+ * @param {string} name - Provider name.
2055
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2056
+ * @param {string} apiKey - Textmagic apiKey.
2057
+ * @param {boolean} enabled - Set as enabled.
2058
+ * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2059
+ * @param {string} username - Textmagic username.
2060
+ * @throws {RevenexxException}
2061
+ * @returns {Promise<Models.Provider>}
2062
+ * @deprecated Use the object parameter style method for a better developer experience.
2063
+ */
2064
+ messagingCreateTextmagicProvider(name: string, providerId: string, apiKey?: string, enabled?: boolean, from?: string, username?: string): Promise<Models.Provider>;
2065
+ messagingCreateTextmagicProvider(
2066
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, enabled?: boolean, from?: string, username?: string } | string,
2067
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
2068
+ ): Promise<Models.Provider> {
2069
+ let params: { name: string, providerId: string, apiKey?: string, enabled?: boolean, from?: string, username?: string };
2070
+
2071
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2072
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, enabled?: boolean, from?: string, username?: string };
2073
+ } else {
2074
+ params = {
2075
+ name: paramsOrFirst as string,
2076
+ providerId: rest[0] as string,
2077
+ apiKey: rest[1] as string,
2078
+ enabled: rest[2] as boolean,
2079
+ from: rest[3] as string,
2080
+ username: rest[4] as string
2081
+ };
2082
+ }
2083
+
2084
+ const name = params.name;
2085
+ const providerId = params.providerId;
2086
+ const apiKey = params.apiKey;
2087
+ const enabled = params.enabled;
2088
+ const from = params.from;
2089
+ const username = params.username;
2090
+
2091
+ if (typeof name === 'undefined') {
2092
+ throw new RevenexxException('Missing required parameter: "name"');
2093
+ }
2094
+ if (typeof providerId === 'undefined') {
2095
+ throw new RevenexxException('Missing required parameter: "providerId"');
2096
+ }
2097
+
2098
+ const apiPath = '/v1/messaging/providers/textmagic';
2099
+ const payload: Payload = {};
2100
+ if (typeof apiKey !== 'undefined') {
2101
+ payload['apiKey'] = apiKey;
2102
+ }
2103
+ if (typeof enabled !== 'undefined') {
2104
+ payload['enabled'] = enabled;
2105
+ }
2106
+ if (typeof from !== 'undefined') {
2107
+ payload['from'] = from;
2108
+ }
2109
+ if (typeof name !== 'undefined') {
2110
+ payload['name'] = name;
2111
+ }
2112
+ if (typeof providerId !== 'undefined') {
2113
+ payload['providerId'] = providerId;
2114
+ }
2115
+ if (typeof username !== 'undefined') {
2116
+ payload['username'] = username;
2117
+ }
2118
+ const uri = new URL(this.client.config.endpoint + apiPath);
2119
+
2120
+ const apiHeaders: { [header: string]: string } = {
2121
+ 'content-type': 'application/json',
2122
+ }
2123
+
2124
+ return this.client.call(
2125
+ 'post',
2126
+ uri,
2127
+ apiHeaders,
2128
+ payload
2129
+ );
2130
+ }
2131
+
2132
+ /**
2133
+ * Update a Textmagic provider by its unique ID.
2134
+ *
2135
+ * @param {string} params.providerId - Provider ID.
2136
+ * @param {string} params.apiKey - Textmagic apiKey.
2137
+ * @param {boolean} params.enabled - Set as enabled.
2138
+ * @param {string} params.from - Sender number.
2139
+ * @param {string} params.name - Provider name.
2140
+ * @param {string} params.username - Textmagic username.
2141
+ * @throws {RevenexxException}
2142
+ * @returns {Promise<Models.Provider>}
2143
+ */
2144
+ messagingUpdateTextmagicProvider(params: { providerId: string, apiKey?: string, enabled?: boolean, from?: string, name?: string, username?: string }): Promise<Models.Provider>;
2145
+ /**
2146
+ * Update a Textmagic provider by its unique ID.
2147
+ *
2148
+ * @param {string} providerId - Provider ID.
2149
+ * @param {string} apiKey - Textmagic apiKey.
2150
+ * @param {boolean} enabled - Set as enabled.
2151
+ * @param {string} from - Sender number.
2152
+ * @param {string} name - Provider name.
2153
+ * @param {string} username - Textmagic username.
2154
+ * @throws {RevenexxException}
2155
+ * @returns {Promise<Models.Provider>}
2156
+ * @deprecated Use the object parameter style method for a better developer experience.
2157
+ */
2158
+ messagingUpdateTextmagicProvider(providerId: string, apiKey?: string, enabled?: boolean, from?: string, name?: string, username?: string): Promise<Models.Provider>;
2159
+ messagingUpdateTextmagicProvider(
2160
+ paramsOrFirst: { providerId: string, apiKey?: string, enabled?: boolean, from?: string, name?: string, username?: string } | string,
2161
+ ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
2162
+ ): Promise<Models.Provider> {
2163
+ let params: { providerId: string, apiKey?: string, enabled?: boolean, from?: string, name?: string, username?: string };
2164
+
2165
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2166
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, enabled?: boolean, from?: string, name?: string, username?: string };
2167
+ } else {
2168
+ params = {
2169
+ providerId: paramsOrFirst as string,
2170
+ apiKey: rest[0] as string,
2171
+ enabled: rest[1] as boolean,
2172
+ from: rest[2] as string,
2173
+ name: rest[3] as string,
2174
+ username: rest[4] as string
2175
+ };
2176
+ }
2177
+
2178
+ const providerId = params.providerId;
2179
+ const apiKey = params.apiKey;
2180
+ const enabled = params.enabled;
2181
+ const from = params.from;
2182
+ const name = params.name;
2183
+ const username = params.username;
2184
+
2185
+ if (typeof providerId === 'undefined') {
2186
+ throw new RevenexxException('Missing required parameter: "providerId"');
2187
+ }
2188
+
2189
+ const apiPath = '/v1/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
2190
+ const payload: Payload = {};
2191
+ if (typeof apiKey !== 'undefined') {
2192
+ payload['apiKey'] = apiKey;
2193
+ }
2194
+ if (typeof enabled !== 'undefined') {
2195
+ payload['enabled'] = enabled;
2196
+ }
2197
+ if (typeof from !== 'undefined') {
2198
+ payload['from'] = from;
2199
+ }
2200
+ if (typeof name !== 'undefined') {
2201
+ payload['name'] = name;
2202
+ }
2203
+ if (typeof username !== 'undefined') {
2204
+ payload['username'] = username;
2205
+ }
2206
+ const uri = new URL(this.client.config.endpoint + apiPath);
2207
+
2208
+ const apiHeaders: { [header: string]: string } = {
2209
+ 'content-type': 'application/json',
2210
+ }
2211
+
2212
+ return this.client.call(
2213
+ 'patch',
2214
+ uri,
2215
+ apiHeaders,
2216
+ payload
2217
+ );
2218
+ }
2219
+
2220
+ /**
2221
+ * Create a new Twilio provider.
2222
+ *
2223
+ * @param {string} params.name - Provider name.
2224
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2225
+ * @param {string} params.accountSid - Twilio account secret ID.
2226
+ * @param {string} params.authToken - Twilio authentication token.
2227
+ * @param {boolean} params.enabled - Set as enabled.
2228
+ * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2229
+ * @throws {RevenexxException}
2230
+ * @returns {Promise<Models.Provider>}
2231
+ */
2232
+ messagingCreateTwilioProvider(params: { name: string, providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string }): Promise<Models.Provider>;
2233
+ /**
2234
+ * Create a new Twilio provider.
2235
+ *
2236
+ * @param {string} name - Provider name.
2237
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2238
+ * @param {string} accountSid - Twilio account secret ID.
2239
+ * @param {string} authToken - Twilio authentication token.
2240
+ * @param {boolean} enabled - Set as enabled.
2241
+ * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2242
+ * @throws {RevenexxException}
2243
+ * @returns {Promise<Models.Provider>}
2244
+ * @deprecated Use the object parameter style method for a better developer experience.
2245
+ */
2246
+ messagingCreateTwilioProvider(name: string, providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string): Promise<Models.Provider>;
2247
+ messagingCreateTwilioProvider(
2248
+ paramsOrFirst: { name: string, providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string } | string,
2249
+ ...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?]
2250
+ ): Promise<Models.Provider> {
2251
+ let params: { name: string, providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string };
2252
+
2253
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2254
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string };
2255
+ } else {
2256
+ params = {
2257
+ name: paramsOrFirst as string,
2258
+ providerId: rest[0] as string,
2259
+ accountSid: rest[1] as string,
2260
+ authToken: rest[2] as string,
2261
+ enabled: rest[3] as boolean,
2262
+ from: rest[4] as string
2263
+ };
2264
+ }
2265
+
2266
+ const name = params.name;
2267
+ const providerId = params.providerId;
2268
+ const accountSid = params.accountSid;
2269
+ const authToken = params.authToken;
2270
+ const enabled = params.enabled;
2271
+ const from = params.from;
2272
+
2273
+ if (typeof name === 'undefined') {
2274
+ throw new RevenexxException('Missing required parameter: "name"');
2275
+ }
2276
+ if (typeof providerId === 'undefined') {
2277
+ throw new RevenexxException('Missing required parameter: "providerId"');
2278
+ }
2279
+
2280
+ const apiPath = '/v1/messaging/providers/twilio';
2281
+ const payload: Payload = {};
2282
+ if (typeof accountSid !== 'undefined') {
2283
+ payload['accountSid'] = accountSid;
2284
+ }
2285
+ if (typeof authToken !== 'undefined') {
2286
+ payload['authToken'] = authToken;
2287
+ }
2288
+ if (typeof enabled !== 'undefined') {
2289
+ payload['enabled'] = enabled;
2290
+ }
2291
+ if (typeof from !== 'undefined') {
2292
+ payload['from'] = from;
2293
+ }
2294
+ if (typeof name !== 'undefined') {
2295
+ payload['name'] = name;
2296
+ }
2297
+ if (typeof providerId !== 'undefined') {
2298
+ payload['providerId'] = providerId;
2299
+ }
2300
+ const uri = new URL(this.client.config.endpoint + apiPath);
2301
+
2302
+ const apiHeaders: { [header: string]: string } = {
2303
+ 'content-type': 'application/json',
2304
+ }
2305
+
2306
+ return this.client.call(
2307
+ 'post',
2308
+ uri,
2309
+ apiHeaders,
2310
+ payload
2311
+ );
2312
+ }
2313
+
2314
+ /**
2315
+ * Update a Twilio provider by its unique ID.
2316
+ *
2317
+ * @param {string} params.providerId - Provider ID.
2318
+ * @param {string} params.accountSid - Twilio account secret ID.
2319
+ * @param {string} params.authToken - Twilio authentication token.
2320
+ * @param {boolean} params.enabled - Set as enabled.
2321
+ * @param {string} params.from - Sender number.
2322
+ * @param {string} params.name - Provider name.
2323
+ * @throws {RevenexxException}
2324
+ * @returns {Promise<Models.Provider>}
2325
+ */
2326
+ messagingUpdateTwilioProvider(params: { providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string, name?: string }): Promise<Models.Provider>;
2327
+ /**
2328
+ * Update a Twilio provider by its unique ID.
2329
+ *
2330
+ * @param {string} providerId - Provider ID.
2331
+ * @param {string} accountSid - Twilio account secret ID.
2332
+ * @param {string} authToken - Twilio authentication token.
2333
+ * @param {boolean} enabled - Set as enabled.
2334
+ * @param {string} from - Sender number.
2335
+ * @param {string} name - Provider name.
2336
+ * @throws {RevenexxException}
2337
+ * @returns {Promise<Models.Provider>}
2338
+ * @deprecated Use the object parameter style method for a better developer experience.
2339
+ */
2340
+ messagingUpdateTwilioProvider(providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string, name?: string): Promise<Models.Provider>;
2341
+ messagingUpdateTwilioProvider(
2342
+ paramsOrFirst: { providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string, name?: string } | string,
2343
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
2344
+ ): Promise<Models.Provider> {
2345
+ let params: { providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string, name?: string };
2346
+
2347
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2348
+ params = (paramsOrFirst || {}) as { providerId: string, accountSid?: string, authToken?: string, enabled?: boolean, from?: string, name?: string };
2349
+ } else {
2350
+ params = {
2351
+ providerId: paramsOrFirst as string,
2352
+ accountSid: rest[0] as string,
2353
+ authToken: rest[1] as string,
2354
+ enabled: rest[2] as boolean,
2355
+ from: rest[3] as string,
2356
+ name: rest[4] as string
2357
+ };
2358
+ }
2359
+
2360
+ const providerId = params.providerId;
2361
+ const accountSid = params.accountSid;
2362
+ const authToken = params.authToken;
2363
+ const enabled = params.enabled;
2364
+ const from = params.from;
2365
+ const name = params.name;
2366
+
2367
+ if (typeof providerId === 'undefined') {
2368
+ throw new RevenexxException('Missing required parameter: "providerId"');
2369
+ }
2370
+
2371
+ const apiPath = '/v1/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
2372
+ const payload: Payload = {};
2373
+ if (typeof accountSid !== 'undefined') {
2374
+ payload['accountSid'] = accountSid;
2375
+ }
2376
+ if (typeof authToken !== 'undefined') {
2377
+ payload['authToken'] = authToken;
2378
+ }
2379
+ if (typeof enabled !== 'undefined') {
2380
+ payload['enabled'] = enabled;
2381
+ }
2382
+ if (typeof from !== 'undefined') {
2383
+ payload['from'] = from;
2384
+ }
2385
+ if (typeof name !== 'undefined') {
2386
+ payload['name'] = name;
2387
+ }
2388
+ const uri = new URL(this.client.config.endpoint + apiPath);
2389
+
2390
+ const apiHeaders: { [header: string]: string } = {
2391
+ 'content-type': 'application/json',
2392
+ }
2393
+
2394
+ return this.client.call(
2395
+ 'patch',
2396
+ uri,
2397
+ apiHeaders,
2398
+ payload
2399
+ );
2400
+ }
2401
+
2402
+ /**
2403
+ * Create a new Vonage provider.
2404
+ *
2405
+ * @param {string} params.name - Provider name.
2406
+ * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2407
+ * @param {string} params.apiKey - Vonage API key.
2408
+ * @param {string} params.apiSecret - Vonage API secret.
2409
+ * @param {boolean} params.enabled - Set as enabled.
2410
+ * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2411
+ * @throws {RevenexxException}
2412
+ * @returns {Promise<Models.Provider>}
2413
+ */
2414
+ messagingCreateVonageProvider(params: { name: string, providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string }): Promise<Models.Provider>;
2415
+ /**
2416
+ * Create a new Vonage provider.
2417
+ *
2418
+ * @param {string} name - Provider name.
2419
+ * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2420
+ * @param {string} apiKey - Vonage API key.
2421
+ * @param {string} apiSecret - Vonage API secret.
2422
+ * @param {boolean} enabled - Set as enabled.
2423
+ * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2424
+ * @throws {RevenexxException}
2425
+ * @returns {Promise<Models.Provider>}
2426
+ * @deprecated Use the object parameter style method for a better developer experience.
2427
+ */
2428
+ messagingCreateVonageProvider(name: string, providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string): Promise<Models.Provider>;
2429
+ messagingCreateVonageProvider(
2430
+ paramsOrFirst: { name: string, providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string } | string,
2431
+ ...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?]
2432
+ ): Promise<Models.Provider> {
2433
+ let params: { name: string, providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string };
2434
+
2435
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2436
+ params = (paramsOrFirst || {}) as { name: string, providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string };
2437
+ } else {
2438
+ params = {
2439
+ name: paramsOrFirst as string,
2440
+ providerId: rest[0] as string,
2441
+ apiKey: rest[1] as string,
2442
+ apiSecret: rest[2] as string,
2443
+ enabled: rest[3] as boolean,
2444
+ from: rest[4] as string
2445
+ };
2446
+ }
2447
+
2448
+ const name = params.name;
2449
+ const providerId = params.providerId;
2450
+ const apiKey = params.apiKey;
2451
+ const apiSecret = params.apiSecret;
2452
+ const enabled = params.enabled;
2453
+ const from = params.from;
2454
+
2455
+ if (typeof name === 'undefined') {
2456
+ throw new RevenexxException('Missing required parameter: "name"');
2457
+ }
2458
+ if (typeof providerId === 'undefined') {
2459
+ throw new RevenexxException('Missing required parameter: "providerId"');
2460
+ }
2461
+
2462
+ const apiPath = '/v1/messaging/providers/vonage';
2463
+ const payload: Payload = {};
2464
+ if (typeof apiKey !== 'undefined') {
2465
+ payload['apiKey'] = apiKey;
2466
+ }
2467
+ if (typeof apiSecret !== 'undefined') {
2468
+ payload['apiSecret'] = apiSecret;
2469
+ }
2470
+ if (typeof enabled !== 'undefined') {
2471
+ payload['enabled'] = enabled;
2472
+ }
2473
+ if (typeof from !== 'undefined') {
2474
+ payload['from'] = from;
2475
+ }
2476
+ if (typeof name !== 'undefined') {
2477
+ payload['name'] = name;
2478
+ }
2479
+ if (typeof providerId !== 'undefined') {
2480
+ payload['providerId'] = providerId;
2481
+ }
2482
+ const uri = new URL(this.client.config.endpoint + apiPath);
2483
+
2484
+ const apiHeaders: { [header: string]: string } = {
2485
+ 'content-type': 'application/json',
2486
+ }
2487
+
2488
+ return this.client.call(
2489
+ 'post',
2490
+ uri,
2491
+ apiHeaders,
2492
+ payload
2493
+ );
2494
+ }
2495
+
2496
+ /**
2497
+ * Update a Vonage provider by its unique ID.
2498
+ *
2499
+ * @param {string} params.providerId - Provider ID.
2500
+ * @param {string} params.apiKey - Vonage API key.
2501
+ * @param {string} params.apiSecret - Vonage API secret.
2502
+ * @param {boolean} params.enabled - Set as enabled.
2503
+ * @param {string} params.from - Sender number.
2504
+ * @param {string} params.name - Provider name.
2505
+ * @throws {RevenexxException}
2506
+ * @returns {Promise<Models.Provider>}
2507
+ */
2508
+ messagingUpdateVonageProvider(params: { providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string, name?: string }): Promise<Models.Provider>;
2509
+ /**
2510
+ * Update a Vonage provider by its unique ID.
2511
+ *
2512
+ * @param {string} providerId - Provider ID.
2513
+ * @param {string} apiKey - Vonage API key.
2514
+ * @param {string} apiSecret - Vonage API secret.
2515
+ * @param {boolean} enabled - Set as enabled.
2516
+ * @param {string} from - Sender number.
2517
+ * @param {string} name - Provider name.
2518
+ * @throws {RevenexxException}
2519
+ * @returns {Promise<Models.Provider>}
2520
+ * @deprecated Use the object parameter style method for a better developer experience.
2521
+ */
2522
+ messagingUpdateVonageProvider(providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string, name?: string): Promise<Models.Provider>;
2523
+ messagingUpdateVonageProvider(
2524
+ paramsOrFirst: { providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string, name?: string } | string,
2525
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
2526
+ ): Promise<Models.Provider> {
2527
+ let params: { providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string, name?: string };
2528
+
2529
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2530
+ params = (paramsOrFirst || {}) as { providerId: string, apiKey?: string, apiSecret?: string, enabled?: boolean, from?: string, name?: string };
2531
+ } else {
2532
+ params = {
2533
+ providerId: paramsOrFirst as string,
2534
+ apiKey: rest[0] as string,
2535
+ apiSecret: rest[1] as string,
2536
+ enabled: rest[2] as boolean,
2537
+ from: rest[3] as string,
2538
+ name: rest[4] as string
2539
+ };
2540
+ }
2541
+
2542
+ const providerId = params.providerId;
2543
+ const apiKey = params.apiKey;
2544
+ const apiSecret = params.apiSecret;
2545
+ const enabled = params.enabled;
2546
+ const from = params.from;
2547
+ const name = params.name;
2548
+
2549
+ if (typeof providerId === 'undefined') {
2550
+ throw new RevenexxException('Missing required parameter: "providerId"');
2551
+ }
2552
+
2553
+ const apiPath = '/v1/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
2554
+ const payload: Payload = {};
2555
+ if (typeof apiKey !== 'undefined') {
2556
+ payload['apiKey'] = apiKey;
2557
+ }
2558
+ if (typeof apiSecret !== 'undefined') {
2559
+ payload['apiSecret'] = apiSecret;
2560
+ }
2561
+ if (typeof enabled !== 'undefined') {
2562
+ payload['enabled'] = enabled;
2563
+ }
2564
+ if (typeof from !== 'undefined') {
2565
+ payload['from'] = from;
2566
+ }
2567
+ if (typeof name !== 'undefined') {
2568
+ payload['name'] = name;
2569
+ }
2570
+ const uri = new URL(this.client.config.endpoint + apiPath);
2571
+
2572
+ const apiHeaders: { [header: string]: string } = {
2573
+ 'content-type': 'application/json',
2574
+ }
2575
+
2576
+ return this.client.call(
2577
+ 'patch',
2578
+ uri,
2579
+ apiHeaders,
2580
+ payload
2581
+ );
2582
+ }
2583
+
2584
+ /**
2585
+ * Delete a provider by its unique ID.
2586
+ *
2587
+ * @param {string} params.providerId - Provider ID.
2588
+ * @throws {RevenexxException}
2589
+ * @returns {Promise<{}>}
2590
+ */
2591
+ messagingDeleteProvider(params: { providerId: string }): Promise<{}>;
2592
+ /**
2593
+ * Delete a provider by its unique ID.
2594
+ *
2595
+ * @param {string} providerId - Provider ID.
2596
+ * @throws {RevenexxException}
2597
+ * @returns {Promise<{}>}
2598
+ * @deprecated Use the object parameter style method for a better developer experience.
2599
+ */
2600
+ messagingDeleteProvider(providerId: string): Promise<{}>;
2601
+ messagingDeleteProvider(
2602
+ paramsOrFirst: { providerId: string } | string
2603
+ ): Promise<{}> {
2604
+ let params: { providerId: string };
2605
+
2606
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2607
+ params = (paramsOrFirst || {}) as { providerId: string };
2608
+ } else {
2609
+ params = {
2610
+ providerId: paramsOrFirst as string
2611
+ };
2612
+ }
2613
+
2614
+ const providerId = params.providerId;
2615
+
2616
+ if (typeof providerId === 'undefined') {
2617
+ throw new RevenexxException('Missing required parameter: "providerId"');
2618
+ }
2619
+
2620
+ const apiPath = '/v1/messaging/providers/{providerId}'.replace('{providerId}', providerId);
2621
+ const payload: Payload = {};
2622
+ const uri = new URL(this.client.config.endpoint + apiPath);
2623
+
2624
+ const apiHeaders: { [header: string]: string } = {
2625
+ }
2626
+
2627
+ return this.client.call(
2628
+ 'delete',
2629
+ uri,
2630
+ apiHeaders,
2631
+ payload
2632
+ );
2633
+ }
2634
+
2635
+ /**
2636
+ * Get a provider by its unique ID.
2637
+ *
2638
+ *
2639
+ * @param {string} params.providerId - Provider ID.
2640
+ * @throws {RevenexxException}
2641
+ * @returns {Promise<Models.Provider>}
2642
+ */
2643
+ messagingGetProvider(params: { providerId: string }): Promise<Models.Provider>;
2644
+ /**
2645
+ * Get a provider by its unique ID.
2646
+ *
2647
+ *
2648
+ * @param {string} providerId - Provider ID.
2649
+ * @throws {RevenexxException}
2650
+ * @returns {Promise<Models.Provider>}
2651
+ * @deprecated Use the object parameter style method for a better developer experience.
2652
+ */
2653
+ messagingGetProvider(providerId: string): Promise<Models.Provider>;
2654
+ messagingGetProvider(
2655
+ paramsOrFirst: { providerId: string } | string
2656
+ ): Promise<Models.Provider> {
2657
+ let params: { providerId: string };
2658
+
2659
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2660
+ params = (paramsOrFirst || {}) as { providerId: string };
2661
+ } else {
2662
+ params = {
2663
+ providerId: paramsOrFirst as string
2664
+ };
2665
+ }
2666
+
2667
+ const providerId = params.providerId;
2668
+
2669
+ if (typeof providerId === 'undefined') {
2670
+ throw new RevenexxException('Missing required parameter: "providerId"');
2671
+ }
2672
+
2673
+ const apiPath = '/v1/messaging/providers/{providerId}'.replace('{providerId}', providerId);
2674
+ const payload: Payload = {};
2675
+ const uri = new URL(this.client.config.endpoint + apiPath);
2676
+
2677
+ const apiHeaders: { [header: string]: string } = {
2678
+ }
2679
+
2680
+ return this.client.call(
2681
+ 'get',
2682
+ uri,
2683
+ apiHeaders,
2684
+ payload
2685
+ );
2686
+ }
2687
+
2688
+ /**
2689
+ * Get the provider activity logs listed by its unique ID.
2690
+ *
2691
+ * @param {string} params.providerId - Provider ID.
2692
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2693
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2694
+ * @throws {RevenexxException}
2695
+ * @returns {Promise<Models.LogList>}
2696
+ */
2697
+ messagingListProviderLogs(params: { providerId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
2698
+ /**
2699
+ * Get the provider activity logs listed by its unique ID.
2700
+ *
2701
+ * @param {string} providerId - Provider ID.
2702
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2703
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2704
+ * @throws {RevenexxException}
2705
+ * @returns {Promise<Models.LogList>}
2706
+ * @deprecated Use the object parameter style method for a better developer experience.
2707
+ */
2708
+ messagingListProviderLogs(providerId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
2709
+ messagingListProviderLogs(
2710
+ paramsOrFirst: { providerId: string, queries?: string[], total?: boolean } | string,
2711
+ ...rest: [(string[])?, (boolean)?]
2712
+ ): Promise<Models.LogList> {
2713
+ let params: { providerId: string, queries?: string[], total?: boolean };
2714
+
2715
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2716
+ params = (paramsOrFirst || {}) as { providerId: string, queries?: string[], total?: boolean };
2717
+ } else {
2718
+ params = {
2719
+ providerId: paramsOrFirst as string,
2720
+ queries: rest[0] as string[],
2721
+ total: rest[1] as boolean
2722
+ };
2723
+ }
2724
+
2725
+ const providerId = params.providerId;
2726
+ const queries = params.queries;
2727
+ const total = params.total;
2728
+
2729
+ if (typeof providerId === 'undefined') {
2730
+ throw new RevenexxException('Missing required parameter: "providerId"');
2731
+ }
2732
+
2733
+ const apiPath = '/v1/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
2734
+ const payload: Payload = {};
2735
+ if (typeof queries !== 'undefined') {
2736
+ payload['queries'] = queries;
2737
+ }
2738
+ if (typeof total !== 'undefined') {
2739
+ payload['total'] = total;
2740
+ }
2741
+ const uri = new URL(this.client.config.endpoint + apiPath);
2742
+
2743
+ const apiHeaders: { [header: string]: string } = {
2744
+ }
2745
+
2746
+ return this.client.call(
2747
+ 'get',
2748
+ uri,
2749
+ apiHeaders,
2750
+ payload
2751
+ );
2752
+ }
2753
+
2754
+ /**
2755
+ * Get the subscriber activity logs listed by its unique ID.
2756
+ *
2757
+ * @param {string} params.subscriberId - Subscriber ID.
2758
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2759
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2760
+ * @throws {RevenexxException}
2761
+ * @returns {Promise<Models.LogList>}
2762
+ */
2763
+ messagingListSubscriberLogs(params: { subscriberId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
2764
+ /**
2765
+ * Get the subscriber activity logs listed by its unique ID.
2766
+ *
2767
+ * @param {string} subscriberId - Subscriber ID.
2768
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2769
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2770
+ * @throws {RevenexxException}
2771
+ * @returns {Promise<Models.LogList>}
2772
+ * @deprecated Use the object parameter style method for a better developer experience.
2773
+ */
2774
+ messagingListSubscriberLogs(subscriberId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
2775
+ messagingListSubscriberLogs(
2776
+ paramsOrFirst: { subscriberId: string, queries?: string[], total?: boolean } | string,
2777
+ ...rest: [(string[])?, (boolean)?]
2778
+ ): Promise<Models.LogList> {
2779
+ let params: { subscriberId: string, queries?: string[], total?: boolean };
2780
+
2781
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2782
+ params = (paramsOrFirst || {}) as { subscriberId: string, queries?: string[], total?: boolean };
2783
+ } else {
2784
+ params = {
2785
+ subscriberId: paramsOrFirst as string,
2786
+ queries: rest[0] as string[],
2787
+ total: rest[1] as boolean
2788
+ };
2789
+ }
2790
+
2791
+ const subscriberId = params.subscriberId;
2792
+ const queries = params.queries;
2793
+ const total = params.total;
2794
+
2795
+ if (typeof subscriberId === 'undefined') {
2796
+ throw new RevenexxException('Missing required parameter: "subscriberId"');
2797
+ }
2798
+
2799
+ const apiPath = '/v1/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
2800
+ const payload: Payload = {};
2801
+ if (typeof queries !== 'undefined') {
2802
+ payload['queries'] = queries;
2803
+ }
2804
+ if (typeof total !== 'undefined') {
2805
+ payload['total'] = total;
2806
+ }
2807
+ const uri = new URL(this.client.config.endpoint + apiPath);
2808
+
2809
+ const apiHeaders: { [header: string]: string } = {
2810
+ }
2811
+
2812
+ return this.client.call(
2813
+ 'get',
2814
+ uri,
2815
+ apiHeaders,
2816
+ payload
2817
+ );
2818
+ }
2819
+
2820
+ /**
2821
+ * Get a list of all topics from the current Revenexx project.
2822
+ *
2823
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
2824
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
2825
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2826
+ * @throws {RevenexxException}
2827
+ * @returns {Promise<Models.TopicList>}
2828
+ */
2829
+ messagingListTopics(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.TopicList>;
2830
+ /**
2831
+ * Get a list of all topics from the current Revenexx project.
2832
+ *
2833
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
2834
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
2835
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2836
+ * @throws {RevenexxException}
2837
+ * @returns {Promise<Models.TopicList>}
2838
+ * @deprecated Use the object parameter style method for a better developer experience.
2839
+ */
2840
+ messagingListTopics(queries?: string[], search?: string, total?: boolean): Promise<Models.TopicList>;
2841
+ messagingListTopics(
2842
+ paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
2843
+ ...rest: [(string)?, (boolean)?]
2844
+ ): Promise<Models.TopicList> {
2845
+ let params: { queries?: string[], search?: string, total?: boolean };
2846
+
2847
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2848
+ params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
2849
+ } else {
2850
+ params = {
2851
+ queries: paramsOrFirst as string[],
2852
+ search: rest[0] as string,
2853
+ total: rest[1] as boolean
2854
+ };
2855
+ }
2856
+
2857
+ const queries = params.queries;
2858
+ const search = params.search;
2859
+ const total = params.total;
2860
+
2861
+
2862
+ const apiPath = '/v1/messaging/topics';
2863
+ const payload: Payload = {};
2864
+ if (typeof queries !== 'undefined') {
2865
+ payload['queries'] = queries;
2866
+ }
2867
+ if (typeof search !== 'undefined') {
2868
+ payload['search'] = search;
2869
+ }
2870
+ if (typeof total !== 'undefined') {
2871
+ payload['total'] = total;
2872
+ }
2873
+ const uri = new URL(this.client.config.endpoint + apiPath);
2874
+
2875
+ const apiHeaders: { [header: string]: string } = {
2876
+ }
2877
+
2878
+ return this.client.call(
2879
+ 'get',
2880
+ uri,
2881
+ apiHeaders,
2882
+ payload
2883
+ );
2884
+ }
2885
+
2886
+ /**
2887
+ * Create a new topic.
2888
+ *
2889
+ * @param {string} params.name - Topic Name.
2890
+ * @param {string} params.topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
2891
+ * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2892
+ * @throws {RevenexxException}
2893
+ * @returns {Promise<Models.Topic>}
2894
+ */
2895
+ messagingCreateTopic(params: { name: string, topicId: string, subscribe?: string[] }): Promise<Models.Topic>;
2896
+ /**
2897
+ * Create a new topic.
2898
+ *
2899
+ * @param {string} name - Topic Name.
2900
+ * @param {string} topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
2901
+ * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2902
+ * @throws {RevenexxException}
2903
+ * @returns {Promise<Models.Topic>}
2904
+ * @deprecated Use the object parameter style method for a better developer experience.
2905
+ */
2906
+ messagingCreateTopic(name: string, topicId: string, subscribe?: string[]): Promise<Models.Topic>;
2907
+ messagingCreateTopic(
2908
+ paramsOrFirst: { name: string, topicId: string, subscribe?: string[] } | string,
2909
+ ...rest: [(string)?, (string[])?]
2910
+ ): Promise<Models.Topic> {
2911
+ let params: { name: string, topicId: string, subscribe?: string[] };
2912
+
2913
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2914
+ params = (paramsOrFirst || {}) as { name: string, topicId: string, subscribe?: string[] };
2915
+ } else {
2916
+ params = {
2917
+ name: paramsOrFirst as string,
2918
+ topicId: rest[0] as string,
2919
+ subscribe: rest[1] as string[]
2920
+ };
2921
+ }
2922
+
2923
+ const name = params.name;
2924
+ const topicId = params.topicId;
2925
+ const subscribe = params.subscribe;
2926
+
2927
+ if (typeof name === 'undefined') {
2928
+ throw new RevenexxException('Missing required parameter: "name"');
2929
+ }
2930
+ if (typeof topicId === 'undefined') {
2931
+ throw new RevenexxException('Missing required parameter: "topicId"');
2932
+ }
2933
+
2934
+ const apiPath = '/v1/messaging/topics';
2935
+ const payload: Payload = {};
2936
+ if (typeof name !== 'undefined') {
2937
+ payload['name'] = name;
2938
+ }
2939
+ if (typeof subscribe !== 'undefined') {
2940
+ payload['subscribe'] = subscribe;
2941
+ }
2942
+ if (typeof topicId !== 'undefined') {
2943
+ payload['topicId'] = topicId;
2944
+ }
2945
+ const uri = new URL(this.client.config.endpoint + apiPath);
2946
+
2947
+ const apiHeaders: { [header: string]: string } = {
2948
+ 'content-type': 'application/json',
2949
+ }
2950
+
2951
+ return this.client.call(
2952
+ 'post',
2953
+ uri,
2954
+ apiHeaders,
2955
+ payload
2956
+ );
2957
+ }
2958
+
2959
+ /**
2960
+ * Delete a topic by its unique ID.
2961
+ *
2962
+ * @param {string} params.topicId - Topic ID.
2963
+ * @throws {RevenexxException}
2964
+ * @returns {Promise<{}>}
2965
+ */
2966
+ messagingDeleteTopic(params: { topicId: string }): Promise<{}>;
2967
+ /**
2968
+ * Delete a topic by its unique ID.
2969
+ *
2970
+ * @param {string} topicId - Topic ID.
2971
+ * @throws {RevenexxException}
2972
+ * @returns {Promise<{}>}
2973
+ * @deprecated Use the object parameter style method for a better developer experience.
2974
+ */
2975
+ messagingDeleteTopic(topicId: string): Promise<{}>;
2976
+ messagingDeleteTopic(
2977
+ paramsOrFirst: { topicId: string } | string
2978
+ ): Promise<{}> {
2979
+ let params: { topicId: string };
2980
+
2981
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2982
+ params = (paramsOrFirst || {}) as { topicId: string };
2983
+ } else {
2984
+ params = {
2985
+ topicId: paramsOrFirst as string
2986
+ };
2987
+ }
2988
+
2989
+ const topicId = params.topicId;
2990
+
2991
+ if (typeof topicId === 'undefined') {
2992
+ throw new RevenexxException('Missing required parameter: "topicId"');
2993
+ }
2994
+
2995
+ const apiPath = '/v1/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2996
+ const payload: Payload = {};
2997
+ const uri = new URL(this.client.config.endpoint + apiPath);
2998
+
2999
+ const apiHeaders: { [header: string]: string } = {
3000
+ }
3001
+
3002
+ return this.client.call(
3003
+ 'delete',
3004
+ uri,
3005
+ apiHeaders,
3006
+ payload
3007
+ );
3008
+ }
3009
+
3010
+ /**
3011
+ * Get a topic by its unique ID.
3012
+ *
3013
+ *
3014
+ * @param {string} params.topicId - Topic ID.
3015
+ * @throws {RevenexxException}
3016
+ * @returns {Promise<Models.Topic>}
3017
+ */
3018
+ messagingGetTopic(params: { topicId: string }): Promise<Models.Topic>;
3019
+ /**
3020
+ * Get a topic by its unique ID.
3021
+ *
3022
+ *
3023
+ * @param {string} topicId - Topic ID.
3024
+ * @throws {RevenexxException}
3025
+ * @returns {Promise<Models.Topic>}
3026
+ * @deprecated Use the object parameter style method for a better developer experience.
3027
+ */
3028
+ messagingGetTopic(topicId: string): Promise<Models.Topic>;
3029
+ messagingGetTopic(
3030
+ paramsOrFirst: { topicId: string } | string
3031
+ ): Promise<Models.Topic> {
3032
+ let params: { topicId: string };
3033
+
3034
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3035
+ params = (paramsOrFirst || {}) as { topicId: string };
3036
+ } else {
3037
+ params = {
3038
+ topicId: paramsOrFirst as string
3039
+ };
3040
+ }
3041
+
3042
+ const topicId = params.topicId;
3043
+
3044
+ if (typeof topicId === 'undefined') {
3045
+ throw new RevenexxException('Missing required parameter: "topicId"');
3046
+ }
3047
+
3048
+ const apiPath = '/v1/messaging/topics/{topicId}'.replace('{topicId}', topicId);
3049
+ const payload: Payload = {};
3050
+ const uri = new URL(this.client.config.endpoint + apiPath);
3051
+
3052
+ const apiHeaders: { [header: string]: string } = {
3053
+ }
3054
+
3055
+ return this.client.call(
3056
+ 'get',
3057
+ uri,
3058
+ apiHeaders,
3059
+ payload
3060
+ );
3061
+ }
3062
+
3063
+ /**
3064
+ * Update a topic by its unique ID.
3065
+ *
3066
+ *
3067
+ * @param {string} params.topicId - Topic ID.
3068
+ * @param {string} params.name - Topic Name.
3069
+ * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
3070
+ * @throws {RevenexxException}
3071
+ * @returns {Promise<Models.Topic>}
3072
+ */
3073
+ messagingUpdateTopic(params: { topicId: string, name?: string, subscribe?: string[] }): Promise<Models.Topic>;
3074
+ /**
3075
+ * Update a topic by its unique ID.
3076
+ *
3077
+ *
3078
+ * @param {string} topicId - Topic ID.
3079
+ * @param {string} name - Topic Name.
3080
+ * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
3081
+ * @throws {RevenexxException}
3082
+ * @returns {Promise<Models.Topic>}
3083
+ * @deprecated Use the object parameter style method for a better developer experience.
3084
+ */
3085
+ messagingUpdateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic>;
3086
+ messagingUpdateTopic(
3087
+ paramsOrFirst: { topicId: string, name?: string, subscribe?: string[] } | string,
3088
+ ...rest: [(string)?, (string[])?]
3089
+ ): Promise<Models.Topic> {
3090
+ let params: { topicId: string, name?: string, subscribe?: string[] };
3091
+
3092
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3093
+ params = (paramsOrFirst || {}) as { topicId: string, name?: string, subscribe?: string[] };
3094
+ } else {
3095
+ params = {
3096
+ topicId: paramsOrFirst as string,
3097
+ name: rest[0] as string,
3098
+ subscribe: rest[1] as string[]
3099
+ };
3100
+ }
3101
+
3102
+ const topicId = params.topicId;
3103
+ const name = params.name;
3104
+ const subscribe = params.subscribe;
3105
+
3106
+ if (typeof topicId === 'undefined') {
3107
+ throw new RevenexxException('Missing required parameter: "topicId"');
3108
+ }
3109
+
3110
+ const apiPath = '/v1/messaging/topics/{topicId}'.replace('{topicId}', topicId);
3111
+ const payload: Payload = {};
3112
+ if (typeof name !== 'undefined') {
3113
+ payload['name'] = name;
3114
+ }
3115
+ if (typeof subscribe !== 'undefined') {
3116
+ payload['subscribe'] = subscribe;
3117
+ }
3118
+ const uri = new URL(this.client.config.endpoint + apiPath);
3119
+
3120
+ const apiHeaders: { [header: string]: string } = {
3121
+ 'content-type': 'application/json',
3122
+ }
3123
+
3124
+ return this.client.call(
3125
+ 'patch',
3126
+ uri,
3127
+ apiHeaders,
3128
+ payload
3129
+ );
3130
+ }
3131
+
3132
+ /**
3133
+ * Get the topic activity logs listed by its unique ID.
3134
+ *
3135
+ * @param {string} params.topicId - Topic ID.
3136
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
3137
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
3138
+ * @throws {RevenexxException}
3139
+ * @returns {Promise<Models.LogList>}
3140
+ */
3141
+ messagingListTopicLogs(params: { topicId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
3142
+ /**
3143
+ * Get the topic activity logs listed by its unique ID.
3144
+ *
3145
+ * @param {string} topicId - Topic ID.
3146
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
3147
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
3148
+ * @throws {RevenexxException}
3149
+ * @returns {Promise<Models.LogList>}
3150
+ * @deprecated Use the object parameter style method for a better developer experience.
3151
+ */
3152
+ messagingListTopicLogs(topicId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
3153
+ messagingListTopicLogs(
3154
+ paramsOrFirst: { topicId: string, queries?: string[], total?: boolean } | string,
3155
+ ...rest: [(string[])?, (boolean)?]
3156
+ ): Promise<Models.LogList> {
3157
+ let params: { topicId: string, queries?: string[], total?: boolean };
3158
+
3159
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3160
+ params = (paramsOrFirst || {}) as { topicId: string, queries?: string[], total?: boolean };
3161
+ } else {
3162
+ params = {
3163
+ topicId: paramsOrFirst as string,
3164
+ queries: rest[0] as string[],
3165
+ total: rest[1] as boolean
3166
+ };
3167
+ }
3168
+
3169
+ const topicId = params.topicId;
3170
+ const queries = params.queries;
3171
+ const total = params.total;
3172
+
3173
+ if (typeof topicId === 'undefined') {
3174
+ throw new RevenexxException('Missing required parameter: "topicId"');
3175
+ }
3176
+
3177
+ const apiPath = '/v1/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
3178
+ const payload: Payload = {};
3179
+ if (typeof queries !== 'undefined') {
3180
+ payload['queries'] = queries;
3181
+ }
3182
+ if (typeof total !== 'undefined') {
3183
+ payload['total'] = total;
3184
+ }
3185
+ const uri = new URL(this.client.config.endpoint + apiPath);
3186
+
3187
+ const apiHeaders: { [header: string]: string } = {
3188
+ }
3189
+
3190
+ return this.client.call(
3191
+ 'get',
3192
+ uri,
3193
+ apiHeaders,
3194
+ payload
3195
+ );
3196
+ }
3197
+
3198
+ /**
3199
+ * Get a list of all subscribers from the current Revenexx project.
3200
+ *
3201
+ * @param {string} params.topicId - Topic ID. The topic ID subscribed to.
3202
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
3203
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
3204
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
3205
+ * @throws {RevenexxException}
3206
+ * @returns {Promise<Models.SubscriberList>}
3207
+ */
3208
+ messagingListSubscribers(params: { topicId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.SubscriberList>;
3209
+ /**
3210
+ * Get a list of all subscribers from the current Revenexx project.
3211
+ *
3212
+ * @param {string} topicId - Topic ID. The topic ID subscribed to.
3213
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
3214
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
3215
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
3216
+ * @throws {RevenexxException}
3217
+ * @returns {Promise<Models.SubscriberList>}
3218
+ * @deprecated Use the object parameter style method for a better developer experience.
3219
+ */
3220
+ messagingListSubscribers(topicId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.SubscriberList>;
3221
+ messagingListSubscribers(
3222
+ paramsOrFirst: { topicId: string, queries?: string[], search?: string, total?: boolean } | string,
3223
+ ...rest: [(string[])?, (string)?, (boolean)?]
3224
+ ): Promise<Models.SubscriberList> {
3225
+ let params: { topicId: string, queries?: string[], search?: string, total?: boolean };
3226
+
3227
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3228
+ params = (paramsOrFirst || {}) as { topicId: string, queries?: string[], search?: string, total?: boolean };
3229
+ } else {
3230
+ params = {
3231
+ topicId: paramsOrFirst as string,
3232
+ queries: rest[0] as string[],
3233
+ search: rest[1] as string,
3234
+ total: rest[2] as boolean
3235
+ };
3236
+ }
3237
+
3238
+ const topicId = params.topicId;
3239
+ const queries = params.queries;
3240
+ const search = params.search;
3241
+ const total = params.total;
3242
+
3243
+ if (typeof topicId === 'undefined') {
3244
+ throw new RevenexxException('Missing required parameter: "topicId"');
3245
+ }
3246
+
3247
+ const apiPath = '/v1/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
3248
+ const payload: Payload = {};
3249
+ if (typeof queries !== 'undefined') {
3250
+ payload['queries'] = queries;
3251
+ }
3252
+ if (typeof search !== 'undefined') {
3253
+ payload['search'] = search;
3254
+ }
3255
+ if (typeof total !== 'undefined') {
3256
+ payload['total'] = total;
3257
+ }
3258
+ const uri = new URL(this.client.config.endpoint + apiPath);
3259
+
3260
+ const apiHeaders: { [header: string]: string } = {
3261
+ }
3262
+
3263
+ return this.client.call(
3264
+ 'get',
3265
+ uri,
3266
+ apiHeaders,
3267
+ payload
3268
+ );
3269
+ }
3270
+
3271
+ /**
3272
+ * Create a new subscriber.
3273
+ *
3274
+ * @param {string} params.topicId - Topic ID. The topic ID to subscribe to.
3275
+ * @param {string} params.subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
3276
+ * @param {string} params.targetId - Target ID. The target ID to link to the specified Topic ID.
3277
+ * @throws {RevenexxException}
3278
+ * @returns {Promise<Models.Subscriber>}
3279
+ */
3280
+ messagingCreateSubscriber(params: { topicId: string, subscriberId: string, targetId: string }): Promise<Models.Subscriber>;
3281
+ /**
3282
+ * Create a new subscriber.
3283
+ *
3284
+ * @param {string} topicId - Topic ID. The topic ID to subscribe to.
3285
+ * @param {string} subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
3286
+ * @param {string} targetId - Target ID. The target ID to link to the specified Topic ID.
3287
+ * @throws {RevenexxException}
3288
+ * @returns {Promise<Models.Subscriber>}
3289
+ * @deprecated Use the object parameter style method for a better developer experience.
3290
+ */
3291
+ messagingCreateSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
3292
+ messagingCreateSubscriber(
3293
+ paramsOrFirst: { topicId: string, subscriberId: string, targetId: string } | string,
3294
+ ...rest: [(string)?, (string)?]
3295
+ ): Promise<Models.Subscriber> {
3296
+ let params: { topicId: string, subscriberId: string, targetId: string };
3297
+
3298
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3299
+ params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string, targetId: string };
3300
+ } else {
3301
+ params = {
3302
+ topicId: paramsOrFirst as string,
3303
+ subscriberId: rest[0] as string,
3304
+ targetId: rest[1] as string
3305
+ };
3306
+ }
3307
+
3308
+ const topicId = params.topicId;
3309
+ const subscriberId = params.subscriberId;
3310
+ const targetId = params.targetId;
3311
+
3312
+ if (typeof topicId === 'undefined') {
3313
+ throw new RevenexxException('Missing required parameter: "topicId"');
3314
+ }
3315
+ if (typeof subscriberId === 'undefined') {
3316
+ throw new RevenexxException('Missing required parameter: "subscriberId"');
3317
+ }
3318
+ if (typeof targetId === 'undefined') {
3319
+ throw new RevenexxException('Missing required parameter: "targetId"');
3320
+ }
3321
+
3322
+ const apiPath = '/v1/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
3323
+ const payload: Payload = {};
3324
+ if (typeof subscriberId !== 'undefined') {
3325
+ payload['subscriberId'] = subscriberId;
3326
+ }
3327
+ if (typeof targetId !== 'undefined') {
3328
+ payload['targetId'] = targetId;
3329
+ }
3330
+ const uri = new URL(this.client.config.endpoint + apiPath);
3331
+
3332
+ const apiHeaders: { [header: string]: string } = {
3333
+ 'content-type': 'application/json',
3334
+ }
3335
+
3336
+ return this.client.call(
3337
+ 'post',
3338
+ uri,
3339
+ apiHeaders,
3340
+ payload
3341
+ );
3342
+ }
3343
+
3344
+ /**
3345
+ * Delete a subscriber by its unique ID.
3346
+ *
3347
+ * @param {string} params.topicId - Topic ID. The topic ID subscribed to.
3348
+ * @param {string} params.subscriberId - Subscriber ID.
3349
+ * @throws {RevenexxException}
3350
+ * @returns {Promise<{}>}
3351
+ */
3352
+ messagingDeleteSubscriber(params: { topicId: string, subscriberId: string }): Promise<{}>;
3353
+ /**
3354
+ * Delete a subscriber by its unique ID.
3355
+ *
3356
+ * @param {string} topicId - Topic ID. The topic ID subscribed to.
3357
+ * @param {string} subscriberId - Subscriber ID.
3358
+ * @throws {RevenexxException}
3359
+ * @returns {Promise<{}>}
3360
+ * @deprecated Use the object parameter style method for a better developer experience.
3361
+ */
3362
+ messagingDeleteSubscriber(topicId: string, subscriberId: string): Promise<{}>;
3363
+ messagingDeleteSubscriber(
3364
+ paramsOrFirst: { topicId: string, subscriberId: string } | string,
3365
+ ...rest: [(string)?]
3366
+ ): Promise<{}> {
3367
+ let params: { topicId: string, subscriberId: string };
3368
+
3369
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3370
+ params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string };
3371
+ } else {
3372
+ params = {
3373
+ topicId: paramsOrFirst as string,
3374
+ subscriberId: rest[0] as string
3375
+ };
3376
+ }
3377
+
3378
+ const topicId = params.topicId;
3379
+ const subscriberId = params.subscriberId;
3380
+
3381
+ if (typeof topicId === 'undefined') {
3382
+ throw new RevenexxException('Missing required parameter: "topicId"');
3383
+ }
3384
+ if (typeof subscriberId === 'undefined') {
3385
+ throw new RevenexxException('Missing required parameter: "subscriberId"');
3386
+ }
3387
+
3388
+ const apiPath = '/v1/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
3389
+ const payload: Payload = {};
3390
+ const uri = new URL(this.client.config.endpoint + apiPath);
3391
+
3392
+ const apiHeaders: { [header: string]: string } = {
3393
+ }
3394
+
3395
+ return this.client.call(
3396
+ 'delete',
3397
+ uri,
3398
+ apiHeaders,
3399
+ payload
3400
+ );
3401
+ }
3402
+
3403
+ /**
3404
+ * Get a subscriber by its unique ID.
3405
+ *
3406
+ *
3407
+ * @param {string} params.topicId - Topic ID. The topic ID subscribed to.
3408
+ * @param {string} params.subscriberId - Subscriber ID.
3409
+ * @throws {RevenexxException}
3410
+ * @returns {Promise<Models.Subscriber>}
3411
+ */
3412
+ messagingGetSubscriber(params: { topicId: string, subscriberId: string }): Promise<Models.Subscriber>;
3413
+ /**
3414
+ * Get a subscriber by its unique ID.
3415
+ *
3416
+ *
3417
+ * @param {string} topicId - Topic ID. The topic ID subscribed to.
3418
+ * @param {string} subscriberId - Subscriber ID.
3419
+ * @throws {RevenexxException}
3420
+ * @returns {Promise<Models.Subscriber>}
3421
+ * @deprecated Use the object parameter style method for a better developer experience.
3422
+ */
3423
+ messagingGetSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber>;
3424
+ messagingGetSubscriber(
3425
+ paramsOrFirst: { topicId: string, subscriberId: string } | string,
3426
+ ...rest: [(string)?]
3427
+ ): Promise<Models.Subscriber> {
3428
+ let params: { topicId: string, subscriberId: string };
3429
+
3430
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3431
+ params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string };
3432
+ } else {
3433
+ params = {
3434
+ topicId: paramsOrFirst as string,
3435
+ subscriberId: rest[0] as string
3436
+ };
3437
+ }
3438
+
3439
+ const topicId = params.topicId;
3440
+ const subscriberId = params.subscriberId;
3441
+
3442
+ if (typeof topicId === 'undefined') {
3443
+ throw new RevenexxException('Missing required parameter: "topicId"');
3444
+ }
3445
+ if (typeof subscriberId === 'undefined') {
3446
+ throw new RevenexxException('Missing required parameter: "subscriberId"');
3447
+ }
3448
+
3449
+ const apiPath = '/v1/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
3450
+ const payload: Payload = {};
3451
+ const uri = new URL(this.client.config.endpoint + apiPath);
3452
+
3453
+ const apiHeaders: { [header: string]: string } = {
3454
+ }
3455
+
3456
+ return this.client.call(
3457
+ 'get',
3458
+ uri,
3459
+ apiHeaders,
3460
+ payload
3461
+ );
3462
+ }
3463
+ }