@scaleway/sdk-tem 2.2.0 → 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,600 +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(
342
- data.offer_subscriptions,
343
- unmarshalOfferSubscription
344
- ),
345
- totalCount: data.total_count
346
- };
347
- };
348
- const unmarshalOffer = (data) => {
349
- if (!isJSONObject(data)) {
350
- throw new TypeError(
351
- `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
352
- );
353
- }
354
- return {
355
- commitmentPeriod: data.commitment_period,
356
- createdAt: unmarshalDate(data.created_at),
357
- includedMonthlyEmails: data.included_monthly_emails,
358
- maxCustomBlocklistsPerDomain: data.max_custom_blocklists_per_domain,
359
- maxDedicatedIps: data.max_dedicated_ips,
360
- maxDomains: data.max_domains,
361
- maxWebhooksPerDomain: data.max_webhooks_per_domain,
362
- name: data.name,
363
- sla: data.sla
364
- };
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
+ };
365
254
  };
366
255
  const unmarshalListOffersResponse = (data) => {
367
- if (!isJSONObject(data)) {
368
- throw new TypeError(
369
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
370
- );
371
- }
372
- return {
373
- offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
374
- totalCount: data.total_count
375
- };
376
- };
377
- const unmarshalPool = (data) => {
378
- if (!isJSONObject(data)) {
379
- throw new TypeError(
380
- `Unmarshalling the type 'Pool' failed as data isn't a dictionary.`
381
- );
382
- }
383
- return {
384
- details: data.details,
385
- ips: data.ips,
386
- projectId: data.project_id,
387
- reverse: data.reverse,
388
- status: data.status,
389
- zone: data.zone
390
- };
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
+ };
391
272
  };
392
273
  const unmarshalListPoolsResponse = (data) => {
393
- if (!isJSONObject(data)) {
394
- throw new TypeError(
395
- `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`
396
- );
397
- }
398
- return {
399
- pools: unmarshalArrayOfObject(data.pools, unmarshalPool),
400
- totalCount: data.total_count
401
- };
402
- };
403
- const unmarshalWebhookEvent = (data) => {
404
- if (!isJSONObject(data)) {
405
- throw new TypeError(
406
- `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`
407
- );
408
- }
409
- return {
410
- createdAt: unmarshalDate(data.created_at),
411
- data: data.data,
412
- domainId: data.domain_id,
413
- emailId: data.email_id,
414
- id: data.id,
415
- organizationId: data.organization_id,
416
- projectId: data.project_id,
417
- status: data.status,
418
- type: data.type,
419
- updatedAt: unmarshalDate(data.updated_at),
420
- webhookId: data.webhook_id
421
- };
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
+ };
422
295
  };
423
296
  const unmarshalListWebhookEventsResponse = (data) => {
424
- if (!isJSONObject(data)) {
425
- throw new TypeError(
426
- `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`
427
- );
428
- }
429
- return {
430
- totalCount: data.total_count,
431
- webhookEvents: unmarshalArrayOfObject(
432
- data.webhook_events,
433
- unmarshalWebhookEvent
434
- )
435
- };
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
+ };
436
302
  };
437
303
  const unmarshalListWebhooksResponse = (data) => {
438
- if (!isJSONObject(data)) {
439
- throw new TypeError(
440
- `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`
441
- );
442
- }
443
- return {
444
- totalCount: data.total_count,
445
- webhooks: unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)
446
- };
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
+ };
447
309
  };
448
310
  const unmarshalProjectConsumption = (data) => {
449
- if (!isJSONObject(data)) {
450
- throw new TypeError(
451
- `Unmarshalling the type 'ProjectConsumption' failed as data isn't a dictionary.`
452
- );
453
- }
454
- return {
455
- customBlocklistsCount: data.custom_blocklists_count,
456
- dedicatedIpsCount: data.dedicated_ips_count,
457
- domainsCount: data.domains_count,
458
- monthlyEmailsCount: data.monthly_emails_count,
459
- projectId: data.project_id,
460
- webhooksCount: data.webhooks_count
461
- };
462
- };
463
- const unmarshalProjectSettingsPeriodicReport = (data) => {
464
- if (!isJSONObject(data)) {
465
- throw new TypeError(
466
- `Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.`
467
- );
468
- }
469
- return {
470
- enabled: data.enabled,
471
- frequency: data.frequency,
472
- sendingDay: data.sending_day,
473
- sendingHour: data.sending_hour
474
- };
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
+ };
475
329
  };
476
330
  const unmarshalProjectSettings = (data) => {
477
- if (!isJSONObject(data)) {
478
- throw new TypeError(
479
- `Unmarshalling the type 'ProjectSettings' failed as data isn't a dictionary.`
480
- );
481
- }
482
- return {
483
- periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : void 0
484
- };
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 };
485
333
  };
486
334
  const unmarshalStatistics = (data) => {
487
- if (!isJSONObject(data)) {
488
- throw new TypeError(
489
- `Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`
490
- );
491
- }
492
- return {
493
- canceledCount: data.canceled_count,
494
- failedCount: data.failed_count,
495
- newCount: data.new_count,
496
- sendingCount: data.sending_count,
497
- sentCount: data.sent_count,
498
- totalCount: data.total_count
499
- };
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
+ };
500
344
  };
501
345
  const marshalBulkCreateBlocklistsRequest = (request, defaults) => ({
502
- domain_id: request.domainId,
503
- emails: request.emails,
504
- reason: request.reason,
505
- type: request.type
346
+ domain_id: request.domainId,
347
+ emails: request.emails,
348
+ reason: request.reason,
349
+ type: request.type
506
350
  });
507
351
  const marshalCreateDomainRequest = (request, defaults) => ({
508
- accept_tos: request.acceptTos,
509
- autoconfig: request.autoconfig,
510
- domain_name: request.domainName,
511
- 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
512
356
  });
513
- const marshalCreateEmailRequestAddress = (request, defaults) => ({
514
- email: request.email,
515
- name: request.name
357
+ var marshalCreateEmailRequestAddress = (request, defaults) => ({
358
+ email: request.email,
359
+ name: request.name
516
360
  });
517
- const marshalCreateEmailRequestAttachment = (request, defaults) => ({
518
- content: request.content,
519
- name: request.name,
520
- type: request.type
361
+ var marshalCreateEmailRequestAttachment = (request, defaults) => ({
362
+ content: request.content,
363
+ name: request.name,
364
+ type: request.type
521
365
  });
522
- const marshalCreateEmailRequestHeader = (request, defaults) => ({
523
- key: request.key,
524
- value: request.value
366
+ var marshalCreateEmailRequestHeader = (request, defaults) => ({
367
+ key: request.key,
368
+ value: request.value
525
369
  });
526
370
  const marshalCreateEmailRequest = (request, defaults) => ({
527
- additional_headers: request.additionalHeaders !== void 0 ? request.additionalHeaders.map(
528
- (elt) => marshalCreateEmailRequestHeader(elt)
529
- ) : void 0,
530
- attachments: request.attachments !== void 0 ? request.attachments.map(
531
- (elt) => marshalCreateEmailRequestAttachment(elt)
532
- ) : void 0,
533
- bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
534
- cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
535
- from: marshalCreateEmailRequestAddress(request.from),
536
- html: request.html,
537
- project_id: request.projectId ?? defaults.defaultProjectId,
538
- send_before: request.sendBefore,
539
- subject: request.subject,
540
- text: request.text,
541
- 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
542
382
  });
543
383
  const marshalCreateWebhookRequest = (request, defaults) => ({
544
- domain_id: request.domainId,
545
- event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
546
- name: request.name,
547
- project_id: request.projectId ?? defaults.defaultProjectId,
548
- sns_arn: request.snsArn
549
- });
550
- const marshalUpdateDomainRequest = (request, defaults) => ({
551
- 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
552
389
  });
390
+ const marshalUpdateDomainRequest = (request, defaults) => ({ autoconfig: request.autoconfig });
553
391
  const marshalUpdateOfferSubscriptionRequest = (request, defaults) => ({
554
- name: request.name,
555
- project_id: request.projectId ?? defaults.defaultProjectId
556
- });
557
- const marshalUpdateProjectSettingsRequestUpdatePeriodicReport = (request, defaults) => ({
558
- enabled: request.enabled,
559
- frequency: request.frequency,
560
- sending_day: request.sendingDay,
561
- sending_hour: request.sendingHour
392
+ name: request.name,
393
+ project_id: request.projectId ?? defaults.defaultProjectId
562
394
  });
563
- const marshalUpdateProjectSettingsRequest = (request, defaults) => ({
564
- periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(
565
- request.periodicReport
566
- ) : 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
567
400
  });
401
+ const marshalUpdateProjectSettingsRequest = (request, defaults) => ({ periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(request.periodicReport, defaults) : void 0 });
568
402
  const marshalUpdateWebhookRequest = (request, defaults) => ({
569
- event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
570
- name: request.name,
571
- sns_arn: request.snsArn
403
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
404
+ name: request.name,
405
+ sns_arn: request.snsArn
572
406
  });
573
- export {
574
- marshalBulkCreateBlocklistsRequest,
575
- marshalCreateDomainRequest,
576
- marshalCreateEmailRequest,
577
- marshalCreateWebhookRequest,
578
- marshalUpdateDomainRequest,
579
- marshalUpdateOfferSubscriptionRequest,
580
- marshalUpdateProjectSettingsRequest,
581
- marshalUpdateWebhookRequest,
582
- unmarshalBulkCreateBlocklistsResponse,
583
- unmarshalCreateEmailResponse,
584
- unmarshalDomain,
585
- unmarshalDomainLastStatus,
586
- unmarshalEmail,
587
- unmarshalListBlocklistsResponse,
588
- unmarshalListDomainsResponse,
589
- unmarshalListEmailsResponse,
590
- unmarshalListOfferSubscriptionsResponse,
591
- unmarshalListOffersResponse,
592
- unmarshalListPoolsResponse,
593
- unmarshalListWebhookEventsResponse,
594
- unmarshalListWebhooksResponse,
595
- unmarshalOfferSubscription,
596
- unmarshalProjectConsumption,
597
- unmarshalProjectSettings,
598
- unmarshalStatistics,
599
- unmarshalWebhook
600
- };
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 };