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