postgrid-node 0.1.0-alpha.3 → 0.1.0-alpha.5
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.
- package/CHANGELOG.md +56 -0
- package/README.md +25 -39
- package/core.d.ts +7 -4
- package/core.d.ts.map +1 -1
- package/core.js +16 -9
- package/core.js.map +1 -1
- package/core.mjs +16 -9
- package/core.mjs.map +1 -1
- package/index.d.mts +21 -8
- package/index.d.ts +21 -8
- package/index.d.ts.map +1 -1
- package/index.js +28 -5
- package/index.js.map +1 -1
- package/index.mjs +28 -5
- package/index.mjs.map +1 -1
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +4 -5
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +2 -1
- package/pagination.js.map +1 -1
- package/pagination.mjs +2 -1
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/bank-accounts.d.ts +61 -4
- package/resources/bank-accounts.d.ts.map +1 -1
- package/resources/bank-accounts.js +25 -0
- package/resources/bank-accounts.js.map +1 -1
- package/resources/bank-accounts.mjs +25 -0
- package/resources/bank-accounts.mjs.map +1 -1
- package/resources/boxes.d.ts +80 -15
- package/resources/boxes.d.ts.map +1 -1
- package/resources/boxes.js +27 -0
- package/resources/boxes.js.map +1 -1
- package/resources/boxes.mjs +27 -0
- package/resources/boxes.mjs.map +1 -1
- package/resources/campaigns.d.ts +21 -7
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/cheques/cheques.d.ts +43 -4
- package/resources/cheques/cheques.d.ts.map +1 -1
- package/resources/cheques/cheques.js +23 -0
- package/resources/cheques/cheques.js.map +1 -1
- package/resources/cheques/cheques.mjs +23 -0
- package/resources/cheques/cheques.mjs.map +1 -1
- package/resources/cheques/url.d.ts +5 -0
- package/resources/cheques/url.d.ts.map +1 -1
- package/resources/cheques/url.js +5 -0
- package/resources/cheques/url.js.map +1 -1
- package/resources/cheques/url.mjs +5 -0
- package/resources/cheques/url.mjs.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.d.ts +6 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.js +6 -0
- package/resources/cheques/with-deposit-ready-pdf.js.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.mjs +6 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -1
- package/resources/contacts.d.ts +37 -3
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +20 -0
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +20 -0
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.ts +5 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +12 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/letters.d.ts +50 -6
- package/resources/letters.d.ts.map +1 -1
- package/resources/letters.js +24 -0
- package/resources/letters.js.map +1 -1
- package/resources/letters.mjs +24 -0
- package/resources/letters.mjs.map +1 -1
- package/resources/mailing-list-imports.d.ts +919 -0
- package/resources/mailing-list-imports.d.ts.map +1 -0
- package/resources/mailing-list-imports.js +95 -0
- package/resources/mailing-list-imports.js.map +1 -0
- package/resources/mailing-list-imports.mjs +90 -0
- package/resources/mailing-list-imports.mjs.map +1 -0
- package/resources/mailing-lists.d.ts +398 -0
- package/resources/mailing-lists.d.ts.map +1 -0
- package/resources/mailing-lists.js +101 -0
- package/resources/mailing-lists.js.map +1 -0
- package/resources/mailing-lists.mjs +96 -0
- package/resources/mailing-lists.mjs.map +1 -0
- package/resources/order-profiles/cheques.d.ts +588 -0
- package/resources/order-profiles/cheques.d.ts.map +1 -0
- package/resources/order-profiles/cheques.js +74 -0
- package/resources/order-profiles/cheques.js.map +1 -0
- package/resources/order-profiles/cheques.mjs +69 -0
- package/resources/order-profiles/cheques.mjs.map +1 -0
- package/resources/order-profiles/index.d.ts +6 -0
- package/resources/order-profiles/index.d.ts.map +1 -0
- package/resources/order-profiles/index.js +19 -0
- package/resources/order-profiles/index.js.map +1 -0
- package/resources/order-profiles/index.mjs +7 -0
- package/resources/order-profiles/index.mjs.map +1 -0
- package/resources/order-profiles/letters.d.ts +647 -0
- package/resources/order-profiles/letters.d.ts.map +1 -0
- package/resources/order-profiles/letters.js +80 -0
- package/resources/order-profiles/letters.js.map +1 -0
- package/resources/order-profiles/letters.mjs +75 -0
- package/resources/order-profiles/letters.mjs.map +1 -0
- package/resources/order-profiles/order-profiles.d.ts +22 -0
- package/resources/order-profiles/order-profiles.d.ts.map +1 -0
- package/resources/order-profiles/order-profiles.js +55 -0
- package/resources/order-profiles/order-profiles.js.map +1 -0
- package/resources/order-profiles/order-profiles.mjs +28 -0
- package/resources/order-profiles/order-profiles.mjs.map +1 -0
- package/resources/order-profiles/postcards.d.ts +423 -0
- package/resources/order-profiles/postcards.d.ts.map +1 -0
- package/resources/order-profiles/postcards.js +73 -0
- package/resources/order-profiles/postcards.js.map +1 -0
- package/resources/order-profiles/postcards.mjs +68 -0
- package/resources/order-profiles/postcards.mjs.map +1 -0
- package/resources/order-profiles/self-mailers.d.ts +435 -0
- package/resources/order-profiles/self-mailers.d.ts.map +1 -0
- package/resources/order-profiles/self-mailers.js +75 -0
- package/resources/order-profiles/self-mailers.js.map +1 -0
- package/resources/order-profiles/self-mailers.mjs +70 -0
- package/resources/order-profiles/self-mailers.mjs.map +1 -0
- package/resources/order-profiles.d.ts +2 -0
- package/resources/order-profiles.d.ts.map +1 -0
- package/resources/order-profiles.js +19 -0
- package/resources/order-profiles.js.map +1 -0
- package/resources/order-profiles.mjs +3 -0
- package/resources/order-profiles.mjs.map +1 -0
- package/resources/postcards.d.ts +58 -8
- package/resources/postcards.d.ts.map +1 -1
- package/resources/postcards.js +26 -0
- package/resources/postcards.js.map +1 -1
- package/resources/postcards.mjs +26 -0
- package/resources/postcards.mjs.map +1 -1
- package/resources/reports/exports.d.ts +36 -3
- package/resources/reports/exports.d.ts.map +1 -1
- package/resources/reports/exports.js +27 -0
- package/resources/reports/exports.js.map +1 -1
- package/resources/reports/exports.mjs +27 -0
- package/resources/reports/exports.mjs.map +1 -1
- package/resources/reports/reports.d.ts +76 -8
- package/resources/reports/reports.d.ts.map +1 -1
- package/resources/reports/reports.js +44 -0
- package/resources/reports/reports.js.map +1 -1
- package/resources/reports/reports.mjs +44 -0
- package/resources/reports/reports.mjs.map +1 -1
- package/resources/self-mailers.d.ts +99 -15
- package/resources/self-mailers.d.ts.map +1 -1
- package/resources/self-mailers.js +38 -0
- package/resources/self-mailers.js.map +1 -1
- package/resources/self-mailers.mjs +38 -0
- package/resources/self-mailers.mjs.map +1 -1
- package/resources/shared.d.ts +6 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/sub-organizations.d.ts +394 -0
- package/resources/sub-organizations.d.ts.map +1 -0
- package/resources/sub-organizations.js +63 -0
- package/resources/sub-organizations.js.map +1 -0
- package/resources/sub-organizations.mjs +58 -0
- package/resources/sub-organizations.mjs.map +1 -0
- package/resources/templates.d.ts +43 -3
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +26 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +26 -0
- package/resources/templates.mjs.map +1 -1
- package/src/core.ts +17 -8
- package/src/index.ts +112 -11
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/pagination.ts +6 -1
- package/src/resource.ts +1 -1
- package/src/resources/bank-accounts.ts +57 -4
- package/src/resources/boxes.ts +50 -15
- package/src/resources/campaigns.ts +7 -7
- package/src/resources/cheques/cheques.ts +35 -4
- package/src/resources/cheques/url.ts +5 -0
- package/src/resources/cheques/with-deposit-ready-pdf.ts +6 -0
- package/src/resources/contacts.ts +31 -3
- package/src/resources/index.ts +39 -0
- package/src/resources/letters.ts +38 -6
- package/src/resources/mailing-list-imports.ts +1076 -0
- package/src/resources/mailing-lists.ts +511 -0
- package/src/resources/order-profiles/cheques.ts +888 -0
- package/src/resources/order-profiles/index.ts +55 -0
- package/src/resources/order-profiles/letters.ts +956 -0
- package/src/resources/order-profiles/order-profiles.ts +133 -0
- package/src/resources/order-profiles/postcards.ts +694 -0
- package/src/resources/order-profiles/self-mailers.ts +707 -0
- package/src/resources/order-profiles.ts +3 -0
- package/src/resources/postcards.ts +42 -8
- package/src/resources/reports/exports.ts +30 -3
- package/src/resources/reports/reports.ts +60 -8
- package/src/resources/self-mailers.ts +80 -14
- package/src/resources/shared.ts +2 -2
- package/src/resources/sub-organizations.ts +518 -0
- package/src/resources/templates.ts +37 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
+
}
|