@scaleway/sdk-tem 2.4.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.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1alpha1/api.gen.d.ts +2 -2
- package/dist/v1alpha1/api.gen.js +158 -337
- package/dist/v1alpha1/content.gen.js +2 -2
- package/dist/v1alpha1/marshalling.gen.js +48 -48
- package/dist/v1alpha1/metadata.gen.js +1 -1
- package/dist/v1alpha1/validation-rules.gen.js +15 -15
- package/package.json +15 -6
- package/LICENSE +0 -191
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is automatically generated
|
|
3
|
+
* PLEASE DO NOT EDIT HERE
|
|
4
|
+
*/
|
|
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
|
+
};
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
|
+
export default pkgMetadata;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/metadata.gen.ts
|
|
2
|
+
/**
|
|
3
|
+
* This file is automatically generated
|
|
4
|
+
* PLEASE DO NOT EDIT HERE
|
|
5
|
+
*/
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-tem",
|
|
8
|
+
namespace: "tem",
|
|
9
|
+
displayName: "Tem",
|
|
10
|
+
versions: ["v1alpha1"]
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
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.
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
3
|
+
const DOMAIN_TRANSIENT_STATUSES = ["pending", "autoconfiguring"];
|
|
4
4
|
/** Lists transient statutes of the enum {@link EmailStatus}. */
|
|
5
|
-
|
|
5
|
+
const EMAIL_TRANSIENT_STATUSES = ["new", "sending"];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES };
|