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