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