@scaleway/sdk-tem 2.2.1 → 2.3.0

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.
@@ -1,588 +1,407 @@
1
1
  import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- const unmarshalEmailTry = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- code: data.code,
10
- message: data.message,
11
- rank: data.rank,
12
- triedAt: unmarshalDate(data.tried_at)
13
- };
2
+ var unmarshalEmailTry = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`);
4
+ return {
5
+ code: data.code,
6
+ message: data.message,
7
+ rank: data.rank,
8
+ triedAt: unmarshalDate(data.tried_at)
9
+ };
14
10
  };
15
11
  const unmarshalEmail = (data) => {
16
- if (!isJSONObject(data)) {
17
- throw new TypeError(
18
- `Unmarshalling the type 'Email' failed as data isn't a dictionary.`
19
- );
20
- }
21
- return {
22
- createdAt: unmarshalDate(data.created_at),
23
- flags: data.flags,
24
- id: data.id,
25
- lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
26
- mailFrom: data.mail_from,
27
- mailRcpt: data.mail_rcpt,
28
- messageId: data.message_id,
29
- projectId: data.project_id,
30
- rcptTo: data.rcpt_to,
31
- rcptType: data.rcpt_type,
32
- status: data.status,
33
- statusDetails: data.status_details,
34
- subject: data.subject,
35
- tryCount: data.try_count,
36
- updatedAt: unmarshalDate(data.updated_at)
37
- };
38
- };
39
- const unmarshalDomainRecordsDKIM = (data) => {
40
- if (!isJSONObject(data)) {
41
- throw new TypeError(
42
- `Unmarshalling the type 'DomainRecordsDKIM' failed as data isn't a dictionary.`
43
- );
44
- }
45
- return {
46
- name: data.name,
47
- value: data.value
48
- };
49
- };
50
- const unmarshalDomainRecordsDMARC = (data) => {
51
- if (!isJSONObject(data)) {
52
- throw new TypeError(
53
- `Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.`
54
- );
55
- }
56
- return {
57
- name: data.name,
58
- value: data.value
59
- };
60
- };
61
- const unmarshalDomainRecordsMX = (data) => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'DomainRecordsMX' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- name: data.name,
69
- value: data.value
70
- };
71
- };
72
- const unmarshalDomainRecordsSPF = (data) => {
73
- if (!isJSONObject(data)) {
74
- throw new TypeError(
75
- `Unmarshalling the type 'DomainRecordsSPF' failed as data isn't a dictionary.`
76
- );
77
- }
78
- return {
79
- name: data.name,
80
- value: data.value
81
- };
82
- };
83
- const unmarshalDomainRecords = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- dkim: data.dkim ? unmarshalDomainRecordsDKIM(data.dkim) : void 0,
91
- dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : void 0,
92
- mx: data.mx ? unmarshalDomainRecordsMX(data.mx) : void 0,
93
- spf: data.spf ? unmarshalDomainRecordsSPF(data.spf) : void 0
94
- };
95
- };
96
- const unmarshalDomainReputation = (data) => {
97
- if (!isJSONObject(data)) {
98
- throw new TypeError(
99
- `Unmarshalling the type 'DomainReputation' failed as data isn't a dictionary.`
100
- );
101
- }
102
- return {
103
- previousScore: data.previous_score,
104
- previousScoredAt: unmarshalDate(data.previous_scored_at),
105
- score: data.score,
106
- scoredAt: unmarshalDate(data.scored_at),
107
- status: data.status
108
- };
109
- };
110
- const unmarshalDomainStatistics = (data) => {
111
- if (!isJSONObject(data)) {
112
- throw new TypeError(
113
- `Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`
114
- );
115
- }
116
- return {
117
- canceledCount: data.canceled_count,
118
- failedCount: data.failed_count,
119
- sentCount: data.sent_count,
120
- totalCount: data.total_count
121
- };
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);
13
+ return {
14
+ createdAt: unmarshalDate(data.created_at),
15
+ flags: data.flags,
16
+ id: data.id,
17
+ lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
18
+ mailFrom: data.mail_from,
19
+ mailRcpt: data.mail_rcpt,
20
+ messageId: data.message_id,
21
+ projectId: data.project_id,
22
+ rcptTo: data.rcpt_to,
23
+ rcptType: data.rcpt_type,
24
+ status: data.status,
25
+ statusDetails: data.status_details,
26
+ subject: data.subject,
27
+ tryCount: data.try_count,
28
+ updatedAt: unmarshalDate(data.updated_at)
29
+ };
30
+ };
31
+ var unmarshalDomainRecordsDKIM = (data) => {
32
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecordsDKIM' failed as data isn't a dictionary.`);
33
+ return {
34
+ name: data.name,
35
+ value: data.value
36
+ };
37
+ };
38
+ var unmarshalDomainRecordsDMARC = (data) => {
39
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.`);
40
+ return {
41
+ name: data.name,
42
+ value: data.value
43
+ };
44
+ };
45
+ var unmarshalDomainRecordsMX = (data) => {
46
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecordsMX' failed as data isn't a dictionary.`);
47
+ return {
48
+ name: data.name,
49
+ value: data.value
50
+ };
51
+ };
52
+ var unmarshalDomainRecordsSPF = (data) => {
53
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecordsSPF' failed as data isn't a dictionary.`);
54
+ return {
55
+ name: data.name,
56
+ value: data.value
57
+ };
58
+ };
59
+ var unmarshalDomainRecords = (data) => {
60
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.`);
61
+ return {
62
+ dkim: data.dkim ? unmarshalDomainRecordsDKIM(data.dkim) : void 0,
63
+ dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : void 0,
64
+ mx: data.mx ? unmarshalDomainRecordsMX(data.mx) : void 0,
65
+ spf: data.spf ? unmarshalDomainRecordsSPF(data.spf) : void 0
66
+ };
67
+ };
68
+ var unmarshalDomainReputation = (data) => {
69
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainReputation' failed as data isn't a dictionary.`);
70
+ return {
71
+ previousScore: data.previous_score,
72
+ previousScoredAt: unmarshalDate(data.previous_scored_at),
73
+ score: data.score,
74
+ scoredAt: unmarshalDate(data.scored_at),
75
+ status: data.status
76
+ };
77
+ };
78
+ var unmarshalDomainStatistics = (data) => {
79
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
80
+ return {
81
+ canceledCount: data.canceled_count,
82
+ failedCount: data.failed_count,
83
+ sentCount: data.sent_count,
84
+ totalCount: data.total_count
85
+ };
122
86
  };
123
87
  const unmarshalDomain = (data) => {
124
- if (!isJSONObject(data)) {
125
- throw new TypeError(
126
- `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`
127
- );
128
- }
129
- return {
130
- autoconfig: data.autoconfig,
131
- createdAt: unmarshalDate(data.created_at),
132
- dkimConfig: data.dkim_config,
133
- id: data.id,
134
- lastError: data.last_error,
135
- lastValidAt: unmarshalDate(data.last_valid_at),
136
- name: data.name,
137
- nextCheckAt: unmarshalDate(data.next_check_at),
138
- organizationId: data.organization_id,
139
- projectId: data.project_id,
140
- records: data.records ? unmarshalDomainRecords(data.records) : void 0,
141
- region: data.region,
142
- reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : void 0,
143
- revokedAt: unmarshalDate(data.revoked_at),
144
- spfConfig: data.spf_config,
145
- statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : void 0,
146
- status: data.status
147
- };
88
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
89
+ return {
90
+ autoconfig: data.autoconfig,
91
+ createdAt: unmarshalDate(data.created_at),
92
+ dkimConfig: data.dkim_config,
93
+ id: data.id,
94
+ lastError: data.last_error,
95
+ lastValidAt: unmarshalDate(data.last_valid_at),
96
+ name: data.name,
97
+ nextCheckAt: unmarshalDate(data.next_check_at),
98
+ organizationId: data.organization_id,
99
+ projectId: data.project_id,
100
+ records: data.records ? unmarshalDomainRecords(data.records) : void 0,
101
+ region: data.region,
102
+ reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : void 0,
103
+ revokedAt: unmarshalDate(data.revoked_at),
104
+ spfConfig: data.spf_config,
105
+ statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : void 0,
106
+ status: data.status
107
+ };
148
108
  };
149
109
  const unmarshalOfferSubscription = (data) => {
150
- if (!isJSONObject(data)) {
151
- throw new TypeError(
152
- `Unmarshalling the type 'OfferSubscription' failed as data isn't a dictionary.`
153
- );
154
- }
155
- return {
156
- cancellationAvailableAt: unmarshalDate(data.cancellation_available_at),
157
- includedMonthlyEmails: data.included_monthly_emails,
158
- maxCustomBlocklistsPerDomain: data.max_custom_blocklists_per_domain,
159
- maxDedicatedIps: data.max_dedicated_ips,
160
- maxDomains: data.max_domains,
161
- maxWebhooksPerDomain: data.max_webhooks_per_domain,
162
- offerName: data.offer_name,
163
- organizationId: data.organization_id,
164
- projectId: data.project_id,
165
- sla: data.sla,
166
- subscribedAt: unmarshalDate(data.subscribed_at)
167
- };
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OfferSubscription' failed as data isn't a dictionary.`);
111
+ return {
112
+ cancellationAvailableAt: unmarshalDate(data.cancellation_available_at),
113
+ includedMonthlyEmails: data.included_monthly_emails,
114
+ maxCustomBlocklistsPerDomain: data.max_custom_blocklists_per_domain,
115
+ maxDedicatedIps: data.max_dedicated_ips,
116
+ maxDomains: data.max_domains,
117
+ maxWebhooksPerDomain: data.max_webhooks_per_domain,
118
+ offerName: data.offer_name,
119
+ organizationId: data.organization_id,
120
+ projectId: data.project_id,
121
+ sla: data.sla,
122
+ subscribedAt: unmarshalDate(data.subscribed_at)
123
+ };
168
124
  };
169
125
  const unmarshalWebhook = (data) => {
170
- if (!isJSONObject(data)) {
171
- throw new TypeError(
172
- `Unmarshalling the type 'Webhook' failed as data isn't a dictionary.`
173
- );
174
- }
175
- return {
176
- createdAt: unmarshalDate(data.created_at),
177
- domainId: data.domain_id,
178
- eventTypes: data.event_types,
179
- id: data.id,
180
- name: data.name,
181
- organizationId: data.organization_id,
182
- projectId: data.project_id,
183
- snsArn: data.sns_arn,
184
- updatedAt: unmarshalDate(data.updated_at)
185
- };
186
- };
187
- const unmarshalBlocklist = (data) => {
188
- if (!isJSONObject(data)) {
189
- throw new TypeError(
190
- `Unmarshalling the type 'Blocklist' failed as data isn't a dictionary.`
191
- );
192
- }
193
- return {
194
- createdAt: unmarshalDate(data.created_at),
195
- custom: data.custom,
196
- domainId: data.domain_id,
197
- email: data.email,
198
- endsAt: unmarshalDate(data.ends_at),
199
- id: data.id,
200
- reason: data.reason,
201
- type: data.type,
202
- updatedAt: unmarshalDate(data.updated_at)
203
- };
126
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Webhook' failed as data isn't a dictionary.`);
127
+ return {
128
+ createdAt: unmarshalDate(data.created_at),
129
+ domainId: data.domain_id,
130
+ eventTypes: data.event_types,
131
+ id: data.id,
132
+ name: data.name,
133
+ organizationId: data.organization_id,
134
+ projectId: data.project_id,
135
+ snsArn: data.sns_arn,
136
+ updatedAt: unmarshalDate(data.updated_at)
137
+ };
138
+ };
139
+ var unmarshalBlocklist = (data) => {
140
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Blocklist' failed as data isn't a dictionary.`);
141
+ return {
142
+ createdAt: unmarshalDate(data.created_at),
143
+ custom: data.custom,
144
+ domainId: data.domain_id,
145
+ email: data.email,
146
+ endsAt: unmarshalDate(data.ends_at),
147
+ id: data.id,
148
+ reason: data.reason,
149
+ type: data.type,
150
+ updatedAt: unmarshalDate(data.updated_at)
151
+ };
204
152
  };
205
153
  const unmarshalBulkCreateBlocklistsResponse = (data) => {
206
- if (!isJSONObject(data)) {
207
- throw new TypeError(
208
- `Unmarshalling the type 'BulkCreateBlocklistsResponse' failed as data isn't a dictionary.`
209
- );
210
- }
211
- return {
212
- blocklists: unmarshalArrayOfObject(data.blocklists, unmarshalBlocklist)
213
- };
154
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BulkCreateBlocklistsResponse' failed as data isn't a dictionary.`);
155
+ return { blocklists: unmarshalArrayOfObject(data.blocklists, unmarshalBlocklist) };
214
156
  };
215
157
  const unmarshalCreateEmailResponse = (data) => {
216
- if (!isJSONObject(data)) {
217
- throw new TypeError(
218
- `Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`
219
- );
220
- }
221
- return {
222
- emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
223
- };
224
- };
225
- const unmarshalDomainLastStatusAutoconfigState = (data) => {
226
- if (!isJSONObject(data)) {
227
- throw new TypeError(
228
- `Unmarshalling the type 'DomainLastStatusAutoconfigState' failed as data isn't a dictionary.`
229
- );
230
- }
231
- return {
232
- autoconfigurable: data.autoconfigurable,
233
- enabled: data.enabled,
234
- reason: data.reason ? data.reason : void 0
235
- };
236
- };
237
- const unmarshalDomainLastStatusDkimRecord = (data) => {
238
- if (!isJSONObject(data)) {
239
- throw new TypeError(
240
- `Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`
241
- );
242
- }
243
- return {
244
- error: data.error,
245
- lastValidAt: unmarshalDate(data.last_valid_at),
246
- status: data.status
247
- };
248
- };
249
- const unmarshalDomainLastStatusDmarcRecord = (data) => {
250
- if (!isJSONObject(data)) {
251
- throw new TypeError(
252
- `Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.`
253
- );
254
- }
255
- return {
256
- error: data.error,
257
- lastValidAt: unmarshalDate(data.last_valid_at),
258
- status: data.status
259
- };
260
- };
261
- const unmarshalDomainLastStatusMXRecord = (data) => {
262
- if (!isJSONObject(data)) {
263
- throw new TypeError(
264
- `Unmarshalling the type 'DomainLastStatusMXRecord' failed as data isn't a dictionary.`
265
- );
266
- }
267
- return {
268
- error: data.error,
269
- lastValidAt: unmarshalDate(data.last_valid_at),
270
- status: data.status
271
- };
272
- };
273
- const unmarshalDomainLastStatusSpfRecord = (data) => {
274
- if (!isJSONObject(data)) {
275
- throw new TypeError(
276
- `Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`
277
- );
278
- }
279
- return {
280
- error: data.error,
281
- lastValidAt: unmarshalDate(data.last_valid_at),
282
- status: data.status
283
- };
158
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);
159
+ return { emails: unmarshalArrayOfObject(data.emails, unmarshalEmail) };
160
+ };
161
+ var unmarshalDomainLastStatusAutoconfigState = (data) => {
162
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatusAutoconfigState' failed as data isn't a dictionary.`);
163
+ return {
164
+ autoconfigurable: data.autoconfigurable,
165
+ enabled: data.enabled,
166
+ reason: data.reason ? data.reason : void 0
167
+ };
168
+ };
169
+ var unmarshalDomainLastStatusDkimRecord = (data) => {
170
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);
171
+ return {
172
+ error: data.error,
173
+ lastValidAt: unmarshalDate(data.last_valid_at),
174
+ status: data.status
175
+ };
176
+ };
177
+ var unmarshalDomainLastStatusDmarcRecord = (data) => {
178
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.`);
179
+ return {
180
+ error: data.error,
181
+ lastValidAt: unmarshalDate(data.last_valid_at),
182
+ status: data.status
183
+ };
184
+ };
185
+ var unmarshalDomainLastStatusMXRecord = (data) => {
186
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatusMXRecord' failed as data isn't a dictionary.`);
187
+ return {
188
+ error: data.error,
189
+ lastValidAt: unmarshalDate(data.last_valid_at),
190
+ status: data.status
191
+ };
192
+ };
193
+ var unmarshalDomainLastStatusSpfRecord = (data) => {
194
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);
195
+ return {
196
+ error: data.error,
197
+ lastValidAt: unmarshalDate(data.last_valid_at),
198
+ status: data.status
199
+ };
284
200
  };
285
201
  const unmarshalDomainLastStatus = (data) => {
286
- if (!isJSONObject(data)) {
287
- throw new TypeError(
288
- `Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`
289
- );
290
- }
291
- return {
292
- autoconfigState: data.autoconfig_state ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) : void 0,
293
- dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0,
294
- dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0,
295
- domainId: data.domain_id,
296
- domainName: data.domain_name,
297
- mxRecord: data.mx_record ? unmarshalDomainLastStatusMXRecord(data.mx_record) : void 0,
298
- spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : void 0
299
- };
202
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);
203
+ return {
204
+ autoconfigState: data.autoconfig_state ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) : void 0,
205
+ dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0,
206
+ dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0,
207
+ domainId: data.domain_id,
208
+ domainName: data.domain_name,
209
+ mxRecord: data.mx_record ? unmarshalDomainLastStatusMXRecord(data.mx_record) : void 0,
210
+ spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : void 0
211
+ };
300
212
  };
301
213
  const unmarshalListBlocklistsResponse = (data) => {
302
- if (!isJSONObject(data)) {
303
- throw new TypeError(
304
- `Unmarshalling the type 'ListBlocklistsResponse' failed as data isn't a dictionary.`
305
- );
306
- }
307
- return {
308
- blocklists: unmarshalArrayOfObject(data.blocklists, unmarshalBlocklist),
309
- totalCount: data.total_count
310
- };
214
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListBlocklistsResponse' failed as data isn't a dictionary.`);
215
+ return {
216
+ blocklists: unmarshalArrayOfObject(data.blocklists, unmarshalBlocklist),
217
+ totalCount: data.total_count
218
+ };
311
219
  };
312
220
  const unmarshalListDomainsResponse = (data) => {
313
- if (!isJSONObject(data)) {
314
- throw new TypeError(
315
- `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`
316
- );
317
- }
318
- return {
319
- domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
320
- totalCount: data.total_count
321
- };
221
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
222
+ return {
223
+ domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
224
+ totalCount: data.total_count
225
+ };
322
226
  };
323
227
  const unmarshalListEmailsResponse = (data) => {
324
- if (!isJSONObject(data)) {
325
- throw new TypeError(
326
- `Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`
327
- );
328
- }
329
- return {
330
- emails: unmarshalArrayOfObject(data.emails, unmarshalEmail),
331
- totalCount: data.total_count
332
- };
228
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`);
229
+ return {
230
+ emails: unmarshalArrayOfObject(data.emails, unmarshalEmail),
231
+ totalCount: data.total_count
232
+ };
333
233
  };
334
234
  const unmarshalListOfferSubscriptionsResponse = (data) => {
335
- if (!isJSONObject(data)) {
336
- throw new TypeError(
337
- `Unmarshalling the type 'ListOfferSubscriptionsResponse' failed as data isn't a dictionary.`
338
- );
339
- }
340
- return {
341
- offerSubscriptions: unmarshalArrayOfObject(data.offer_subscriptions, unmarshalOfferSubscription),
342
- totalCount: data.total_count
343
- };
344
- };
345
- const unmarshalOffer = (data) => {
346
- if (!isJSONObject(data)) {
347
- throw new TypeError(
348
- `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
349
- );
350
- }
351
- return {
352
- commitmentPeriod: data.commitment_period,
353
- createdAt: unmarshalDate(data.created_at),
354
- includedMonthlyEmails: data.included_monthly_emails,
355
- maxCustomBlocklistsPerDomain: data.max_custom_blocklists_per_domain,
356
- maxDedicatedIps: data.max_dedicated_ips,
357
- maxDomains: data.max_domains,
358
- maxWebhooksPerDomain: data.max_webhooks_per_domain,
359
- name: data.name,
360
- sla: data.sla
361
- };
235
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOfferSubscriptionsResponse' failed as data isn't a dictionary.`);
236
+ return {
237
+ offerSubscriptions: unmarshalArrayOfObject(data.offer_subscriptions, unmarshalOfferSubscription),
238
+ totalCount: data.total_count
239
+ };
240
+ };
241
+ var unmarshalOffer = (data) => {
242
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
243
+ return {
244
+ commitmentPeriod: data.commitment_period,
245
+ createdAt: unmarshalDate(data.created_at),
246
+ includedMonthlyEmails: data.included_monthly_emails,
247
+ maxCustomBlocklistsPerDomain: data.max_custom_blocklists_per_domain,
248
+ maxDedicatedIps: data.max_dedicated_ips,
249
+ maxDomains: data.max_domains,
250
+ maxWebhooksPerDomain: data.max_webhooks_per_domain,
251
+ name: data.name,
252
+ sla: data.sla
253
+ };
362
254
  };
363
255
  const unmarshalListOffersResponse = (data) => {
364
- if (!isJSONObject(data)) {
365
- throw new TypeError(
366
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
367
- );
368
- }
369
- return {
370
- offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
371
- totalCount: data.total_count
372
- };
373
- };
374
- const unmarshalPool = (data) => {
375
- if (!isJSONObject(data)) {
376
- throw new TypeError(
377
- `Unmarshalling the type 'Pool' failed as data isn't a dictionary.`
378
- );
379
- }
380
- return {
381
- details: data.details,
382
- ips: data.ips,
383
- projectId: data.project_id,
384
- reverse: data.reverse,
385
- status: data.status,
386
- zone: data.zone
387
- };
256
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);
257
+ return {
258
+ offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
259
+ totalCount: data.total_count
260
+ };
261
+ };
262
+ var unmarshalPool = (data) => {
263
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`);
264
+ return {
265
+ details: data.details,
266
+ ips: data.ips,
267
+ projectId: data.project_id,
268
+ reverse: data.reverse,
269
+ status: data.status,
270
+ zone: data.zone
271
+ };
388
272
  };
389
273
  const unmarshalListPoolsResponse = (data) => {
390
- if (!isJSONObject(data)) {
391
- throw new TypeError(
392
- `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`
393
- );
394
- }
395
- return {
396
- pools: unmarshalArrayOfObject(data.pools, unmarshalPool),
397
- totalCount: data.total_count
398
- };
399
- };
400
- const unmarshalWebhookEvent = (data) => {
401
- if (!isJSONObject(data)) {
402
- throw new TypeError(
403
- `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`
404
- );
405
- }
406
- return {
407
- createdAt: unmarshalDate(data.created_at),
408
- data: data.data,
409
- domainId: data.domain_id,
410
- emailId: data.email_id,
411
- id: data.id,
412
- organizationId: data.organization_id,
413
- projectId: data.project_id,
414
- status: data.status,
415
- type: data.type,
416
- updatedAt: unmarshalDate(data.updated_at),
417
- webhookId: data.webhook_id
418
- };
274
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`);
275
+ return {
276
+ pools: unmarshalArrayOfObject(data.pools, unmarshalPool),
277
+ totalCount: data.total_count
278
+ };
279
+ };
280
+ var unmarshalWebhookEvent = (data) => {
281
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`);
282
+ return {
283
+ createdAt: unmarshalDate(data.created_at),
284
+ data: data.data,
285
+ domainId: data.domain_id,
286
+ emailId: data.email_id,
287
+ id: data.id,
288
+ organizationId: data.organization_id,
289
+ projectId: data.project_id,
290
+ status: data.status,
291
+ type: data.type,
292
+ updatedAt: unmarshalDate(data.updated_at),
293
+ webhookId: data.webhook_id
294
+ };
419
295
  };
420
296
  const unmarshalListWebhookEventsResponse = (data) => {
421
- if (!isJSONObject(data)) {
422
- throw new TypeError(
423
- `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`
424
- );
425
- }
426
- return {
427
- totalCount: data.total_count,
428
- webhookEvents: unmarshalArrayOfObject(data.webhook_events, unmarshalWebhookEvent)
429
- };
297
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`);
298
+ return {
299
+ totalCount: data.total_count,
300
+ webhookEvents: unmarshalArrayOfObject(data.webhook_events, unmarshalWebhookEvent)
301
+ };
430
302
  };
431
303
  const unmarshalListWebhooksResponse = (data) => {
432
- if (!isJSONObject(data)) {
433
- throw new TypeError(
434
- `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`
435
- );
436
- }
437
- return {
438
- totalCount: data.total_count,
439
- webhooks: unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)
440
- };
304
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`);
305
+ return {
306
+ totalCount: data.total_count,
307
+ webhooks: unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)
308
+ };
441
309
  };
442
310
  const unmarshalProjectConsumption = (data) => {
443
- if (!isJSONObject(data)) {
444
- throw new TypeError(
445
- `Unmarshalling the type 'ProjectConsumption' failed as data isn't a dictionary.`
446
- );
447
- }
448
- return {
449
- customBlocklistsCount: data.custom_blocklists_count,
450
- dedicatedIpsCount: data.dedicated_ips_count,
451
- domainsCount: data.domains_count,
452
- monthlyEmailsCount: data.monthly_emails_count,
453
- projectId: data.project_id,
454
- webhooksCount: data.webhooks_count
455
- };
456
- };
457
- const unmarshalProjectSettingsPeriodicReport = (data) => {
458
- if (!isJSONObject(data)) {
459
- throw new TypeError(
460
- `Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.`
461
- );
462
- }
463
- return {
464
- enabled: data.enabled,
465
- frequency: data.frequency,
466
- sendingDay: data.sending_day,
467
- sendingHour: data.sending_hour
468
- };
311
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ProjectConsumption' failed as data isn't a dictionary.`);
312
+ return {
313
+ customBlocklistsCount: data.custom_blocklists_count,
314
+ dedicatedIpsCount: data.dedicated_ips_count,
315
+ domainsCount: data.domains_count,
316
+ monthlyEmailsCount: data.monthly_emails_count,
317
+ projectId: data.project_id,
318
+ webhooksCount: data.webhooks_count
319
+ };
320
+ };
321
+ var unmarshalProjectSettingsPeriodicReport = (data) => {
322
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.`);
323
+ return {
324
+ enabled: data.enabled,
325
+ frequency: data.frequency,
326
+ sendingDay: data.sending_day,
327
+ sendingHour: data.sending_hour
328
+ };
469
329
  };
470
330
  const unmarshalProjectSettings = (data) => {
471
- if (!isJSONObject(data)) {
472
- throw new TypeError(
473
- `Unmarshalling the type 'ProjectSettings' failed as data isn't a dictionary.`
474
- );
475
- }
476
- return {
477
- periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : void 0
478
- };
331
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ProjectSettings' failed as data isn't a dictionary.`);
332
+ return { periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : void 0 };
479
333
  };
480
334
  const unmarshalStatistics = (data) => {
481
- if (!isJSONObject(data)) {
482
- throw new TypeError(
483
- `Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`
484
- );
485
- }
486
- return {
487
- canceledCount: data.canceled_count,
488
- failedCount: data.failed_count,
489
- newCount: data.new_count,
490
- sendingCount: data.sending_count,
491
- sentCount: data.sent_count,
492
- totalCount: data.total_count
493
- };
335
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`);
336
+ return {
337
+ canceledCount: data.canceled_count,
338
+ failedCount: data.failed_count,
339
+ newCount: data.new_count,
340
+ sendingCount: data.sending_count,
341
+ sentCount: data.sent_count,
342
+ totalCount: data.total_count
343
+ };
494
344
  };
495
345
  const marshalBulkCreateBlocklistsRequest = (request, defaults) => ({
496
- domain_id: request.domainId,
497
- emails: request.emails,
498
- reason: request.reason,
499
- type: request.type
346
+ domain_id: request.domainId,
347
+ emails: request.emails,
348
+ reason: request.reason,
349
+ type: request.type
500
350
  });
501
351
  const marshalCreateDomainRequest = (request, defaults) => ({
502
- accept_tos: request.acceptTos,
503
- autoconfig: request.autoconfig,
504
- domain_name: request.domainName,
505
- project_id: request.projectId ?? defaults.defaultProjectId
352
+ accept_tos: request.acceptTos,
353
+ autoconfig: request.autoconfig,
354
+ domain_name: request.domainName,
355
+ project_id: request.projectId ?? defaults.defaultProjectId
506
356
  });
507
- const marshalCreateEmailRequestAddress = (request, defaults) => ({
508
- email: request.email,
509
- name: request.name
357
+ var marshalCreateEmailRequestAddress = (request, defaults) => ({
358
+ email: request.email,
359
+ name: request.name
510
360
  });
511
- const marshalCreateEmailRequestAttachment = (request, defaults) => ({
512
- content: request.content,
513
- name: request.name,
514
- type: request.type
361
+ var marshalCreateEmailRequestAttachment = (request, defaults) => ({
362
+ content: request.content,
363
+ name: request.name,
364
+ type: request.type
515
365
  });
516
- const marshalCreateEmailRequestHeader = (request, defaults) => ({
517
- key: request.key,
518
- value: request.value
366
+ var marshalCreateEmailRequestHeader = (request, defaults) => ({
367
+ key: request.key,
368
+ value: request.value
519
369
  });
520
370
  const marshalCreateEmailRequest = (request, defaults) => ({
521
- additional_headers: request.additionalHeaders !== void 0 ? request.additionalHeaders.map((elt) => marshalCreateEmailRequestHeader(elt)) : void 0,
522
- attachments: request.attachments !== void 0 ? request.attachments.map((elt) => marshalCreateEmailRequestAttachment(elt)) : void 0,
523
- bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
524
- cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
525
- from: marshalCreateEmailRequestAddress(request.from),
526
- html: request.html,
527
- project_id: request.projectId ?? defaults.defaultProjectId,
528
- send_before: request.sendBefore,
529
- subject: request.subject,
530
- text: request.text,
531
- to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
371
+ additional_headers: request.additionalHeaders !== void 0 ? request.additionalHeaders.map((elt) => marshalCreateEmailRequestHeader(elt, defaults)) : void 0,
372
+ attachments: request.attachments !== void 0 ? request.attachments.map((elt) => marshalCreateEmailRequestAttachment(elt, defaults)) : void 0,
373
+ bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt, defaults)) : void 0,
374
+ cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt, defaults)) : void 0,
375
+ from: marshalCreateEmailRequestAddress(request.from, defaults),
376
+ html: request.html,
377
+ project_id: request.projectId ?? defaults.defaultProjectId,
378
+ send_before: request.sendBefore,
379
+ subject: request.subject,
380
+ text: request.text,
381
+ to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt, defaults)) : void 0
532
382
  });
533
383
  const marshalCreateWebhookRequest = (request, defaults) => ({
534
- domain_id: request.domainId,
535
- event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
536
- name: request.name,
537
- project_id: request.projectId ?? defaults.defaultProjectId,
538
- sns_arn: request.snsArn
539
- });
540
- const marshalUpdateDomainRequest = (request, defaults) => ({
541
- autoconfig: request.autoconfig
384
+ domain_id: request.domainId,
385
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
386
+ name: request.name,
387
+ project_id: request.projectId ?? defaults.defaultProjectId,
388
+ sns_arn: request.snsArn
542
389
  });
390
+ const marshalUpdateDomainRequest = (request, defaults) => ({ autoconfig: request.autoconfig });
543
391
  const marshalUpdateOfferSubscriptionRequest = (request, defaults) => ({
544
- name: request.name,
545
- project_id: request.projectId ?? defaults.defaultProjectId
546
- });
547
- const marshalUpdateProjectSettingsRequestUpdatePeriodicReport = (request, defaults) => ({
548
- enabled: request.enabled,
549
- frequency: request.frequency,
550
- sending_day: request.sendingDay,
551
- sending_hour: request.sendingHour
392
+ name: request.name,
393
+ project_id: request.projectId ?? defaults.defaultProjectId
552
394
  });
553
- const marshalUpdateProjectSettingsRequest = (request, defaults) => ({
554
- periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(request.periodicReport) : void 0
395
+ var marshalUpdateProjectSettingsRequestUpdatePeriodicReport = (request, defaults) => ({
396
+ enabled: request.enabled,
397
+ frequency: request.frequency,
398
+ sending_day: request.sendingDay,
399
+ sending_hour: request.sendingHour
555
400
  });
401
+ const marshalUpdateProjectSettingsRequest = (request, defaults) => ({ periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(request.periodicReport, defaults) : void 0 });
556
402
  const marshalUpdateWebhookRequest = (request, defaults) => ({
557
- event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
558
- name: request.name,
559
- sns_arn: request.snsArn
403
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
404
+ name: request.name,
405
+ sns_arn: request.snsArn
560
406
  });
561
- export {
562
- marshalBulkCreateBlocklistsRequest,
563
- marshalCreateDomainRequest,
564
- marshalCreateEmailRequest,
565
- marshalCreateWebhookRequest,
566
- marshalUpdateDomainRequest,
567
- marshalUpdateOfferSubscriptionRequest,
568
- marshalUpdateProjectSettingsRequest,
569
- marshalUpdateWebhookRequest,
570
- unmarshalBulkCreateBlocklistsResponse,
571
- unmarshalCreateEmailResponse,
572
- unmarshalDomain,
573
- unmarshalDomainLastStatus,
574
- unmarshalEmail,
575
- unmarshalListBlocklistsResponse,
576
- unmarshalListDomainsResponse,
577
- unmarshalListEmailsResponse,
578
- unmarshalListOfferSubscriptionsResponse,
579
- unmarshalListOffersResponse,
580
- unmarshalListPoolsResponse,
581
- unmarshalListWebhookEventsResponse,
582
- unmarshalListWebhooksResponse,
583
- unmarshalOfferSubscription,
584
- unmarshalProjectConsumption,
585
- unmarshalProjectSettings,
586
- unmarshalStatistics,
587
- unmarshalWebhook
588
- };
407
+ export { marshalBulkCreateBlocklistsRequest, marshalCreateDomainRequest, marshalCreateEmailRequest, marshalCreateWebhookRequest, marshalUpdateDomainRequest, marshalUpdateOfferSubscriptionRequest, marshalUpdateProjectSettingsRequest, marshalUpdateWebhookRequest, unmarshalBulkCreateBlocklistsResponse, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalDomainLastStatus, unmarshalEmail, unmarshalListBlocklistsResponse, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalListOfferSubscriptionsResponse, unmarshalListOffersResponse, unmarshalListPoolsResponse, unmarshalListWebhookEventsResponse, unmarshalListWebhooksResponse, unmarshalOfferSubscription, unmarshalProjectConsumption, unmarshalProjectSettings, unmarshalStatistics, unmarshalWebhook };