@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,246 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client';
3
+ import type { BulkCreateBlocklistsRequest, BulkCreateBlocklistsResponse, CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, CreateWebhookRequest, DeleteBlocklistRequest, DeleteWebhookRequest, Domain, DomainLastStatus, Email, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetProjectConsumptionRequest, GetProjectSettingsRequest, GetStatisticsRequest, GetWebhookRequest, ListBlocklistsRequest, ListBlocklistsResponse, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsResponse, ListOfferSubscriptionsRequest, ListOfferSubscriptionsResponse, ListOffersRequest, ListOffersResponse, ListPoolsRequest, ListPoolsResponse, ListWebhookEventsRequest, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksResponse, OfferSubscription, ProjectConsumption, ProjectSettings, RevokeDomainRequest, Statistics, UpdateDomainRequest, UpdateOfferSubscriptionRequest, UpdateProjectSettingsRequest, UpdateWebhookRequest, Webhook } from './types.gen';
4
+ /**
5
+ * Transactional Email API.
6
+
7
+ This API allows you to manage your Transactional Email services.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available regions of the API. */
11
+ static readonly LOCALITIES: ScwRegion[];
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: Readonly<CreateEmailRequest>) => Promise<CreateEmailResponse>;
19
+ /**
20
+ * Get an email. Retrieve information about a specific email using the `email_id` and `region` parameters.
21
+ *
22
+ * @param request - The request {@link GetEmailRequest}
23
+ * @returns A Promise of Email
24
+ */
25
+ getEmail: (request: Readonly<GetEmailRequest>) => Promise<Email>;
26
+ /**
27
+ * Waits for {@link Email} to be in a final state.
28
+ *
29
+ * @param request - The request {@link GetEmailRequest}
30
+ * @param options - The waiting options
31
+ * @returns A Promise of Email
32
+ */
33
+ waitForEmail: (request: Readonly<GetEmailRequest>, options?: Readonly<WaitForOptions<Email>>) => Promise<Email>;
34
+ protected pageOfListEmails: (request?: Readonly<ListEmailsRequest>) => Promise<ListEmailsResponse>;
35
+ /**
36
+ * List emails. Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
37
+ *
38
+ * @param request - The request {@link ListEmailsRequest}
39
+ * @returns A Promise of ListEmailsResponse
40
+ */
41
+ listEmails: (request?: Readonly<ListEmailsRequest>) => Promise<ListEmailsResponse> & {
42
+ all: () => Promise<Email[]>;
43
+ [Symbol.asyncIterator]: () => AsyncGenerator<Email[], void, void>;
44
+ };
45
+ /**
46
+ * Email statuses. Get information on your emails' statuses.
47
+ *
48
+ * @param request - The request {@link GetStatisticsRequest}
49
+ * @returns A Promise of Statistics
50
+ */
51
+ getStatistics: (request?: Readonly<GetStatisticsRequest>) => Promise<Statistics>;
52
+ /**
53
+ * 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.
54
+ *
55
+ * @param request - The request {@link CancelEmailRequest}
56
+ * @returns A Promise of Email
57
+ */
58
+ cancelEmail: (request: Readonly<CancelEmailRequest>) => Promise<Email>;
59
+ /**
60
+ * Register a domain in a project. You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
61
+ *
62
+ * @param request - The request {@link CreateDomainRequest}
63
+ * @returns A Promise of Domain
64
+ */
65
+ createDomain: (request: Readonly<CreateDomainRequest>) => Promise<Domain>;
66
+ /**
67
+ * 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.
68
+ *
69
+ * @param request - The request {@link GetDomainRequest}
70
+ * @returns A Promise of Domain
71
+ */
72
+ getDomain: (request: Readonly<GetDomainRequest>) => Promise<Domain>;
73
+ /**
74
+ * Waits for {@link Domain} to be in a final state.
75
+ *
76
+ * @param request - The request {@link GetDomainRequest}
77
+ * @param options - The waiting options
78
+ * @returns A Promise of Domain
79
+ */
80
+ waitForDomain: (request: Readonly<GetDomainRequest>, options?: Readonly<WaitForOptions<Domain>>) => Promise<Domain>;
81
+ protected pageOfListDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse>;
82
+ /**
83
+ * List domains. Retrieve domains in a specific Project or in a specific Organization using the `region` parameter.
84
+ *
85
+ * @param request - The request {@link ListDomainsRequest}
86
+ * @returns A Promise of ListDomainsResponse
87
+ */
88
+ listDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse> & {
89
+ all: () => Promise<Domain[]>;
90
+ [Symbol.asyncIterator]: () => AsyncGenerator<Domain[], void, void>;
91
+ };
92
+ /**
93
+ * 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.
94
+ *
95
+ * @param request - The request {@link RevokeDomainRequest}
96
+ * @returns A Promise of Domain
97
+ */
98
+ revokeDomain: (request: Readonly<RevokeDomainRequest>) => Promise<Domain>;
99
+ /**
100
+ * Domain DNS check. Perform an immediate DNS check of a domain using the `region` and `domain_id` parameters.
101
+ *
102
+ * @param request - The request {@link CheckDomainRequest}
103
+ * @returns A Promise of Domain
104
+ */
105
+ checkDomain: (request: Readonly<CheckDomainRequest>) => Promise<Domain>;
106
+ /**
107
+ * 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.
108
+ *
109
+ * @param request - The request {@link GetDomainLastStatusRequest}
110
+ * @returns A Promise of DomainLastStatus
111
+ */
112
+ getDomainLastStatus: (request: Readonly<GetDomainLastStatusRequest>) => Promise<DomainLastStatus>;
113
+ /**
114
+ * Update a domain. Update a domain auto-configuration.
115
+ *
116
+ * @param request - The request {@link UpdateDomainRequest}
117
+ * @returns A Promise of Domain
118
+ */
119
+ updateDomain: (request: Readonly<UpdateDomainRequest>) => Promise<Domain>;
120
+ /**
121
+ * Create a Webhook. Create a new Webhook triggered by a list of event types and pushed to a Scaleway SNS ARN.
122
+ *
123
+ * @param request - The request {@link CreateWebhookRequest}
124
+ * @returns A Promise of Webhook
125
+ */
126
+ createWebhook: (request: Readonly<CreateWebhookRequest>) => Promise<Webhook>;
127
+ protected pageOfListWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse>;
128
+ /**
129
+ * List Webhooks. Retrieve Webhooks in a specific Project or in a specific Organization using the `region` parameter.
130
+ *
131
+ * @param request - The request {@link ListWebhooksRequest}
132
+ * @returns A Promise of ListWebhooksResponse
133
+ */
134
+ listWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse> & {
135
+ all: () => Promise<Webhook[]>;
136
+ [Symbol.asyncIterator]: () => AsyncGenerator<Webhook[], void, void>;
137
+ };
138
+ /**
139
+ * Get information about a Webhook. Retrieve information about a specific Webhook using the `webhook_id` and `region` parameters.
140
+ *
141
+ * @param request - The request {@link GetWebhookRequest}
142
+ * @returns A Promise of Webhook
143
+ */
144
+ getWebhook: (request: Readonly<GetWebhookRequest>) => Promise<Webhook>;
145
+ /**
146
+ * Update a Webhook. Update a Webhook events type, SNS ARN or name.
147
+ *
148
+ * @param request - The request {@link UpdateWebhookRequest}
149
+ * @returns A Promise of Webhook
150
+ */
151
+ updateWebhook: (request: Readonly<UpdateWebhookRequest>) => Promise<Webhook>;
152
+ /**
153
+ * 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.
154
+ *
155
+ * @param request - The request {@link DeleteWebhookRequest}
156
+ */
157
+ deleteWebhook: (request: Readonly<DeleteWebhookRequest>) => Promise<void>;
158
+ protected pageOfListWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse>;
159
+ /**
160
+ * 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`.
161
+ *
162
+ * @param request - The request {@link ListWebhookEventsRequest}
163
+ * @returns A Promise of ListWebhookEventsResponse
164
+ */
165
+ listWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse> & {
166
+ all: () => Promise<import("./types.gen").WebhookEvent[]>;
167
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").WebhookEvent[], void, void>;
168
+ };
169
+ /**
170
+ * List project settings. Retrieve the project settings including periodic reports.
171
+ *
172
+ * @param request - The request {@link GetProjectSettingsRequest}
173
+ * @returns A Promise of ProjectSettings
174
+ */
175
+ getProjectSettings: (request?: Readonly<GetProjectSettingsRequest>) => Promise<ProjectSettings>;
176
+ /**
177
+ * Update project settings. Update the project settings including periodic reports.
178
+ *
179
+ * @param request - The request {@link UpdateProjectSettingsRequest}
180
+ * @returns A Promise of ProjectSettings
181
+ */
182
+ updateProjectSettings: (request?: Readonly<UpdateProjectSettingsRequest>) => Promise<ProjectSettings>;
183
+ protected pageOfListBlocklists: (request: Readonly<ListBlocklistsRequest>) => Promise<ListBlocklistsResponse>;
184
+ /**
185
+ * List blocklists. Retrieve the list of blocklists.
186
+ *
187
+ * @param request - The request {@link ListBlocklistsRequest}
188
+ * @returns A Promise of ListBlocklistsResponse
189
+ */
190
+ listBlocklists: (request: Readonly<ListBlocklistsRequest>) => Promise<ListBlocklistsResponse> & {
191
+ all: () => Promise<import("./types.gen").Blocklist[]>;
192
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Blocklist[], void, void>;
193
+ };
194
+ /**
195
+ * Bulk create blocklists. Create multiple blocklists in a specific Project or Organization using the `region` parameter.
196
+ *
197
+ * @param request - The request {@link BulkCreateBlocklistsRequest}
198
+ * @returns A Promise of BulkCreateBlocklistsResponse
199
+ */
200
+ bulkCreateBlocklists: (request: Readonly<BulkCreateBlocklistsRequest>) => Promise<BulkCreateBlocklistsResponse>;
201
+ /**
202
+ * Delete a blocklist. You must specify the blocklist you want to delete by the `region` and `blocklist_id`.
203
+ *
204
+ * @param request - The request {@link DeleteBlocklistRequest}
205
+ */
206
+ deleteBlocklist: (request: Readonly<DeleteBlocklistRequest>) => Promise<void>;
207
+ /**
208
+ * Get information about subscribed offers. Retrieve information about the offers you are subscribed to using the `project_id` and `region` parameters.
209
+ *
210
+ * @param request - The request {@link ListOfferSubscriptionsRequest}
211
+ * @returns A Promise of ListOfferSubscriptionsResponse
212
+ */
213
+ listOfferSubscriptions: (request?: Readonly<ListOfferSubscriptionsRequest>) => Promise<ListOfferSubscriptionsResponse>;
214
+ /**
215
+ * Update a subscribed offer.
216
+ *
217
+ * @param request - The request {@link UpdateOfferSubscriptionRequest}
218
+ * @returns A Promise of OfferSubscription
219
+ */
220
+ updateOfferSubscription: (request?: Readonly<UpdateOfferSubscriptionRequest>) => Promise<OfferSubscription>;
221
+ /**
222
+ * List the available offers.. Retrieve the list of the available and free-of-charge offers you can subscribe to.
223
+ *
224
+ * @param request - The request {@link ListOffersRequest}
225
+ * @returns A Promise of ListOffersResponse
226
+ */
227
+ listOffers: (request?: Readonly<ListOffersRequest>) => Promise<ListOffersResponse>;
228
+ protected pageOfListPools: (request?: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse>;
229
+ /**
230
+ * Get information about a sending pool.. Retrieve information about a sending pool, including its creation status and configuration parameters.
231
+ *
232
+ * @param request - The request {@link ListPoolsRequest}
233
+ * @returns A Promise of ListPoolsResponse
234
+ */
235
+ listPools: (request?: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse> & {
236
+ all: () => Promise<import("./types.gen").Pool[]>;
237
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Pool[], void, void>;
238
+ };
239
+ /**
240
+ * Get project resource consumption.. Get project resource consumption.
241
+ *
242
+ * @param request - The request {@link GetProjectConsumptionRequest}
243
+ * @returns A Promise of ProjectConsumption
244
+ */
245
+ getProjectConsumption: (request?: Readonly<GetProjectConsumptionRequest>) => Promise<ProjectConsumption>;
246
+ }