@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.
@@ -0,0 +1,533 @@
1
+ import { API as API$1, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
+ import { EMAIL_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus, marshalUpdateDomainRequest, marshalCreateWebhookRequest, unmarshalWebhook, unmarshalListWebhooksResponse, marshalUpdateWebhookRequest, unmarshalListWebhookEventsResponse, unmarshalProjectSettings, marshalUpdateProjectSettingsRequest, unmarshalListBlocklistsResponse, marshalBulkCreateBlocklistsRequest, unmarshalBulkCreateBlocklistsResponse, unmarshalListOfferSubscriptionsResponse, marshalUpdateOfferSubscriptionRequest, unmarshalOfferSubscription, unmarshalListOffersResponse, unmarshalListPoolsResponse, unmarshalProjectConsumption } from "./marshalling.gen.js";
4
+ const jsonContentHeaders = {
5
+ "Content-Type": "application/json; charset=utf-8"
6
+ };
7
+ class API extends API$1 {
8
+ /** Lists the available regions of the API. */
9
+ static LOCALITIES = ["fr-par"];
10
+ /**
11
+ * Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters.
12
+ *
13
+ * @param request - The request {@link CreateEmailRequest}
14
+ * @returns A Promise of CreateEmailResponse
15
+ */
16
+ createEmail = (request) => this.client.fetch(
17
+ {
18
+ body: JSON.stringify(
19
+ marshalCreateEmailRequest(request, this.client.settings)
20
+ ),
21
+ headers: jsonContentHeaders,
22
+ method: "POST",
23
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`
24
+ },
25
+ unmarshalCreateEmailResponse
26
+ );
27
+ /**
28
+ * Get an email. Retrieve information about a specific email using the `email_id` and `region` parameters.
29
+ *
30
+ * @param request - The request {@link GetEmailRequest}
31
+ * @returns A Promise of Email
32
+ */
33
+ getEmail = (request) => this.client.fetch(
34
+ {
35
+ method: "GET",
36
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}`
37
+ },
38
+ unmarshalEmail
39
+ );
40
+ /**
41
+ * Waits for {@link Email} to be in a final state.
42
+ *
43
+ * @param request - The request {@link GetEmailRequest}
44
+ * @param options - The waiting options
45
+ * @returns A Promise of Email
46
+ */
47
+ waitForEmail = (request, options) => waitForResource(
48
+ options?.stop ?? ((res) => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))),
49
+ this.getEmail,
50
+ request,
51
+ options
52
+ );
53
+ pageOfListEmails = (request = {}) => this.client.fetch(
54
+ {
55
+ method: "GET",
56
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`,
57
+ urlParams: urlParams(
58
+ ["domain_id", request.domainId],
59
+ ["flags", request.flags],
60
+ ["mail_from", request.mailFrom],
61
+ ["mail_rcpt", request.mailRcpt],
62
+ ["mail_to", request.mailTo],
63
+ ["message_id", request.messageId],
64
+ ["order_by", request.orderBy],
65
+ ["page", request.page],
66
+ [
67
+ "page_size",
68
+ request.pageSize ?? this.client.settings.defaultPageSize
69
+ ],
70
+ ["project_id", request.projectId],
71
+ ["search", request.search],
72
+ ["since", request.since],
73
+ ["statuses", request.statuses],
74
+ ["subject", request.subject],
75
+ ["until", request.until]
76
+ )
77
+ },
78
+ unmarshalListEmailsResponse
79
+ );
80
+ /**
81
+ * List emails. Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
82
+ *
83
+ * @param request - The request {@link ListEmailsRequest}
84
+ * @returns A Promise of ListEmailsResponse
85
+ */
86
+ listEmails = (request = {}) => enrichForPagination("emails", this.pageOfListEmails, request);
87
+ /**
88
+ * Email statuses. Get information on your emails' statuses.
89
+ *
90
+ * @param request - The request {@link GetStatisticsRequest}
91
+ * @returns A Promise of Statistics
92
+ */
93
+ getStatistics = (request = {}) => this.client.fetch(
94
+ {
95
+ method: "GET",
96
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/statistics`,
97
+ urlParams: urlParams(
98
+ ["domain_id", request.domainId],
99
+ ["mail_from", request.mailFrom],
100
+ ["project_id", request.projectId],
101
+ ["since", request.since],
102
+ ["until", request.until]
103
+ )
104
+ },
105
+ unmarshalStatistics
106
+ );
107
+ /**
108
+ * Cancel an email. You can cancel the sending of an email if it has not been sent yet. You must specify the `region` and the `email_id` of the email you want to cancel.
109
+ *
110
+ * @param request - The request {@link CancelEmailRequest}
111
+ * @returns A Promise of Email
112
+ */
113
+ cancelEmail = (request) => this.client.fetch(
114
+ {
115
+ body: "{}",
116
+ headers: jsonContentHeaders,
117
+ method: "POST",
118
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}/cancel`
119
+ },
120
+ unmarshalEmail
121
+ );
122
+ /**
123
+ * Register a domain in a project. You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
124
+ *
125
+ * @param request - The request {@link CreateDomainRequest}
126
+ * @returns A Promise of Domain
127
+ */
128
+ createDomain = (request) => this.client.fetch(
129
+ {
130
+ body: JSON.stringify(
131
+ marshalCreateDomainRequest(request, this.client.settings)
132
+ ),
133
+ headers: jsonContentHeaders,
134
+ method: "POST",
135
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
136
+ },
137
+ unmarshalDomain
138
+ );
139
+ /**
140
+ * Get information about a domain. Retrieve information about a specific domain using the `region` and `domain_id` parameters. Monitor your domain's reputation and improve **average** and **bad** reputation statuses, using your domain's **Email activity** tab on the [Scaleway console](https://console.scaleway.com/transactional-email/domains) to get a more detailed report. Check out our [dedicated documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/) to improve your domain's reputation.
141
+ *
142
+ * @param request - The request {@link GetDomainRequest}
143
+ * @returns A Promise of Domain
144
+ */
145
+ getDomain = (request) => this.client.fetch(
146
+ {
147
+ method: "GET",
148
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
149
+ },
150
+ unmarshalDomain
151
+ );
152
+ /**
153
+ * Waits for {@link Domain} to be in a final state.
154
+ *
155
+ * @param request - The request {@link GetDomainRequest}
156
+ * @param options - The waiting options
157
+ * @returns A Promise of Domain
158
+ */
159
+ waitForDomain = (request, options) => waitForResource(
160
+ options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))),
161
+ this.getDomain,
162
+ request,
163
+ options
164
+ );
165
+ pageOfListDomains = (request = {}) => this.client.fetch(
166
+ {
167
+ method: "GET",
168
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
169
+ urlParams: urlParams(
170
+ ["name", request.name],
171
+ ["organization_id", request.organizationId],
172
+ ["page", request.page],
173
+ [
174
+ "page_size",
175
+ request.pageSize ?? this.client.settings.defaultPageSize
176
+ ],
177
+ ["project_id", request.projectId],
178
+ ["status", request.status]
179
+ )
180
+ },
181
+ unmarshalListDomainsResponse
182
+ );
183
+ /**
184
+ * List domains. Retrieve domains in a specific Project or in a specific Organization using the `region` parameter.
185
+ *
186
+ * @param request - The request {@link ListDomainsRequest}
187
+ * @returns A Promise of ListDomainsResponse
188
+ */
189
+ listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
190
+ /**
191
+ * Delete a domain. You must specify the domain you want to delete by the `region` and `domain_id`. Deleting a domain is permanent and cannot be undone.
192
+ *
193
+ * @param request - The request {@link RevokeDomainRequest}
194
+ * @returns A Promise of Domain
195
+ */
196
+ revokeDomain = (request) => this.client.fetch(
197
+ {
198
+ body: "{}",
199
+ headers: jsonContentHeaders,
200
+ method: "POST",
201
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/revoke`
202
+ },
203
+ unmarshalDomain
204
+ );
205
+ /**
206
+ * Domain DNS check. Perform an immediate DNS check of a domain using the `region` and `domain_id` parameters.
207
+ *
208
+ * @param request - The request {@link CheckDomainRequest}
209
+ * @returns A Promise of Domain
210
+ */
211
+ checkDomain = (request) => this.client.fetch(
212
+ {
213
+ body: "{}",
214
+ headers: jsonContentHeaders,
215
+ method: "POST",
216
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/check`
217
+ },
218
+ unmarshalDomain
219
+ );
220
+ /**
221
+ * Display SPF and DKIM records status and potential errors. Display SPF and DKIM records status and potential errors, including the found records to make debugging easier.
222
+ *
223
+ * @param request - The request {@link GetDomainLastStatusRequest}
224
+ * @returns A Promise of DomainLastStatus
225
+ */
226
+ getDomainLastStatus = (request) => this.client.fetch(
227
+ {
228
+ method: "GET",
229
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/verification`
230
+ },
231
+ unmarshalDomainLastStatus
232
+ );
233
+ /**
234
+ * Update a domain. Update a domain auto-configuration.
235
+ *
236
+ * @param request - The request {@link UpdateDomainRequest}
237
+ * @returns A Promise of Domain
238
+ */
239
+ updateDomain = (request) => this.client.fetch(
240
+ {
241
+ body: JSON.stringify(
242
+ marshalUpdateDomainRequest(request, this.client.settings)
243
+ ),
244
+ headers: jsonContentHeaders,
245
+ method: "PATCH",
246
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
247
+ },
248
+ unmarshalDomain
249
+ );
250
+ /**
251
+ * Create a Webhook. Create a new Webhook triggered by a list of event types and pushed to a Scaleway SNS ARN.
252
+ *
253
+ * @param request - The request {@link CreateWebhookRequest}
254
+ * @returns A Promise of Webhook
255
+ */
256
+ createWebhook = (request) => this.client.fetch(
257
+ {
258
+ body: JSON.stringify(
259
+ marshalCreateWebhookRequest(request, this.client.settings)
260
+ ),
261
+ headers: jsonContentHeaders,
262
+ method: "POST",
263
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`
264
+ },
265
+ unmarshalWebhook
266
+ );
267
+ pageOfListWebhooks = (request = {}) => this.client.fetch(
268
+ {
269
+ method: "GET",
270
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`,
271
+ urlParams: urlParams(
272
+ ["domain_id", request.domainId],
273
+ ["order_by", request.orderBy],
274
+ ["organization_id", request.organizationId],
275
+ ["page", request.page],
276
+ [
277
+ "page_size",
278
+ request.pageSize ?? this.client.settings.defaultPageSize
279
+ ],
280
+ ["project_id", request.projectId]
281
+ )
282
+ },
283
+ unmarshalListWebhooksResponse
284
+ );
285
+ /**
286
+ * List Webhooks. Retrieve Webhooks in a specific Project or in a specific Organization using the `region` parameter.
287
+ *
288
+ * @param request - The request {@link ListWebhooksRequest}
289
+ * @returns A Promise of ListWebhooksResponse
290
+ */
291
+ listWebhooks = (request = {}) => enrichForPagination("webhooks", this.pageOfListWebhooks, request);
292
+ /**
293
+ * Get information about a Webhook. Retrieve information about a specific Webhook using the `webhook_id` and `region` parameters.
294
+ *
295
+ * @param request - The request {@link GetWebhookRequest}
296
+ * @returns A Promise of Webhook
297
+ */
298
+ getWebhook = (request) => this.client.fetch(
299
+ {
300
+ method: "GET",
301
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
302
+ },
303
+ unmarshalWebhook
304
+ );
305
+ /**
306
+ * Update a Webhook. Update a Webhook events type, SNS ARN or name.
307
+ *
308
+ * @param request - The request {@link UpdateWebhookRequest}
309
+ * @returns A Promise of Webhook
310
+ */
311
+ updateWebhook = (request) => this.client.fetch(
312
+ {
313
+ body: JSON.stringify(
314
+ marshalUpdateWebhookRequest(request, this.client.settings)
315
+ ),
316
+ headers: jsonContentHeaders,
317
+ method: "PATCH",
318
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
319
+ },
320
+ unmarshalWebhook
321
+ );
322
+ /**
323
+ * Delete a Webhook. You must specify the Webhook you want to delete by the `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be undone.
324
+ *
325
+ * @param request - The request {@link DeleteWebhookRequest}
326
+ */
327
+ deleteWebhook = (request) => this.client.fetch({
328
+ method: "DELETE",
329
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
330
+ });
331
+ pageOfListWebhookEvents = (request) => this.client.fetch(
332
+ {
333
+ method: "GET",
334
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}/events`,
335
+ urlParams: urlParams(
336
+ ["domain_id", request.domainId],
337
+ ["email_id", request.emailId],
338
+ ["event_types", request.eventTypes],
339
+ ["order_by", request.orderBy],
340
+ ["organization_id", request.organizationId],
341
+ ["page", request.page],
342
+ [
343
+ "page_size",
344
+ request.pageSize ?? this.client.settings.defaultPageSize
345
+ ],
346
+ ["project_id", request.projectId],
347
+ ["statuses", request.statuses]
348
+ )
349
+ },
350
+ unmarshalListWebhookEventsResponse
351
+ );
352
+ /**
353
+ * List Webhook triggered events. Retrieve the list of Webhook events triggered from a specific Webhook or for a specific Project or Organization. You must specify the `region`.
354
+ *
355
+ * @param request - The request {@link ListWebhookEventsRequest}
356
+ * @returns A Promise of ListWebhookEventsResponse
357
+ */
358
+ listWebhookEvents = (request) => enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
359
+ /**
360
+ * List project settings. Retrieve the project settings including periodic reports.
361
+ *
362
+ * @param request - The request {@link GetProjectSettingsRequest}
363
+ * @returns A Promise of ProjectSettings
364
+ */
365
+ getProjectSettings = (request = {}) => this.client.fetch(
366
+ {
367
+ method: "GET",
368
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
369
+ },
370
+ unmarshalProjectSettings
371
+ );
372
+ /**
373
+ * Update project settings. Update the project settings including periodic reports.
374
+ *
375
+ * @param request - The request {@link UpdateProjectSettingsRequest}
376
+ * @returns A Promise of ProjectSettings
377
+ */
378
+ updateProjectSettings = (request = {}) => this.client.fetch(
379
+ {
380
+ body: JSON.stringify(
381
+ marshalUpdateProjectSettingsRequest(request, this.client.settings)
382
+ ),
383
+ headers: jsonContentHeaders,
384
+ method: "PATCH",
385
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
386
+ },
387
+ unmarshalProjectSettings
388
+ );
389
+ pageOfListBlocklists = (request) => this.client.fetch(
390
+ {
391
+ method: "GET",
392
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`,
393
+ urlParams: urlParams(
394
+ ["custom", request.custom],
395
+ ["domain_id", request.domainId],
396
+ ["email", request.email],
397
+ ["order_by", request.orderBy],
398
+ ["page", request.page],
399
+ [
400
+ "page_size",
401
+ request.pageSize ?? this.client.settings.defaultPageSize
402
+ ],
403
+ ["type", request.type]
404
+ )
405
+ },
406
+ unmarshalListBlocklistsResponse
407
+ );
408
+ /**
409
+ * List blocklists. Retrieve the list of blocklists.
410
+ *
411
+ * @param request - The request {@link ListBlocklistsRequest}
412
+ * @returns A Promise of ListBlocklistsResponse
413
+ */
414
+ listBlocklists = (request) => enrichForPagination("blocklists", this.pageOfListBlocklists, request);
415
+ /**
416
+ * Bulk create blocklists. Create multiple blocklists in a specific Project or Organization using the `region` parameter.
417
+ *
418
+ * @param request - The request {@link BulkCreateBlocklistsRequest}
419
+ * @returns A Promise of BulkCreateBlocklistsResponse
420
+ */
421
+ bulkCreateBlocklists = (request) => this.client.fetch(
422
+ {
423
+ body: JSON.stringify(
424
+ marshalBulkCreateBlocklistsRequest(request, this.client.settings)
425
+ ),
426
+ headers: jsonContentHeaders,
427
+ method: "POST",
428
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`
429
+ },
430
+ unmarshalBulkCreateBlocklistsResponse
431
+ );
432
+ /**
433
+ * Delete a blocklist. You must specify the blocklist you want to delete by the `region` and `blocklist_id`.
434
+ *
435
+ * @param request - The request {@link DeleteBlocklistRequest}
436
+ */
437
+ deleteBlocklist = (request) => this.client.fetch({
438
+ method: "DELETE",
439
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists/${validatePathParam("blocklistId", request.blocklistId)}`
440
+ });
441
+ /**
442
+ * Get information about subscribed offers. Retrieve information about the offers you are subscribed to using the `project_id` and `region` parameters.
443
+ *
444
+ * @param request - The request {@link ListOfferSubscriptionsRequest}
445
+ * @returns A Promise of ListOfferSubscriptionsResponse
446
+ */
447
+ listOfferSubscriptions = (request = {}) => this.client.fetch(
448
+ {
449
+ method: "GET",
450
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`,
451
+ urlParams: urlParams([
452
+ "project_id",
453
+ request.projectId ?? this.client.settings.defaultProjectId
454
+ ])
455
+ },
456
+ unmarshalListOfferSubscriptionsResponse
457
+ );
458
+ /**
459
+ * Update a subscribed offer.
460
+ *
461
+ * @param request - The request {@link UpdateOfferSubscriptionRequest}
462
+ * @returns A Promise of OfferSubscription
463
+ */
464
+ updateOfferSubscription = (request = {}) => this.client.fetch(
465
+ {
466
+ body: JSON.stringify(
467
+ marshalUpdateOfferSubscriptionRequest(request, this.client.settings)
468
+ ),
469
+ headers: jsonContentHeaders,
470
+ method: "PATCH",
471
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`
472
+ },
473
+ unmarshalOfferSubscription
474
+ );
475
+ /**
476
+ * List the available offers.. Retrieve the list of the available and free-of-charge offers you can subscribe to.
477
+ *
478
+ * @param request - The request {@link ListOffersRequest}
479
+ * @returns A Promise of ListOffersResponse
480
+ */
481
+ listOffers = (request = {}) => this.client.fetch(
482
+ {
483
+ method: "GET",
484
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`
485
+ },
486
+ unmarshalListOffersResponse
487
+ );
488
+ pageOfListPools = (request = {}) => this.client.fetch(
489
+ {
490
+ method: "GET",
491
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools`,
492
+ urlParams: urlParams(
493
+ ["page", request.page],
494
+ [
495
+ "page_size",
496
+ request.pageSize ?? this.client.settings.defaultPageSize
497
+ ],
498
+ [
499
+ "project_id",
500
+ request.projectId ?? this.client.settings.defaultProjectId
501
+ ]
502
+ )
503
+ },
504
+ unmarshalListPoolsResponse
505
+ );
506
+ /**
507
+ * Get information about a sending pool.. Retrieve information about a sending pool, including its creation status and configuration parameters.
508
+ *
509
+ * @param request - The request {@link ListPoolsRequest}
510
+ * @returns A Promise of ListPoolsResponse
511
+ */
512
+ listPools = (request = {}) => enrichForPagination("pools", this.pageOfListPools, request);
513
+ /**
514
+ * Get project resource consumption.. Get project resource consumption.
515
+ *
516
+ * @param request - The request {@link GetProjectConsumptionRequest}
517
+ * @returns A Promise of ProjectConsumption
518
+ */
519
+ getProjectConsumption = (request = {}) => this.client.fetch(
520
+ {
521
+ method: "GET",
522
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project-consumption`,
523
+ urlParams: urlParams([
524
+ "project_id",
525
+ request.projectId ?? this.client.settings.defaultProjectId
526
+ ])
527
+ },
528
+ unmarshalProjectConsumption
529
+ );
530
+ }
531
+ export {
532
+ API
533
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const DOMAIN_TRANSIENT_STATUSES = [
4
+ "pending",
5
+ "autoconfiguring"
6
+ ];
7
+ const EMAIL_TRANSIENT_STATUSES = ["new", "sending"];
8
+ exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;
9
+ exports.EMAIL_TRANSIENT_STATUSES = EMAIL_TRANSIENT_STATUSES;
@@ -0,0 +1,5 @@
1
+ import type { DomainStatus, EmailStatus } from './types.gen';
2
+ /** Lists transient statutes of the enum {@link DomainStatus}. */
3
+ export declare const DOMAIN_TRANSIENT_STATUSES: DomainStatus[];
4
+ /** Lists transient statutes of the enum {@link EmailStatus}. */
5
+ export declare const EMAIL_TRANSIENT_STATUSES: EmailStatus[];
@@ -0,0 +1,9 @@
1
+ const DOMAIN_TRANSIENT_STATUSES = [
2
+ "pending",
3
+ "autoconfiguring"
4
+ ];
5
+ const EMAIL_TRANSIENT_STATUSES = ["new", "sending"];
6
+ export {
7
+ DOMAIN_TRANSIENT_STATUSES,
8
+ EMAIL_TRANSIENT_STATUSES
9
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const validationRules_gen = require("./validation-rules.gen.cjs");
7
+ exports.API = api_gen.API;
8
+ exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;
9
+ exports.EMAIL_TRANSIENT_STATUSES = content_gen.EMAIL_TRANSIENT_STATUSES;
10
+ exports.marshalBulkCreateBlocklistsRequest = marshalling_gen.marshalBulkCreateBlocklistsRequest;
11
+ exports.marshalCreateDomainRequest = marshalling_gen.marshalCreateDomainRequest;
12
+ exports.marshalCreateEmailRequest = marshalling_gen.marshalCreateEmailRequest;
13
+ exports.marshalCreateWebhookRequest = marshalling_gen.marshalCreateWebhookRequest;
14
+ exports.marshalUpdateDomainRequest = marshalling_gen.marshalUpdateDomainRequest;
15
+ exports.marshalUpdateOfferSubscriptionRequest = marshalling_gen.marshalUpdateOfferSubscriptionRequest;
16
+ exports.marshalUpdateProjectSettingsRequest = marshalling_gen.marshalUpdateProjectSettingsRequest;
17
+ exports.marshalUpdateWebhookRequest = marshalling_gen.marshalUpdateWebhookRequest;
18
+ exports.unmarshalBulkCreateBlocklistsResponse = marshalling_gen.unmarshalBulkCreateBlocklistsResponse;
19
+ exports.unmarshalCreateEmailResponse = marshalling_gen.unmarshalCreateEmailResponse;
20
+ exports.unmarshalDomain = marshalling_gen.unmarshalDomain;
21
+ exports.unmarshalDomainLastStatus = marshalling_gen.unmarshalDomainLastStatus;
22
+ exports.unmarshalEmail = marshalling_gen.unmarshalEmail;
23
+ exports.unmarshalListBlocklistsResponse = marshalling_gen.unmarshalListBlocklistsResponse;
24
+ exports.unmarshalListDomainsResponse = marshalling_gen.unmarshalListDomainsResponse;
25
+ exports.unmarshalListEmailsResponse = marshalling_gen.unmarshalListEmailsResponse;
26
+ exports.unmarshalListOfferSubscriptionsResponse = marshalling_gen.unmarshalListOfferSubscriptionsResponse;
27
+ exports.unmarshalListOffersResponse = marshalling_gen.unmarshalListOffersResponse;
28
+ exports.unmarshalListPoolsResponse = marshalling_gen.unmarshalListPoolsResponse;
29
+ exports.unmarshalListWebhookEventsResponse = marshalling_gen.unmarshalListWebhookEventsResponse;
30
+ exports.unmarshalListWebhooksResponse = marshalling_gen.unmarshalListWebhooksResponse;
31
+ exports.unmarshalOfferSubscription = marshalling_gen.unmarshalOfferSubscription;
32
+ exports.unmarshalProjectConsumption = marshalling_gen.unmarshalProjectConsumption;
33
+ exports.unmarshalProjectSettings = marshalling_gen.unmarshalProjectSettings;
34
+ exports.unmarshalStatistics = marshalling_gen.unmarshalStatistics;
35
+ exports.unmarshalWebhook = marshalling_gen.unmarshalWebhook;
36
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,5 @@
1
+ export { API } from './api.gen';
2
+ export * from './content.gen';
3
+ export * from './marshalling.gen';
4
+ export type { Blocklist, BlocklistType, BulkCreateBlocklistsRequest, BulkCreateBlocklistsResponse, CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailRequestAddress, CreateEmailRequestAttachment, CreateEmailRequestHeader, CreateEmailResponse, CreateWebhookRequest, DeleteBlocklistRequest, DeleteWebhookRequest, Domain, DomainLastStatus, DomainLastStatusAutoconfigState, DomainLastStatusAutoconfigStateReason, DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, DomainRecords, DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, DomainStatus, Email, EmailFlag, EmailRcptType, EmailStatus, EmailTry, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetProjectConsumptionRequest, GetProjectSettingsRequest, GetStatisticsRequest, GetWebhookRequest, ListBlocklistsRequest, ListBlocklistsRequestOrderBy, ListBlocklistsResponse, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsRequestOrderBy, ListEmailsResponse, ListOfferSubscriptionsRequest, ListOfferSubscriptionsResponse, ListOffersRequest, ListOffersResponse, ListPoolsRequest, ListPoolsResponse, ListWebhookEventsRequest, ListWebhookEventsRequestOrderBy, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksRequestOrderBy, ListWebhooksResponse, Offer, OfferName, OfferSubscription, Pool, PoolStatus, ProjectConsumption, ProjectSettings, ProjectSettingsPeriodicReport, ProjectSettingsPeriodicReportFrequency, RevokeDomainRequest, Statistics, UpdateDomainRequest, UpdateOfferSubscriptionRequest, UpdateProjectSettingsRequest, UpdateProjectSettingsRequestUpdatePeriodicReport, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus, WebhookEventType, } from './types.gen';
5
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,36 @@
1
+ import { API } from "./api.gen.js";
2
+ import { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { 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 } from "./marshalling.gen.js";
4
+ import * as validationRules_gen from "./validation-rules.gen.js";
5
+ export {
6
+ API,
7
+ DOMAIN_TRANSIENT_STATUSES,
8
+ EMAIL_TRANSIENT_STATUSES,
9
+ validationRules_gen as ValidationRules,
10
+ marshalBulkCreateBlocklistsRequest,
11
+ marshalCreateDomainRequest,
12
+ marshalCreateEmailRequest,
13
+ marshalCreateWebhookRequest,
14
+ marshalUpdateDomainRequest,
15
+ marshalUpdateOfferSubscriptionRequest,
16
+ marshalUpdateProjectSettingsRequest,
17
+ marshalUpdateWebhookRequest,
18
+ unmarshalBulkCreateBlocklistsResponse,
19
+ unmarshalCreateEmailResponse,
20
+ unmarshalDomain,
21
+ unmarshalDomainLastStatus,
22
+ unmarshalEmail,
23
+ unmarshalListBlocklistsResponse,
24
+ unmarshalListDomainsResponse,
25
+ unmarshalListEmailsResponse,
26
+ unmarshalListOfferSubscriptionsResponse,
27
+ unmarshalListOffersResponse,
28
+ unmarshalListPoolsResponse,
29
+ unmarshalListWebhookEventsResponse,
30
+ unmarshalListWebhooksResponse,
31
+ unmarshalOfferSubscription,
32
+ unmarshalProjectConsumption,
33
+ unmarshalProjectSettings,
34
+ unmarshalStatistics,
35
+ unmarshalWebhook
36
+ };