postgrid-node 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (238) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +25 -39
  3. package/core.d.ts +7 -4
  4. package/core.d.ts.map +1 -1
  5. package/core.js +16 -9
  6. package/core.js.map +1 -1
  7. package/core.mjs +16 -9
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +21 -8
  10. package/index.d.ts +21 -8
  11. package/index.d.ts.map +1 -1
  12. package/index.js +28 -5
  13. package/index.js.map +1 -1
  14. package/index.mjs +28 -5
  15. package/index.mjs.map +1 -1
  16. package/internal/qs/formats.d.ts +6 -0
  17. package/internal/qs/formats.d.ts.map +1 -0
  18. package/internal/qs/formats.js +11 -0
  19. package/internal/qs/formats.js.map +1 -0
  20. package/internal/qs/formats.mjs +8 -0
  21. package/internal/qs/formats.mjs.map +1 -0
  22. package/internal/qs/index.d.ts +10 -0
  23. package/internal/qs/index.d.ts.map +1 -0
  24. package/internal/qs/index.js +14 -0
  25. package/internal/qs/index.js.map +1 -0
  26. package/internal/qs/index.mjs +10 -0
  27. package/internal/qs/index.mjs.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +280 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +276 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.ts +57 -0
  35. package/internal/qs/types.d.ts.map +1 -0
  36. package/internal/qs/types.js +3 -0
  37. package/internal/qs/types.js.map +1 -0
  38. package/internal/qs/types.mjs +2 -0
  39. package/internal/qs/types.mjs.map +1 -0
  40. package/internal/qs/utils.d.ts +14 -0
  41. package/internal/qs/utils.d.ts.map +1 -0
  42. package/internal/qs/utils.js +229 -0
  43. package/internal/qs/utils.js.map +1 -0
  44. package/internal/qs/utils.mjs +217 -0
  45. package/internal/qs/utils.mjs.map +1 -0
  46. package/package.json +1 -1
  47. package/pagination.d.ts +2 -0
  48. package/pagination.d.ts.map +1 -1
  49. package/pagination.js +2 -1
  50. package/pagination.js.map +1 -1
  51. package/pagination.mjs +2 -1
  52. package/pagination.mjs.map +1 -1
  53. package/resource.d.ts +1 -1
  54. package/resource.d.ts.map +1 -1
  55. package/resource.js.map +1 -1
  56. package/resource.mjs.map +1 -1
  57. package/resources/bank-accounts.d.ts +61 -4
  58. package/resources/bank-accounts.d.ts.map +1 -1
  59. package/resources/bank-accounts.js +25 -0
  60. package/resources/bank-accounts.js.map +1 -1
  61. package/resources/bank-accounts.mjs +25 -0
  62. package/resources/bank-accounts.mjs.map +1 -1
  63. package/resources/boxes.d.ts +80 -15
  64. package/resources/boxes.d.ts.map +1 -1
  65. package/resources/boxes.js +27 -0
  66. package/resources/boxes.js.map +1 -1
  67. package/resources/boxes.mjs +27 -0
  68. package/resources/boxes.mjs.map +1 -1
  69. package/resources/campaigns.d.ts +21 -7
  70. package/resources/campaigns.d.ts.map +1 -1
  71. package/resources/cheques/cheques.d.ts +43 -4
  72. package/resources/cheques/cheques.d.ts.map +1 -1
  73. package/resources/cheques/cheques.js +23 -0
  74. package/resources/cheques/cheques.js.map +1 -1
  75. package/resources/cheques/cheques.mjs +23 -0
  76. package/resources/cheques/cheques.mjs.map +1 -1
  77. package/resources/cheques/url.d.ts +5 -0
  78. package/resources/cheques/url.d.ts.map +1 -1
  79. package/resources/cheques/url.js +5 -0
  80. package/resources/cheques/url.js.map +1 -1
  81. package/resources/cheques/url.mjs +5 -0
  82. package/resources/cheques/url.mjs.map +1 -1
  83. package/resources/cheques/with-deposit-ready-pdf.d.ts +6 -0
  84. package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -1
  85. package/resources/cheques/with-deposit-ready-pdf.js +6 -0
  86. package/resources/cheques/with-deposit-ready-pdf.js.map +1 -1
  87. package/resources/cheques/with-deposit-ready-pdf.mjs +6 -0
  88. package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -1
  89. package/resources/contacts.d.ts +37 -3
  90. package/resources/contacts.d.ts.map +1 -1
  91. package/resources/contacts.js +20 -0
  92. package/resources/contacts.js.map +1 -1
  93. package/resources/contacts.mjs +20 -0
  94. package/resources/contacts.mjs.map +1 -1
  95. package/resources/index.d.ts +5 -1
  96. package/resources/index.d.ts.map +1 -1
  97. package/resources/index.js +12 -1
  98. package/resources/index.js.map +1 -1
  99. package/resources/index.mjs +4 -0
  100. package/resources/index.mjs.map +1 -1
  101. package/resources/letters.d.ts +50 -6
  102. package/resources/letters.d.ts.map +1 -1
  103. package/resources/letters.js +24 -0
  104. package/resources/letters.js.map +1 -1
  105. package/resources/letters.mjs +24 -0
  106. package/resources/letters.mjs.map +1 -1
  107. package/resources/mailing-list-imports.d.ts +919 -0
  108. package/resources/mailing-list-imports.d.ts.map +1 -0
  109. package/resources/mailing-list-imports.js +95 -0
  110. package/resources/mailing-list-imports.js.map +1 -0
  111. package/resources/mailing-list-imports.mjs +90 -0
  112. package/resources/mailing-list-imports.mjs.map +1 -0
  113. package/resources/mailing-lists.d.ts +398 -0
  114. package/resources/mailing-lists.d.ts.map +1 -0
  115. package/resources/mailing-lists.js +101 -0
  116. package/resources/mailing-lists.js.map +1 -0
  117. package/resources/mailing-lists.mjs +96 -0
  118. package/resources/mailing-lists.mjs.map +1 -0
  119. package/resources/order-profiles/cheques.d.ts +588 -0
  120. package/resources/order-profiles/cheques.d.ts.map +1 -0
  121. package/resources/order-profiles/cheques.js +74 -0
  122. package/resources/order-profiles/cheques.js.map +1 -0
  123. package/resources/order-profiles/cheques.mjs +69 -0
  124. package/resources/order-profiles/cheques.mjs.map +1 -0
  125. package/resources/order-profiles/index.d.ts +6 -0
  126. package/resources/order-profiles/index.d.ts.map +1 -0
  127. package/resources/order-profiles/index.js +19 -0
  128. package/resources/order-profiles/index.js.map +1 -0
  129. package/resources/order-profiles/index.mjs +7 -0
  130. package/resources/order-profiles/index.mjs.map +1 -0
  131. package/resources/order-profiles/letters.d.ts +647 -0
  132. package/resources/order-profiles/letters.d.ts.map +1 -0
  133. package/resources/order-profiles/letters.js +80 -0
  134. package/resources/order-profiles/letters.js.map +1 -0
  135. package/resources/order-profiles/letters.mjs +75 -0
  136. package/resources/order-profiles/letters.mjs.map +1 -0
  137. package/resources/order-profiles/order-profiles.d.ts +22 -0
  138. package/resources/order-profiles/order-profiles.d.ts.map +1 -0
  139. package/resources/order-profiles/order-profiles.js +55 -0
  140. package/resources/order-profiles/order-profiles.js.map +1 -0
  141. package/resources/order-profiles/order-profiles.mjs +28 -0
  142. package/resources/order-profiles/order-profiles.mjs.map +1 -0
  143. package/resources/order-profiles/postcards.d.ts +423 -0
  144. package/resources/order-profiles/postcards.d.ts.map +1 -0
  145. package/resources/order-profiles/postcards.js +73 -0
  146. package/resources/order-profiles/postcards.js.map +1 -0
  147. package/resources/order-profiles/postcards.mjs +68 -0
  148. package/resources/order-profiles/postcards.mjs.map +1 -0
  149. package/resources/order-profiles/self-mailers.d.ts +435 -0
  150. package/resources/order-profiles/self-mailers.d.ts.map +1 -0
  151. package/resources/order-profiles/self-mailers.js +75 -0
  152. package/resources/order-profiles/self-mailers.js.map +1 -0
  153. package/resources/order-profiles/self-mailers.mjs +70 -0
  154. package/resources/order-profiles/self-mailers.mjs.map +1 -0
  155. package/resources/order-profiles.d.ts +2 -0
  156. package/resources/order-profiles.d.ts.map +1 -0
  157. package/resources/order-profiles.js +19 -0
  158. package/resources/order-profiles.js.map +1 -0
  159. package/resources/order-profiles.mjs +3 -0
  160. package/resources/order-profiles.mjs.map +1 -0
  161. package/resources/postcards.d.ts +58 -8
  162. package/resources/postcards.d.ts.map +1 -1
  163. package/resources/postcards.js +26 -0
  164. package/resources/postcards.js.map +1 -1
  165. package/resources/postcards.mjs +26 -0
  166. package/resources/postcards.mjs.map +1 -1
  167. package/resources/reports/exports.d.ts +36 -3
  168. package/resources/reports/exports.d.ts.map +1 -1
  169. package/resources/reports/exports.js +27 -0
  170. package/resources/reports/exports.js.map +1 -1
  171. package/resources/reports/exports.mjs +27 -0
  172. package/resources/reports/exports.mjs.map +1 -1
  173. package/resources/reports/reports.d.ts +76 -8
  174. package/resources/reports/reports.d.ts.map +1 -1
  175. package/resources/reports/reports.js +44 -0
  176. package/resources/reports/reports.js.map +1 -1
  177. package/resources/reports/reports.mjs +44 -0
  178. package/resources/reports/reports.mjs.map +1 -1
  179. package/resources/self-mailers.d.ts +99 -15
  180. package/resources/self-mailers.d.ts.map +1 -1
  181. package/resources/self-mailers.js +38 -0
  182. package/resources/self-mailers.js.map +1 -1
  183. package/resources/self-mailers.mjs +38 -0
  184. package/resources/self-mailers.mjs.map +1 -1
  185. package/resources/shared.d.ts +6 -2
  186. package/resources/shared.d.ts.map +1 -1
  187. package/resources/sub-organizations.d.ts +394 -0
  188. package/resources/sub-organizations.d.ts.map +1 -0
  189. package/resources/sub-organizations.js +63 -0
  190. package/resources/sub-organizations.js.map +1 -0
  191. package/resources/sub-organizations.mjs +58 -0
  192. package/resources/sub-organizations.mjs.map +1 -0
  193. package/resources/templates.d.ts +43 -3
  194. package/resources/templates.d.ts.map +1 -1
  195. package/resources/templates.js +26 -0
  196. package/resources/templates.js.map +1 -1
  197. package/resources/templates.mjs +26 -0
  198. package/resources/templates.mjs.map +1 -1
  199. package/src/core.ts +17 -8
  200. package/src/index.ts +112 -11
  201. package/src/internal/qs/LICENSE.md +13 -0
  202. package/src/internal/qs/README.md +3 -0
  203. package/src/internal/qs/formats.ts +9 -0
  204. package/src/internal/qs/index.ts +13 -0
  205. package/src/internal/qs/stringify.ts +388 -0
  206. package/src/internal/qs/types.ts +71 -0
  207. package/src/internal/qs/utils.ts +265 -0
  208. package/src/pagination.ts +6 -1
  209. package/src/resource.ts +1 -1
  210. package/src/resources/bank-accounts.ts +57 -4
  211. package/src/resources/boxes.ts +50 -15
  212. package/src/resources/campaigns.ts +7 -7
  213. package/src/resources/cheques/cheques.ts +35 -4
  214. package/src/resources/cheques/url.ts +5 -0
  215. package/src/resources/cheques/with-deposit-ready-pdf.ts +6 -0
  216. package/src/resources/contacts.ts +31 -3
  217. package/src/resources/index.ts +39 -0
  218. package/src/resources/letters.ts +38 -6
  219. package/src/resources/mailing-list-imports.ts +1076 -0
  220. package/src/resources/mailing-lists.ts +511 -0
  221. package/src/resources/order-profiles/cheques.ts +888 -0
  222. package/src/resources/order-profiles/index.ts +55 -0
  223. package/src/resources/order-profiles/letters.ts +956 -0
  224. package/src/resources/order-profiles/order-profiles.ts +133 -0
  225. package/src/resources/order-profiles/postcards.ts +694 -0
  226. package/src/resources/order-profiles/self-mailers.ts +707 -0
  227. package/src/resources/order-profiles.ts +3 -0
  228. package/src/resources/postcards.ts +42 -8
  229. package/src/resources/reports/exports.ts +30 -3
  230. package/src/resources/reports/reports.ts +60 -8
  231. package/src/resources/self-mailers.ts +80 -14
  232. package/src/resources/shared.ts +2 -2
  233. package/src/resources/sub-organizations.ts +518 -0
  234. package/src/resources/templates.ts +37 -3
  235. package/src/version.ts +1 -1
  236. package/version.d.ts +1 -1
  237. package/version.js +1 -1
  238. package/version.mjs +1 -1
@@ -0,0 +1,511 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+ import { List, type ListParams } from '../pagination';
7
+
8
+ export class MailingLists extends APIResource {
9
+ /**
10
+ * Create a new mailing list.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const mailingList = await client.mailingLists.create({
15
+ * description: 'Test Mailing List',
16
+ * metadata: { campaign: 'launch' },
17
+ * });
18
+ * ```
19
+ */
20
+ create(
21
+ body: MailingListCreateParams,
22
+ options?: Core.RequestOptions,
23
+ ): Core.APIPromise<MailingListCreateResponse> {
24
+ return this._client.post('/mailing_lists', { body, ...options });
25
+ }
26
+
27
+ /**
28
+ * Retrieve a specific mailing list by its ID.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const mailingList = await client.mailingLists.retrieve(
33
+ * 'id',
34
+ * );
35
+ * ```
36
+ */
37
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<MailingListRetrieveResponse> {
38
+ return this._client.get(`/mailing_lists/${id}`, options);
39
+ }
40
+
41
+ /**
42
+ * Update an existing mailing list.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const mailingList = await client.mailingLists.update('id', {
47
+ * description: 'Updated Mailing List Description',
48
+ * });
49
+ * ```
50
+ */
51
+ update(
52
+ id: string,
53
+ body: MailingListUpdateParams,
54
+ options?: Core.RequestOptions,
55
+ ): Core.APIPromise<MailingListUpdateResponse> {
56
+ return this._client.post(`/mailing_lists/${id}`, { body, ...options });
57
+ }
58
+
59
+ /**
60
+ * Retrieve a list of mailing lists.
61
+ *
62
+ * Returns a paginated list of mailing lists associated with the authenticated
63
+ * organization, filterable by various parameters.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Automatically fetches more pages as needed.
68
+ * for await (const mailingListListResponse of client.mailingLists.list()) {
69
+ * // ...
70
+ * }
71
+ * ```
72
+ */
73
+ list(
74
+ query?: MailingListListParams,
75
+ options?: Core.RequestOptions,
76
+ ): Core.PagePromise<MailingListListResponsesList, MailingListListResponse>;
77
+ list(
78
+ options?: Core.RequestOptions,
79
+ ): Core.PagePromise<MailingListListResponsesList, MailingListListResponse>;
80
+ list(
81
+ query: MailingListListParams | Core.RequestOptions = {},
82
+ options?: Core.RequestOptions,
83
+ ): Core.PagePromise<MailingListListResponsesList, MailingListListResponse> {
84
+ if (isRequestOptions(query)) {
85
+ return this.list({}, query);
86
+ }
87
+ return this._client.getAPIList('/mailing_lists', MailingListListResponsesList, { query, ...options });
88
+ }
89
+
90
+ /**
91
+ * Delete a mailing list.
92
+ *
93
+ * This permanently deletes the mailing list and its associations. This operation
94
+ * cannot be undone.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const mailingList = await client.mailingLists.delete('id');
99
+ * ```
100
+ */
101
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<MailingListDeleteResponse> {
102
+ return this._client.delete(`/mailing_lists/${id}`, options);
103
+ }
104
+
105
+ /**
106
+ * Runs a mailing list job. Mailing list jobs allow you to add or remove contacts
107
+ * to your mailing list from mailing list imports or directly with contact IDs.
108
+ * Only one job can be ran at a time and jobs are only able to be ran while the
109
+ * mailing list has a `status` of "completed".
110
+ *
111
+ * Once a job as successfully been kicked off, the mailing list will have a
112
+ * `status` of either `creating_contacts` or `removing_contacts` depending on which
113
+ * job was ran. After the job has finished, the mailing list will go back into the
114
+ * `completed` state where more jobs can be ran. If there are any errors while
115
+ * running a job, the `errors` field on the mailing list will contain a list of
116
+ * error objects which describe the errors.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const response = await client.mailingLists.submitJob('id', {
121
+ * removeMailingListImports: [
122
+ * 'mailing_list_import_123',
123
+ * 'mailing_list_import_456',
124
+ * ],
125
+ * });
126
+ * ```
127
+ */
128
+ submitJob(
129
+ id: string,
130
+ body: MailingListSubmitJobParams,
131
+ options?: Core.RequestOptions,
132
+ ): Core.APIPromise<MailingListSubmitJobResponse> {
133
+ return this._client.post(`/mailing_lists/${id}/jobs`, { body, ...options });
134
+ }
135
+ }
136
+
137
+ export class MailingListListResponsesList extends List<MailingListListResponse> {}
138
+
139
+ /**
140
+ * Represents a mailing list.
141
+ */
142
+ export interface MailingListCreateResponse {
143
+ /**
144
+ * A unique ID prefixed with mailing*list*
145
+ */
146
+ id: string;
147
+
148
+ /**
149
+ * The UTC time at which this resource was created.
150
+ */
151
+ createdAt: string;
152
+
153
+ /**
154
+ * `true` if this is a live mode resource else `false`.
155
+ */
156
+ live: boolean;
157
+
158
+ /**
159
+ * Status of the mailing list processing.
160
+ */
161
+ status: 'creating_contacts' | 'removing_contacts' | 'completed';
162
+
163
+ /**
164
+ * The UTC time at which this resource was last updated.
165
+ */
166
+ updatedAt: string;
167
+
168
+ /**
169
+ * An optional string describing this resource. Will be visible in the API and the
170
+ * dashboard.
171
+ */
172
+ description?: string;
173
+
174
+ /**
175
+ * A list of processing errors encountered, if any.
176
+ */
177
+ errors?: Array<MailingListCreateResponse.Error>;
178
+
179
+ /**
180
+ * See the section on Metadata.
181
+ */
182
+ metadata?: { [key: string]: unknown };
183
+ }
184
+
185
+ export namespace MailingListCreateResponse {
186
+ /**
187
+ * Details of a specific error encountered during processing.
188
+ */
189
+ export interface Error {
190
+ /**
191
+ * A human-readable message describing the error.
192
+ */
193
+ message: string;
194
+
195
+ /**
196
+ * Type of error encountered during mailing list processing.
197
+ */
198
+ type:
199
+ | 'mailing_list_imports_not_found_error'
200
+ | 'download_file_error'
201
+ | 'operational_error'
202
+ | 'internal_service_error';
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Represents a mailing list.
208
+ */
209
+ export interface MailingListRetrieveResponse {
210
+ /**
211
+ * A unique ID prefixed with mailing*list*
212
+ */
213
+ id: string;
214
+
215
+ /**
216
+ * The UTC time at which this resource was created.
217
+ */
218
+ createdAt: string;
219
+
220
+ /**
221
+ * `true` if this is a live mode resource else `false`.
222
+ */
223
+ live: boolean;
224
+
225
+ /**
226
+ * Status of the mailing list processing.
227
+ */
228
+ status: 'creating_contacts' | 'removing_contacts' | 'completed';
229
+
230
+ /**
231
+ * The UTC time at which this resource was last updated.
232
+ */
233
+ updatedAt: string;
234
+
235
+ /**
236
+ * An optional string describing this resource. Will be visible in the API and the
237
+ * dashboard.
238
+ */
239
+ description?: string;
240
+
241
+ /**
242
+ * A list of processing errors encountered, if any.
243
+ */
244
+ errors?: Array<MailingListRetrieveResponse.Error>;
245
+
246
+ /**
247
+ * See the section on Metadata.
248
+ */
249
+ metadata?: { [key: string]: unknown };
250
+ }
251
+
252
+ export namespace MailingListRetrieveResponse {
253
+ /**
254
+ * Details of a specific error encountered during processing.
255
+ */
256
+ export interface Error {
257
+ /**
258
+ * A human-readable message describing the error.
259
+ */
260
+ message: string;
261
+
262
+ /**
263
+ * Type of error encountered during mailing list processing.
264
+ */
265
+ type:
266
+ | 'mailing_list_imports_not_found_error'
267
+ | 'download_file_error'
268
+ | 'operational_error'
269
+ | 'internal_service_error';
270
+ }
271
+ }
272
+
273
+ /**
274
+ * Parameters for updating an existing mailing list.
275
+ */
276
+ export interface MailingListUpdateResponse {
277
+ /**
278
+ * An optional string describing this resource. Will be visible in the API and the
279
+ * dashboard.
280
+ */
281
+ description?: string;
282
+
283
+ /**
284
+ * See the section on Metadata.
285
+ */
286
+ metadata?: { [key: string]: unknown };
287
+ }
288
+
289
+ /**
290
+ * Represents a mailing list.
291
+ */
292
+ export interface MailingListListResponse {
293
+ /**
294
+ * A unique ID prefixed with mailing*list*
295
+ */
296
+ id: string;
297
+
298
+ /**
299
+ * The UTC time at which this resource was created.
300
+ */
301
+ createdAt: string;
302
+
303
+ /**
304
+ * `true` if this is a live mode resource else `false`.
305
+ */
306
+ live: boolean;
307
+
308
+ /**
309
+ * Status of the mailing list processing.
310
+ */
311
+ status: 'creating_contacts' | 'removing_contacts' | 'completed';
312
+
313
+ /**
314
+ * The UTC time at which this resource was last updated.
315
+ */
316
+ updatedAt: string;
317
+
318
+ /**
319
+ * An optional string describing this resource. Will be visible in the API and the
320
+ * dashboard.
321
+ */
322
+ description?: string;
323
+
324
+ /**
325
+ * A list of processing errors encountered, if any.
326
+ */
327
+ errors?: Array<MailingListListResponse.Error>;
328
+
329
+ /**
330
+ * See the section on Metadata.
331
+ */
332
+ metadata?: { [key: string]: unknown };
333
+ }
334
+
335
+ export namespace MailingListListResponse {
336
+ /**
337
+ * Details of a specific error encountered during processing.
338
+ */
339
+ export interface Error {
340
+ /**
341
+ * A human-readable message describing the error.
342
+ */
343
+ message: string;
344
+
345
+ /**
346
+ * Type of error encountered during mailing list processing.
347
+ */
348
+ type:
349
+ | 'mailing_list_imports_not_found_error'
350
+ | 'download_file_error'
351
+ | 'operational_error'
352
+ | 'internal_service_error';
353
+ }
354
+ }
355
+
356
+ export interface MailingListDeleteResponse {
357
+ /**
358
+ * A unique ID prefixed with mailing*list*
359
+ */
360
+ id: string;
361
+
362
+ deleted: true;
363
+ }
364
+
365
+ /**
366
+ * Represents a mailing list.
367
+ */
368
+ export interface MailingListSubmitJobResponse {
369
+ /**
370
+ * A unique ID prefixed with mailing*list*
371
+ */
372
+ id: string;
373
+
374
+ /**
375
+ * The UTC time at which this resource was created.
376
+ */
377
+ createdAt: string;
378
+
379
+ /**
380
+ * `true` if this is a live mode resource else `false`.
381
+ */
382
+ live: boolean;
383
+
384
+ /**
385
+ * Status of the mailing list processing.
386
+ */
387
+ status: 'creating_contacts' | 'removing_contacts' | 'completed';
388
+
389
+ /**
390
+ * The UTC time at which this resource was last updated.
391
+ */
392
+ updatedAt: string;
393
+
394
+ /**
395
+ * An optional string describing this resource. Will be visible in the API and the
396
+ * dashboard.
397
+ */
398
+ description?: string;
399
+
400
+ /**
401
+ * A list of processing errors encountered, if any.
402
+ */
403
+ errors?: Array<MailingListSubmitJobResponse.Error>;
404
+
405
+ /**
406
+ * See the section on Metadata.
407
+ */
408
+ metadata?: { [key: string]: unknown };
409
+ }
410
+
411
+ export namespace MailingListSubmitJobResponse {
412
+ /**
413
+ * Details of a specific error encountered during processing.
414
+ */
415
+ export interface Error {
416
+ /**
417
+ * A human-readable message describing the error.
418
+ */
419
+ message: string;
420
+
421
+ /**
422
+ * Type of error encountered during mailing list processing.
423
+ */
424
+ type:
425
+ | 'mailing_list_imports_not_found_error'
426
+ | 'download_file_error'
427
+ | 'operational_error'
428
+ | 'internal_service_error';
429
+ }
430
+ }
431
+
432
+ export interface MailingListCreateParams {
433
+ /**
434
+ * An optional string describing this resource. Will be visible in the API and the
435
+ * dashboard.
436
+ */
437
+ description?: string;
438
+
439
+ /**
440
+ * See the section on Metadata.
441
+ */
442
+ metadata?: { [key: string]: unknown };
443
+ }
444
+
445
+ export interface MailingListUpdateParams {
446
+ /**
447
+ * An optional string describing this resource. Will be visible in the API and the
448
+ * dashboard.
449
+ */
450
+ description?: string;
451
+
452
+ /**
453
+ * See the section on Metadata.
454
+ */
455
+ metadata?: { [key: string]: unknown };
456
+ }
457
+
458
+ export interface MailingListListParams extends ListParams {
459
+ /**
460
+ * You can supply any string to help narrow down the list of resources. For
461
+ * example, if you pass `"New York"` (quoted), it will return resources that have
462
+ * that string present somewhere in their response. Alternatively, you can supply a
463
+ * structured search query. See the documentation on `StructuredSearchQuery` for
464
+ * more details.
465
+ */
466
+ search?: string;
467
+ }
468
+
469
+ export interface MailingListSubmitJobParams {
470
+ /**
471
+ * List of contact IDs to add to the mailing list. Cannot be used with other
472
+ * operations.
473
+ */
474
+ addContacts?: Array<string>;
475
+
476
+ /**
477
+ * List of mailing list import IDs to add to the mailing list. Cannot be used with
478
+ * other operations.
479
+ */
480
+ addMailingListImports?: Array<string>;
481
+
482
+ /**
483
+ * List of contact IDs to remove from the mailing list. Cannot be used with other
484
+ * operations.
485
+ */
486
+ removeContacts?: Array<string>;
487
+
488
+ /**
489
+ * List of mailing list import IDs to remove from the mailing list. Cannot be used
490
+ * with other operations.
491
+ */
492
+ removeMailingListImports?: Array<string>;
493
+ }
494
+
495
+ MailingLists.MailingListListResponsesList = MailingListListResponsesList;
496
+
497
+ export declare namespace MailingLists {
498
+ export {
499
+ type MailingListCreateResponse as MailingListCreateResponse,
500
+ type MailingListRetrieveResponse as MailingListRetrieveResponse,
501
+ type MailingListUpdateResponse as MailingListUpdateResponse,
502
+ type MailingListListResponse as MailingListListResponse,
503
+ type MailingListDeleteResponse as MailingListDeleteResponse,
504
+ type MailingListSubmitJobResponse as MailingListSubmitJobResponse,
505
+ MailingListListResponsesList as MailingListListResponsesList,
506
+ type MailingListCreateParams as MailingListCreateParams,
507
+ type MailingListUpdateParams as MailingListUpdateParams,
508
+ type MailingListListParams as MailingListListParams,
509
+ type MailingListSubmitJobParams as MailingListSubmitJobParams,
510
+ };
511
+ }