@scaleway/sdk-tem 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -2,11 +2,11 @@
2
2
  * This file is automatically generated
3
3
  * PLEASE DO NOT EDIT HERE
4
4
  */
5
- export type Metadata = {
6
- name: string;
7
- namespace: string;
8
- displayName: string;
9
- versions: string[];
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-tem";
7
+ readonly namespace: "tem";
8
+ readonly displayName: "Tem";
9
+ readonly versions: readonly ["v1alpha1"];
10
10
  };
11
- export declare const pkgMetadata: Metadata;
11
+ export type Metadata = typeof pkgMetadata;
12
12
  export default pkgMetadata;
@@ -1,9 +1,13 @@
1
- import metadata_gen_default from "./metadata2.gen.js";
2
1
  //#region src/metadata.gen.ts
3
2
  /**
4
3
  * This file is automatically generated
5
4
  * PLEASE DO NOT EDIT HERE
6
5
  */
7
- var pkgMetadata = metadata_gen_default;
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-tem",
8
+ namespace: "tem",
9
+ displayName: "Tem",
10
+ versions: ["v1alpha1"]
11
+ };
8
12
  //#endregion
9
13
  export { pkgMetadata as default, pkgMetadata };
@@ -33,7 +33,7 @@ export declare class API extends ParentAPI {
33
33
  * @param options - The waiting options
34
34
  * @returns A Promise of Email
35
35
  */
36
- waitForEmail: (request: Readonly<GetEmailRequest>, options?: Readonly<WaitForOptions<Email>>) => Promise<Email>;
36
+ waitForEmail: (request: Readonly<GetEmailRequest>, options?: Readonly<WaitForOptions<Email>> | undefined) => Promise<Email>;
37
37
  protected pageOfListEmails: (request?: Readonly<ListEmailsRequest>) => Promise<ListEmailsResponse>;
38
38
  /**
39
39
  * List emails. Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
@@ -80,7 +80,7 @@ export declare class API extends ParentAPI {
80
80
  * @param options - The waiting options
81
81
  * @returns A Promise of Domain
82
82
  */
83
- waitForDomain: (request: Readonly<GetDomainRequest>, options?: Readonly<WaitForOptions<Domain>>) => Promise<Domain>;
83
+ waitForDomain: (request: Readonly<GetDomainRequest>, options?: Readonly<WaitForOptions<Domain>> | undefined) => Promise<Domain>;
84
84
  protected pageOfListDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse>;
85
85
  /**
86
86
  * List domains. Retrieve domains in a specific Project or in a specific Organization using the `region` parameter.
@@ -2,349 +2,170 @@ import { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES } from "./content.g
2
2
  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";
3
3
  import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v1alpha1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Transactional Email API.
8
8
 
9
9
  This API allows you to manage your Transactional Email services.
10
10
  */
11
11
  var API = class extends API$1 {
12
- /**
13
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ regions: ["fr-par"] });
17
- /**
18
- * 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.
19
- *
20
- * @param request - The request {@link CreateEmailRequest}
21
- * @returns A Promise of CreateEmailResponse
22
- */
23
- createEmail = (request) => this.client.fetch({
24
- body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),
25
- headers: jsonContentHeaders,
26
- method: "POST",
27
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`
28
- }, unmarshalCreateEmailResponse);
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
- method: "GET",
37
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}`
38
- }, unmarshalEmail);
39
- /**
40
- * Waits for {@link Email} to be in a final state.
41
- *
42
- * @param request - The request {@link GetEmailRequest}
43
- * @param options - The waiting options
44
- * @returns A Promise of Email
45
- */
46
- waitForEmail = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options);
47
- pageOfListEmails = (request = {}) => this.client.fetch({
48
- method: "GET",
49
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`,
50
- urlParams: urlParams(["domain_id", request.domainId], ["flags", request.flags], ["mail_from", request.mailFrom], ["mail_rcpt", request.mailRcpt], ["mail_to", request.mailTo], ["message_id", request.messageId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["search", request.search], ["since", request.since], ["statuses", request.statuses], ["subject", request.subject], ["until", request.until])
51
- }, unmarshalListEmailsResponse);
52
- /**
53
- * List emails. Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
54
- *
55
- * @param request - The request {@link ListEmailsRequest}
56
- * @returns A Promise of ListEmailsResponse
57
- */
58
- listEmails = (request = {}) => enrichForPagination("emails", this.pageOfListEmails, request);
59
- /**
60
- * Email statuses. Get information on your emails' statuses.
61
- *
62
- * @param request - The request {@link GetStatisticsRequest}
63
- * @returns A Promise of Statistics
64
- */
65
- getStatistics = (request = {}) => this.client.fetch({
66
- method: "GET",
67
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/statistics`,
68
- urlParams: urlParams(["domain_id", request.domainId], ["mail_from", request.mailFrom], ["project_id", request.projectId], ["since", request.since], ["until", request.until])
69
- }, unmarshalStatistics);
70
- /**
71
- * 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.
72
- *
73
- * @param request - The request {@link CancelEmailRequest}
74
- * @returns A Promise of Email
75
- */
76
- cancelEmail = (request) => this.client.fetch({
77
- body: "{}",
78
- headers: jsonContentHeaders,
79
- method: "POST",
80
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}/cancel`
81
- }, unmarshalEmail);
82
- /**
83
- * Register a domain in a project. You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
84
- *
85
- * @param request - The request {@link CreateDomainRequest}
86
- * @returns A Promise of Domain
87
- */
88
- createDomain = (request) => this.client.fetch({
89
- body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
90
- headers: jsonContentHeaders,
91
- method: "POST",
92
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
93
- }, unmarshalDomain);
94
- /**
95
- * 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.
96
- *
97
- * @param request - The request {@link GetDomainRequest}
98
- * @returns A Promise of Domain
99
- */
100
- getDomain = (request) => this.client.fetch({
101
- method: "GET",
102
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
103
- }, unmarshalDomain);
104
- /**
105
- * Waits for {@link Domain} to be in a final state.
106
- *
107
- * @param request - The request {@link GetDomainRequest}
108
- * @param options - The waiting options
109
- * @returns A Promise of Domain
110
- */
111
- waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
112
- pageOfListDomains = (request = {}) => this.client.fetch({
113
- method: "GET",
114
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
115
- urlParams: urlParams(["name", request.name], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["status", request.status])
116
- }, unmarshalListDomainsResponse);
117
- /**
118
- * List domains. Retrieve domains in a specific Project or in a specific Organization using the `region` parameter.
119
- *
120
- * @param request - The request {@link ListDomainsRequest}
121
- * @returns A Promise of ListDomainsResponse
122
- */
123
- listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
124
- /**
125
- * 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.
126
- *
127
- * @param request - The request {@link RevokeDomainRequest}
128
- * @returns A Promise of Domain
129
- */
130
- revokeDomain = (request) => this.client.fetch({
131
- body: "{}",
132
- headers: jsonContentHeaders,
133
- method: "POST",
134
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/revoke`
135
- }, unmarshalDomain);
136
- /**
137
- * Domain DNS check. Perform an immediate DNS check of a domain using the `region` and `domain_id` parameters.
138
- *
139
- * @param request - The request {@link CheckDomainRequest}
140
- * @returns A Promise of Domain
141
- */
142
- checkDomain = (request) => this.client.fetch({
143
- body: "{}",
144
- headers: jsonContentHeaders,
145
- method: "POST",
146
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/check`
147
- }, unmarshalDomain);
148
- /**
149
- * Display SPF, DKIM, DMARC and MX records status and potential errors. Display SPF, DKIM, DMARC and MX records status and potential errors, including the found records to make debugging easier.
150
- *
151
- * @param request - The request {@link GetDomainLastStatusRequest}
152
- * @returns A Promise of DomainLastStatus
153
- */
154
- getDomainLastStatus = (request) => this.client.fetch({
155
- method: "GET",
156
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/verification`
157
- }, unmarshalDomainLastStatus);
158
- /**
159
- * Update a domain. Update a domain auto-configuration.
160
- *
161
- * @param request - The request {@link UpdateDomainRequest}
162
- * @returns A Promise of Domain
163
- */
164
- updateDomain = (request) => this.client.fetch({
165
- body: JSON.stringify(marshalUpdateDomainRequest(request, this.client.settings)),
166
- headers: jsonContentHeaders,
167
- method: "PATCH",
168
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
169
- }, unmarshalDomain);
170
- /**
171
- * Create a Webhook. Create a new Webhook triggered by a list of event types and pushed to a Scaleway SNS ARN.
172
- *
173
- * @param request - The request {@link CreateWebhookRequest}
174
- * @returns A Promise of Webhook
175
- */
176
- createWebhook = (request) => this.client.fetch({
177
- body: JSON.stringify(marshalCreateWebhookRequest(request, this.client.settings)),
178
- headers: jsonContentHeaders,
179
- method: "POST",
180
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`
181
- }, unmarshalWebhook);
182
- pageOfListWebhooks = (request = {}) => this.client.fetch({
183
- method: "GET",
184
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`,
185
- urlParams: urlParams(["domain_id", request.domainId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
186
- }, unmarshalListWebhooksResponse);
187
- /**
188
- * List Webhooks. Retrieve Webhooks in a specific Project or in a specific Organization using the `region` parameter.
189
- *
190
- * @param request - The request {@link ListWebhooksRequest}
191
- * @returns A Promise of ListWebhooksResponse
192
- */
193
- listWebhooks = (request = {}) => enrichForPagination("webhooks", this.pageOfListWebhooks, request);
194
- /**
195
- * Get information about a Webhook. Retrieve information about a specific Webhook using the `webhook_id` and `region` parameters.
196
- *
197
- * @param request - The request {@link GetWebhookRequest}
198
- * @returns A Promise of Webhook
199
- */
200
- getWebhook = (request) => this.client.fetch({
201
- method: "GET",
202
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
203
- }, unmarshalWebhook);
204
- /**
205
- * Update a Webhook. Update a Webhook events type, SNS ARN or name.
206
- *
207
- * @param request - The request {@link UpdateWebhookRequest}
208
- * @returns A Promise of Webhook
209
- */
210
- updateWebhook = (request) => this.client.fetch({
211
- body: JSON.stringify(marshalUpdateWebhookRequest(request, this.client.settings)),
212
- headers: jsonContentHeaders,
213
- method: "PATCH",
214
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
215
- }, unmarshalWebhook);
216
- /**
217
- * 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.
218
- *
219
- * @param request - The request {@link DeleteWebhookRequest}
220
- */
221
- deleteWebhook = (request) => this.client.fetch({
222
- method: "DELETE",
223
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
224
- });
225
- pageOfListWebhookEvents = (request) => this.client.fetch({
226
- method: "GET",
227
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}/events`,
228
- urlParams: urlParams(["domain_id", request.domainId], ["email_id", request.emailId], ["event_types", request.eventTypes], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["statuses", request.statuses])
229
- }, unmarshalListWebhookEventsResponse);
230
- /**
231
- * 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`.
232
- *
233
- * @param request - The request {@link ListWebhookEventsRequest}
234
- * @returns A Promise of ListWebhookEventsResponse
235
- */
236
- listWebhookEvents = (request) => enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
237
- /**
238
- * List project settings. Retrieve the project settings including periodic reports.
239
- *
240
- * @param request - The request {@link GetProjectSettingsRequest}
241
- * @returns A Promise of ProjectSettings
242
- */
243
- getProjectSettings = (request = {}) => this.client.fetch({
244
- method: "GET",
245
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
246
- }, unmarshalProjectSettings);
247
- /**
248
- * Update project settings. Update the project settings including periodic reports.
249
- *
250
- * @param request - The request {@link UpdateProjectSettingsRequest}
251
- * @returns A Promise of ProjectSettings
252
- */
253
- updateProjectSettings = (request = {}) => this.client.fetch({
254
- body: JSON.stringify(marshalUpdateProjectSettingsRequest(request, this.client.settings)),
255
- headers: jsonContentHeaders,
256
- method: "PATCH",
257
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
258
- }, unmarshalProjectSettings);
259
- pageOfListBlocklists = (request) => this.client.fetch({
260
- method: "GET",
261
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`,
262
- urlParams: urlParams(["custom", request.custom], ["domain_id", request.domainId], ["email", request.email], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["type", request.type])
263
- }, unmarshalListBlocklistsResponse);
264
- /**
265
- * List blocklists. Retrieve the list of blocklists.
266
- *
267
- * @param request - The request {@link ListBlocklistsRequest}
268
- * @returns A Promise of ListBlocklistsResponse
269
- */
270
- listBlocklists = (request) => enrichForPagination("blocklists", this.pageOfListBlocklists, request);
271
- /**
272
- * Bulk create blocklists. Create multiple blocklists in a specific Project or Organization using the `region` parameter.
273
- *
274
- * @param request - The request {@link BulkCreateBlocklistsRequest}
275
- * @returns A Promise of BulkCreateBlocklistsResponse
276
- */
277
- bulkCreateBlocklists = (request) => this.client.fetch({
278
- body: JSON.stringify(marshalBulkCreateBlocklistsRequest(request, this.client.settings)),
279
- headers: jsonContentHeaders,
280
- method: "POST",
281
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`
282
- }, unmarshalBulkCreateBlocklistsResponse);
283
- /**
284
- * Delete a blocklist. You must specify the blocklist you want to delete by the `region` and `blocklist_id`.
285
- *
286
- * @param request - The request {@link DeleteBlocklistRequest}
287
- */
288
- deleteBlocklist = (request) => this.client.fetch({
289
- method: "DELETE",
290
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists/${validatePathParam("blocklistId", request.blocklistId)}`
291
- });
292
- /**
293
- * Get information about subscribed offers. Retrieve information about the offers you are subscribed to using the `project_id` and `region` parameters.
294
- *
295
- * @param request - The request {@link ListOfferSubscriptionsRequest}
296
- * @returns A Promise of ListOfferSubscriptionsResponse
297
- */
298
- listOfferSubscriptions = (request = {}) => this.client.fetch({
299
- method: "GET",
300
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`,
301
- urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
302
- }, unmarshalListOfferSubscriptionsResponse);
303
- /**
304
- * Update a subscribed offer.
305
- *
306
- * @param request - The request {@link UpdateOfferSubscriptionRequest}
307
- * @returns A Promise of OfferSubscription
308
- */
309
- updateOfferSubscription = (request = {}) => this.client.fetch({
310
- body: JSON.stringify(marshalUpdateOfferSubscriptionRequest(request, this.client.settings)),
311
- headers: jsonContentHeaders,
312
- method: "PATCH",
313
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`
314
- }, unmarshalOfferSubscription);
315
- /**
316
- * List the available offers.. Retrieve the list of the available and free-of-charge offers you can subscribe to.
317
- *
318
- * @param request - The request {@link ListOffersRequest}
319
- * @returns A Promise of ListOffersResponse
320
- */
321
- listOffers = (request = {}) => this.client.fetch({
322
- method: "GET",
323
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`
324
- }, unmarshalListOffersResponse);
325
- pageOfListPools = (request = {}) => this.client.fetch({
326
- method: "GET",
327
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools`,
328
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
329
- }, unmarshalListPoolsResponse);
330
- /**
331
- * Get information about a sending pool.. Retrieve information about a sending pool, including its creation status and configuration parameters.
332
- *
333
- * @param request - The request {@link ListPoolsRequest}
334
- * @returns A Promise of ListPoolsResponse
335
- */
336
- listPools = (request = {}) => enrichForPagination("pools", this.pageOfListPools, request);
337
- /**
338
- * Get project resource consumption.. Get project resource consumption.
339
- *
340
- * @param request - The request {@link GetProjectConsumptionRequest}
341
- * @returns A Promise of ProjectConsumption
342
- */
343
- getProjectConsumption = (request = {}) => this.client.fetch({
344
- method: "GET",
345
- path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project-consumption`,
346
- urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
347
- }, unmarshalProjectConsumption);
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.createEmail = (request) => this.client.fetch({
15
+ body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),
16
+ headers: jsonContentHeaders,
17
+ method: "POST",
18
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`
19
+ }, unmarshalCreateEmailResponse);
20
+ this.getEmail = (request) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}`
23
+ }, unmarshalEmail);
24
+ this.waitForEmail = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options);
25
+ this.pageOfListEmails = (request = {}) => this.client.fetch({
26
+ method: "GET",
27
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`,
28
+ urlParams: urlParams(["domain_id", request.domainId], ["flags", request.flags], ["mail_from", request.mailFrom], ["mail_rcpt", request.mailRcpt], ["mail_to", request.mailTo], ["message_id", request.messageId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["search", request.search], ["since", request.since], ["statuses", request.statuses], ["subject", request.subject], ["until", request.until])
29
+ }, unmarshalListEmailsResponse);
30
+ this.listEmails = (request = {}) => enrichForPagination("emails", this.pageOfListEmails, request);
31
+ this.getStatistics = (request = {}) => this.client.fetch({
32
+ method: "GET",
33
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/statistics`,
34
+ urlParams: urlParams(["domain_id", request.domainId], ["mail_from", request.mailFrom], ["project_id", request.projectId], ["since", request.since], ["until", request.until])
35
+ }, unmarshalStatistics);
36
+ this.cancelEmail = (request) => this.client.fetch({
37
+ body: "{}",
38
+ headers: jsonContentHeaders,
39
+ method: "POST",
40
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam("emailId", request.emailId)}/cancel`
41
+ }, unmarshalEmail);
42
+ this.createDomain = (request) => this.client.fetch({
43
+ body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
44
+ headers: jsonContentHeaders,
45
+ method: "POST",
46
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
47
+ }, unmarshalDomain);
48
+ this.getDomain = (request) => this.client.fetch({
49
+ method: "GET",
50
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
51
+ }, unmarshalDomain);
52
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
53
+ this.pageOfListDomains = (request = {}) => this.client.fetch({
54
+ method: "GET",
55
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
56
+ urlParams: urlParams(["name", request.name], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["status", request.status])
57
+ }, unmarshalListDomainsResponse);
58
+ this.listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
59
+ this.revokeDomain = (request) => this.client.fetch({
60
+ body: "{}",
61
+ headers: jsonContentHeaders,
62
+ method: "POST",
63
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/revoke`
64
+ }, unmarshalDomain);
65
+ this.checkDomain = (request) => this.client.fetch({
66
+ body: "{}",
67
+ headers: jsonContentHeaders,
68
+ method: "POST",
69
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/check`
70
+ }, unmarshalDomain);
71
+ this.getDomainLastStatus = (request) => this.client.fetch({
72
+ method: "GET",
73
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}/verification`
74
+ }, unmarshalDomainLastStatus);
75
+ this.updateDomain = (request) => this.client.fetch({
76
+ body: JSON.stringify(marshalUpdateDomainRequest(request, this.client.settings)),
77
+ headers: jsonContentHeaders,
78
+ method: "PATCH",
79
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
80
+ }, unmarshalDomain);
81
+ this.createWebhook = (request) => this.client.fetch({
82
+ body: JSON.stringify(marshalCreateWebhookRequest(request, this.client.settings)),
83
+ headers: jsonContentHeaders,
84
+ method: "POST",
85
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`
86
+ }, unmarshalWebhook);
87
+ this.pageOfListWebhooks = (request = {}) => this.client.fetch({
88
+ method: "GET",
89
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`,
90
+ urlParams: urlParams(["domain_id", request.domainId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
91
+ }, unmarshalListWebhooksResponse);
92
+ this.listWebhooks = (request = {}) => enrichForPagination("webhooks", this.pageOfListWebhooks, request);
93
+ this.getWebhook = (request) => this.client.fetch({
94
+ method: "GET",
95
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
96
+ }, unmarshalWebhook);
97
+ this.updateWebhook = (request) => this.client.fetch({
98
+ body: JSON.stringify(marshalUpdateWebhookRequest(request, this.client.settings)),
99
+ headers: jsonContentHeaders,
100
+ method: "PATCH",
101
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
102
+ }, unmarshalWebhook);
103
+ this.deleteWebhook = (request) => this.client.fetch({
104
+ method: "DELETE",
105
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
106
+ });
107
+ this.pageOfListWebhookEvents = (request) => this.client.fetch({
108
+ method: "GET",
109
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}/events`,
110
+ urlParams: urlParams(["domain_id", request.domainId], ["email_id", request.emailId], ["event_types", request.eventTypes], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["statuses", request.statuses])
111
+ }, unmarshalListWebhookEventsResponse);
112
+ this.listWebhookEvents = (request) => enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
113
+ this.getProjectSettings = (request = {}) => this.client.fetch({
114
+ method: "GET",
115
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
116
+ }, unmarshalProjectSettings);
117
+ this.updateProjectSettings = (request = {}) => this.client.fetch({
118
+ body: JSON.stringify(marshalUpdateProjectSettingsRequest(request, this.client.settings)),
119
+ headers: jsonContentHeaders,
120
+ method: "PATCH",
121
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings`
122
+ }, unmarshalProjectSettings);
123
+ this.pageOfListBlocklists = (request) => this.client.fetch({
124
+ method: "GET",
125
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`,
126
+ urlParams: urlParams(["custom", request.custom], ["domain_id", request.domainId], ["email", request.email], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["type", request.type])
127
+ }, unmarshalListBlocklistsResponse);
128
+ this.listBlocklists = (request) => enrichForPagination("blocklists", this.pageOfListBlocklists, request);
129
+ this.bulkCreateBlocklists = (request) => this.client.fetch({
130
+ body: JSON.stringify(marshalBulkCreateBlocklistsRequest(request, this.client.settings)),
131
+ headers: jsonContentHeaders,
132
+ method: "POST",
133
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists`
134
+ }, unmarshalBulkCreateBlocklistsResponse);
135
+ this.deleteBlocklist = (request) => this.client.fetch({
136
+ method: "DELETE",
137
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/blocklists/${validatePathParam("blocklistId", request.blocklistId)}`
138
+ });
139
+ this.listOfferSubscriptions = (request = {}) => this.client.fetch({
140
+ method: "GET",
141
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`,
142
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
143
+ }, unmarshalListOfferSubscriptionsResponse);
144
+ this.updateOfferSubscription = (request = {}) => this.client.fetch({
145
+ body: JSON.stringify(marshalUpdateOfferSubscriptionRequest(request, this.client.settings)),
146
+ headers: jsonContentHeaders,
147
+ method: "PATCH",
148
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`
149
+ }, unmarshalOfferSubscription);
150
+ this.listOffers = (request = {}) => this.client.fetch({
151
+ method: "GET",
152
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`
153
+ }, unmarshalListOffersResponse);
154
+ this.pageOfListPools = (request = {}) => this.client.fetch({
155
+ method: "GET",
156
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools`,
157
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
158
+ }, unmarshalListPoolsResponse);
159
+ this.listPools = (request = {}) => enrichForPagination("pools", this.pageOfListPools, request);
160
+ this.getProjectConsumption = (request = {}) => this.client.fetch({
161
+ method: "GET",
162
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project-consumption`,
163
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
164
+ }, unmarshalProjectConsumption);
165
+ }
166
+ static {
167
+ this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
168
+ }
348
169
  };
349
170
  //#endregion
350
171
  export { API };
@@ -1,7 +1,7 @@
1
1
  //#region src/v1alpha1/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link DomainStatus}. */
3
- var DOMAIN_TRANSIENT_STATUSES = ["pending", "autoconfiguring"];
3
+ const DOMAIN_TRANSIENT_STATUSES = ["pending", "autoconfiguring"];
4
4
  /** Lists transient statutes of the enum {@link EmailStatus}. */
5
- var EMAIL_TRANSIENT_STATUSES = ["new", "sending"];
5
+ const EMAIL_TRANSIENT_STATUSES = ["new", "sending"];
6
6
  //#endregion
7
7
  export { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES };