@scaleway/sdk-mnq 2.2.0 → 2.3.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.
@@ -1,466 +1,318 @@
1
- import { API, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalNatsApiCreateNatsAccountRequest, unmarshalNatsAccount, marshalNatsApiUpdateNatsAccountRequest, unmarshalListNatsAccountsResponse, marshalNatsApiCreateNatsCredentialsRequest, unmarshalNatsCredentials, unmarshalListNatsCredentialsResponse, marshalSnsApiActivateSnsRequest, unmarshalSnsInfo, marshalSnsApiDeactivateSnsRequest, marshalSnsApiCreateSnsCredentialsRequest, unmarshalSnsCredentials, marshalSnsApiUpdateSnsCredentialsRequest, unmarshalListSnsCredentialsResponse, marshalSqsApiActivateSqsRequest, unmarshalSqsInfo, marshalSqsApiDeactivateSqsRequest, marshalSqsApiCreateSqsCredentialsRequest, unmarshalSqsCredentials, marshalSqsApiUpdateSqsCredentialsRequest, unmarshalListSqsCredentialsResponse } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
1
+ import { marshalNatsApiCreateNatsAccountRequest, marshalNatsApiCreateNatsCredentialsRequest, marshalNatsApiUpdateNatsAccountRequest, marshalSnsApiActivateSnsRequest, marshalSnsApiCreateSnsCredentialsRequest, marshalSnsApiDeactivateSnsRequest, marshalSnsApiUpdateSnsCredentialsRequest, marshalSqsApiActivateSqsRequest, marshalSqsApiCreateSqsCredentialsRequest, marshalSqsApiDeactivateSqsRequest, marshalSqsApiUpdateSqsCredentialsRequest, unmarshalListNatsAccountsResponse, unmarshalListNatsCredentialsResponse, unmarshalListSnsCredentialsResponse, unmarshalListSqsCredentialsResponse, unmarshalNatsAccount, unmarshalNatsCredentials, unmarshalSnsCredentials, unmarshalSnsInfo, unmarshalSqsCredentials, unmarshalSqsInfo } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * NATS API.
6
+
7
+ This API allows you to manage Scaleway NATS accounts.
8
+ */
9
+ var NatsAPI = class extends API {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = toApiLocality({ regions: ["fr-par", "nl-ams"] });
15
+ /**
16
+ * Create a NATS account. Create a NATS account associated with a Project.
17
+ *
18
+ * @param request - The request {@link NatsApiCreateNatsAccountRequest}
19
+ * @returns A Promise of NatsAccount
20
+ */
21
+ createNatsAccount = (request = {}) => this.client.fetch({
22
+ body: JSON.stringify(marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)),
23
+ headers: jsonContentHeaders,
24
+ method: "POST",
25
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`
26
+ }, unmarshalNatsAccount);
27
+ /**
28
+ * Delete a NATS account. Delete a NATS account, specified by its NATS account ID. Note that deleting a NATS account is irreversible, and any credentials, streams, consumer and stored messages belonging to this NATS account will also be deleted.
29
+ *
30
+ * @param request - The request {@link NatsApiDeleteNatsAccountRequest}
31
+ */
32
+ deleteNatsAccount = (request) => this.client.fetch({
33
+ method: "DELETE",
34
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
35
+ });
36
+ /**
37
+ * Update the name of a NATS account. Update the name of a NATS account, specified by its NATS account ID.
38
+ *
39
+ * @param request - The request {@link NatsApiUpdateNatsAccountRequest}
40
+ * @returns A Promise of NatsAccount
41
+ */
42
+ updateNatsAccount = (request) => this.client.fetch({
43
+ body: JSON.stringify(marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)),
44
+ headers: jsonContentHeaders,
45
+ method: "PATCH",
46
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
47
+ }, unmarshalNatsAccount);
48
+ /**
49
+ * Get a NATS account. Retrieve information about an existing NATS account identified by its NATS account ID. Its full details, including name and endpoint, are returned in the response.
50
+ *
51
+ * @param request - The request {@link NatsApiGetNatsAccountRequest}
52
+ * @returns A Promise of NatsAccount
53
+ */
54
+ getNatsAccount = (request) => this.client.fetch({
55
+ method: "GET",
56
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
57
+ }, unmarshalNatsAccount);
58
+ pageOfListNatsAccounts = (request = {}) => this.client.fetch({
59
+ method: "GET",
60
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`,
61
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
62
+ }, unmarshalListNatsAccountsResponse);
63
+ /**
64
+ * List NATS accounts. List all NATS accounts in the specified region, for a Scaleway Organization or Project. By default, the NATS accounts returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
65
+ *
66
+ * @param request - The request {@link NatsApiListNatsAccountsRequest}
67
+ * @returns A Promise of ListNatsAccountsResponse
68
+ */
69
+ listNatsAccounts = (request = {}) => enrichForPagination("natsAccounts", this.pageOfListNatsAccounts, request);
70
+ /**
71
+ * Create NATS credentials. Create a set of credentials for a NATS account, specified by its NATS account ID.
72
+ *
73
+ * @param request - The request {@link NatsApiCreateNatsCredentialsRequest}
74
+ * @returns A Promise of NatsCredentials
75
+ */
76
+ createNatsCredentials = (request) => this.client.fetch({
77
+ body: JSON.stringify(marshalNatsApiCreateNatsCredentialsRequest(request, this.client.settings)),
78
+ headers: jsonContentHeaders,
79
+ method: "POST",
80
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`
81
+ }, unmarshalNatsCredentials);
82
+ /**
83
+ * Delete NATS credentials. Delete a set of credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the NATS account, and active connections using this credentials will be closed.
84
+ *
85
+ * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}
86
+ */
87
+ deleteNatsCredentials = (request) => this.client.fetch({
88
+ method: "DELETE",
89
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
90
+ });
91
+ /**
92
+ * Get NATS credentials. Retrieve an existing set of credentials, identified by the `nats_credentials_id`. The credentials themselves are NOT returned, only their metadata (NATS account ID, credentials name, etc), are returned in the response.
93
+ *
94
+ * @param request - The request {@link NatsApiGetNatsCredentialsRequest}
95
+ * @returns A Promise of NatsCredentials
96
+ */
97
+ getNatsCredentials = (request) => this.client.fetch({
98
+ method: "GET",
99
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
100
+ }, unmarshalNatsCredentials);
101
+ pageOfListNatsCredentials = (request = {}) => this.client.fetch({
102
+ method: "GET",
103
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`,
104
+ urlParams: urlParams(["nats_account_id", request.natsAccountId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
105
+ }, unmarshalListNatsCredentialsResponse);
106
+ /**
107
+ * List NATS credentials. List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
108
+ *
109
+ * @param request - The request {@link NatsApiListNatsCredentialsRequest}
110
+ * @returns A Promise of ListNatsCredentialsResponse
111
+ */
112
+ listNatsCredentials = (request = {}) => enrichForPagination("natsCredentials", this.pageOfListNatsCredentials, request);
5
113
  };
6
- class NatsAPI extends API {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- regions: ["fr-par", "nl-ams"]
13
- });
14
- /**
15
- * Create a NATS account. Create a NATS account associated with a Project.
16
- *
17
- * @param request - The request {@link NatsApiCreateNatsAccountRequest}
18
- * @returns A Promise of NatsAccount
19
- */
20
- createNatsAccount = (request = {}) => this.client.fetch(
21
- {
22
- body: JSON.stringify(
23
- marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)
24
- ),
25
- headers: jsonContentHeaders,
26
- method: "POST",
27
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`
28
- },
29
- unmarshalNatsAccount
30
- );
31
- /**
32
- * Delete a NATS account. Delete a NATS account, specified by its NATS account ID. Note that deleting a NATS account is irreversible, and any credentials, streams, consumer and stored messages belonging to this NATS account will also be deleted.
33
- *
34
- * @param request - The request {@link NatsApiDeleteNatsAccountRequest}
35
- */
36
- deleteNatsAccount = (request) => this.client.fetch({
37
- method: "DELETE",
38
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
39
- });
40
- /**
41
- * Update the name of a NATS account. Update the name of a NATS account, specified by its NATS account ID.
42
- *
43
- * @param request - The request {@link NatsApiUpdateNatsAccountRequest}
44
- * @returns A Promise of NatsAccount
45
- */
46
- updateNatsAccount = (request) => this.client.fetch(
47
- {
48
- body: JSON.stringify(
49
- marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)
50
- ),
51
- headers: jsonContentHeaders,
52
- method: "PATCH",
53
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
54
- },
55
- unmarshalNatsAccount
56
- );
57
- /**
58
- * Get a NATS account. Retrieve information about an existing NATS account identified by its NATS account ID. Its full details, including name and endpoint, are returned in the response.
59
- *
60
- * @param request - The request {@link NatsApiGetNatsAccountRequest}
61
- * @returns A Promise of NatsAccount
62
- */
63
- getNatsAccount = (request) => this.client.fetch(
64
- {
65
- method: "GET",
66
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
67
- },
68
- unmarshalNatsAccount
69
- );
70
- pageOfListNatsAccounts = (request = {}) => this.client.fetch(
71
- {
72
- method: "GET",
73
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`,
74
- urlParams: urlParams(
75
- ["order_by", request.orderBy],
76
- ["page", request.page],
77
- [
78
- "page_size",
79
- request.pageSize ?? this.client.settings.defaultPageSize
80
- ],
81
- ["project_id", request.projectId]
82
- )
83
- },
84
- unmarshalListNatsAccountsResponse
85
- );
86
- /**
87
- * List NATS accounts. List all NATS accounts in the specified region, for a Scaleway Organization or Project. By default, the NATS accounts returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
88
- *
89
- * @param request - The request {@link NatsApiListNatsAccountsRequest}
90
- * @returns A Promise of ListNatsAccountsResponse
91
- */
92
- listNatsAccounts = (request = {}) => enrichForPagination("natsAccounts", this.pageOfListNatsAccounts, request);
93
- /**
94
- * Create NATS credentials. Create a set of credentials for a NATS account, specified by its NATS account ID.
95
- *
96
- * @param request - The request {@link NatsApiCreateNatsCredentialsRequest}
97
- * @returns A Promise of NatsCredentials
98
- */
99
- createNatsCredentials = (request) => this.client.fetch(
100
- {
101
- body: JSON.stringify(
102
- marshalNatsApiCreateNatsCredentialsRequest(
103
- request,
104
- this.client.settings
105
- )
106
- ),
107
- headers: jsonContentHeaders,
108
- method: "POST",
109
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`
110
- },
111
- unmarshalNatsCredentials
112
- );
113
- /**
114
- * Delete NATS credentials. Delete a set of credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the NATS account, and active connections using this credentials will be closed.
115
- *
116
- * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}
117
- */
118
- deleteNatsCredentials = (request) => this.client.fetch({
119
- method: "DELETE",
120
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
121
- });
122
- /**
123
- * Get NATS credentials. Retrieve an existing set of credentials, identified by the `nats_credentials_id`. The credentials themselves are NOT returned, only their metadata (NATS account ID, credentials name, etc), are returned in the response.
124
- *
125
- * @param request - The request {@link NatsApiGetNatsCredentialsRequest}
126
- * @returns A Promise of NatsCredentials
127
- */
128
- getNatsCredentials = (request) => this.client.fetch(
129
- {
130
- method: "GET",
131
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
132
- },
133
- unmarshalNatsCredentials
134
- );
135
- pageOfListNatsCredentials = (request = {}) => this.client.fetch(
136
- {
137
- method: "GET",
138
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`,
139
- urlParams: urlParams(
140
- ["nats_account_id", request.natsAccountId],
141
- ["order_by", request.orderBy],
142
- ["page", request.page],
143
- [
144
- "page_size",
145
- request.pageSize ?? this.client.settings.defaultPageSize
146
- ],
147
- ["project_id", request.projectId]
148
- )
149
- },
150
- unmarshalListNatsCredentialsResponse
151
- );
152
- /**
153
- * List NATS credentials. List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
154
- *
155
- * @param request - The request {@link NatsApiListNatsCredentialsRequest}
156
- * @returns A Promise of ListNatsCredentialsResponse
157
- */
158
- listNatsCredentials = (request = {}) => enrichForPagination(
159
- "natsCredentials",
160
- this.pageOfListNatsCredentials,
161
- request
162
- );
163
- }
164
- class SnsAPI extends API {
165
- /**
166
- * Locality of this API.
167
- * type ∈ {'zone','region','global','unspecified'}
168
- */
169
- static LOCALITY = toApiLocality({
170
- regions: ["fr-par", "nl-ams"]
171
- });
172
- /**
173
- * Activate Topics and Events. Activate Topics and Events for the specified Project ID. Topics and Events must be activated before any usage. Activating Topics and Events does not trigger any billing, and you can deactivate at any time.
174
- *
175
- * @param request - The request {@link SnsApiActivateSnsRequest}
176
- * @returns A Promise of SnsInfo
177
- */
178
- activateSns = (request = {}) => this.client.fetch(
179
- {
180
- body: JSON.stringify(
181
- marshalSnsApiActivateSnsRequest(request, this.client.settings)
182
- ),
183
- headers: jsonContentHeaders,
184
- method: "POST",
185
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sns`
186
- },
187
- unmarshalSnsInfo
188
- );
189
- /**
190
- * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. information include the activation status and the Topics and Events API endpoint URL.
191
- *
192
- * @param request - The request {@link SnsApiGetSnsInfoRequest}
193
- * @returns A Promise of SnsInfo
194
- */
195
- getSnsInfo = (request = {}) => this.client.fetch(
196
- {
197
- method: "GET",
198
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-info`,
199
- urlParams: urlParams([
200
- "project_id",
201
- request.projectId ?? this.client.settings.defaultProjectId
202
- ])
203
- },
204
- unmarshalSnsInfo
205
- );
206
- /**
207
- * Deactivate Topics and Events. Deactivate Topics and Events for the specified Project ID. You must delete all topics and credentials before this call or you need to set the force_delete parameter.
208
- *
209
- * @param request - The request {@link SnsApiDeactivateSnsRequest}
210
- * @returns A Promise of SnsInfo
211
- */
212
- deactivateSns = (request = {}) => this.client.fetch(
213
- {
214
- body: JSON.stringify(
215
- marshalSnsApiDeactivateSnsRequest(request, this.client.settings)
216
- ),
217
- headers: jsonContentHeaders,
218
- method: "POST",
219
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sns`
220
- },
221
- unmarshalSnsInfo
222
- );
223
- /**
224
- * Create Topics and Events credentials. Create a set of credentials for Topics and Events, specified by a Project ID. Credentials give the bearer access to topics, and the level of permissions can be defined granularly.
225
- *
226
- * @param request - The request {@link SnsApiCreateSnsCredentialsRequest}
227
- * @returns A Promise of SnsCredentials
228
- */
229
- createSnsCredentials = (request = {}) => this.client.fetch(
230
- {
231
- body: JSON.stringify(
232
- marshalSnsApiCreateSnsCredentialsRequest(
233
- request,
234
- this.client.settings
235
- )
236
- ),
237
- headers: jsonContentHeaders,
238
- method: "POST",
239
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`
240
- },
241
- unmarshalSnsCredentials
242
- );
243
- /**
244
- * Delete Topics and Events credentials. Delete a set of Topics and Events credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Topics and Events.
245
- *
246
- * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}
247
- */
248
- deleteSnsCredentials = (request) => this.client.fetch({
249
- method: "DELETE",
250
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
251
- });
252
- /**
253
- * Update Topics and Events credentials. Update a set of Topics and Events credentials. You can update the credentials' name, or their permissions.
254
- *
255
- * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest}
256
- * @returns A Promise of SnsCredentials
257
- */
258
- updateSnsCredentials = (request) => this.client.fetch(
259
- {
260
- body: JSON.stringify(
261
- marshalSnsApiUpdateSnsCredentialsRequest(
262
- request,
263
- this.client.settings
264
- )
265
- ),
266
- headers: jsonContentHeaders,
267
- method: "PATCH",
268
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
269
- },
270
- unmarshalSnsCredentials
271
- );
272
- /**
273
- * Get Topics and Events credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
274
- *
275
- * @param request - The request {@link SnsApiGetSnsCredentialsRequest}
276
- * @returns A Promise of SnsCredentials
277
- */
278
- getSnsCredentials = (request) => this.client.fetch(
279
- {
280
- method: "GET",
281
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
282
- },
283
- unmarshalSnsCredentials
284
- );
285
- pageOfListSnsCredentials = (request = {}) => this.client.fetch(
286
- {
287
- method: "GET",
288
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`,
289
- urlParams: urlParams(
290
- ["order_by", request.orderBy],
291
- ["page", request.page],
292
- [
293
- "page_size",
294
- request.pageSize ?? this.client.settings.defaultPageSize
295
- ],
296
- ["project_id", request.projectId]
297
- )
298
- },
299
- unmarshalListSnsCredentialsResponse
300
- );
301
- /**
302
- * List Topics and Events credentials. List existing Topics and Events credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
303
- *
304
- * @param request - The request {@link SnsApiListSnsCredentialsRequest}
305
- * @returns A Promise of ListSnsCredentialsResponse
306
- */
307
- listSnsCredentials = (request = {}) => enrichForPagination(
308
- "snsCredentials",
309
- this.pageOfListSnsCredentials,
310
- request
311
- );
312
- }
313
- class SqsAPI extends API {
314
- /**
315
- * Locality of this API.
316
- * type ∈ {'zone','region','global','unspecified'}
317
- */
318
- static LOCALITY = toApiLocality({
319
- regions: ["fr-par", "nl-ams"]
320
- });
321
- /**
322
- * Activate Queues. Activate Queues for the specified Project ID. Queues must be activated before any usage such as creating credentials and queues. Activating Queues does not trigger any billing, and you can deactivate at any time.
323
- *
324
- * @param request - The request {@link SqsApiActivateSqsRequest}
325
- * @returns A Promise of SqsInfo
326
- */
327
- activateSqs = (request = {}) => this.client.fetch(
328
- {
329
- body: JSON.stringify(
330
- marshalSqsApiActivateSqsRequest(request, this.client.settings)
331
- ),
332
- headers: jsonContentHeaders,
333
- method: "POST",
334
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sqs`
335
- },
336
- unmarshalSqsInfo
337
- );
338
- /**
339
- * Get Queues info. Retrieve the Queues information of the specified Project ID. information include the activation status and the Queues API endpoint URL.
340
- *
341
- * @param request - The request {@link SqsApiGetSqsInfoRequest}
342
- * @returns A Promise of SqsInfo
343
- */
344
- getSqsInfo = (request = {}) => this.client.fetch(
345
- {
346
- method: "GET",
347
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-info`,
348
- urlParams: urlParams([
349
- "project_id",
350
- request.projectId ?? this.client.settings.defaultProjectId
351
- ])
352
- },
353
- unmarshalSqsInfo
354
- );
355
- /**
356
- * Deactivate Queues. Deactivate Queues for the specified Project ID. You must delete all queues and credentials before this call or you need to set the force_delete parameter.
357
- *
358
- * @param request - The request {@link SqsApiDeactivateSqsRequest}
359
- * @returns A Promise of SqsInfo
360
- */
361
- deactivateSqs = (request = {}) => this.client.fetch(
362
- {
363
- body: JSON.stringify(
364
- marshalSqsApiDeactivateSqsRequest(request, this.client.settings)
365
- ),
366
- headers: jsonContentHeaders,
367
- method: "POST",
368
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs`
369
- },
370
- unmarshalSqsInfo
371
- );
372
- /**
373
- * Create Queues credentials. Create a set of credentials for Queues, specified by a Project ID. Credentials give the bearer access to queues, and the level of permissions can be defined granularly.
374
- *
375
- * @param request - The request {@link SqsApiCreateSqsCredentialsRequest}
376
- * @returns A Promise of SqsCredentials
377
- */
378
- createSqsCredentials = (request = {}) => this.client.fetch(
379
- {
380
- body: JSON.stringify(
381
- marshalSqsApiCreateSqsCredentialsRequest(
382
- request,
383
- this.client.settings
384
- )
385
- ),
386
- headers: jsonContentHeaders,
387
- method: "POST",
388
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`
389
- },
390
- unmarshalSqsCredentials
391
- );
392
- /**
393
- * Delete Queues credentials. Delete a set of Queues credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Queues.
394
- *
395
- * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}
396
- */
397
- deleteSqsCredentials = (request) => this.client.fetch({
398
- method: "DELETE",
399
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
400
- });
401
- /**
402
- * Update Queues credentials. Update a set of Queues credentials. You can update the credentials' name, or their permissions.
403
- *
404
- * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest}
405
- * @returns A Promise of SqsCredentials
406
- */
407
- updateSqsCredentials = (request) => this.client.fetch(
408
- {
409
- body: JSON.stringify(
410
- marshalSqsApiUpdateSqsCredentialsRequest(
411
- request,
412
- this.client.settings
413
- )
414
- ),
415
- headers: jsonContentHeaders,
416
- method: "PATCH",
417
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
418
- },
419
- unmarshalSqsCredentials
420
- );
421
- /**
422
- * Get Queues credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
423
- *
424
- * @param request - The request {@link SqsApiGetSqsCredentialsRequest}
425
- * @returns A Promise of SqsCredentials
426
- */
427
- getSqsCredentials = (request) => this.client.fetch(
428
- {
429
- method: "GET",
430
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
431
- },
432
- unmarshalSqsCredentials
433
- );
434
- pageOfListSqsCredentials = (request = {}) => this.client.fetch(
435
- {
436
- method: "GET",
437
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`,
438
- urlParams: urlParams(
439
- ["order_by", request.orderBy],
440
- ["page", request.page],
441
- [
442
- "page_size",
443
- request.pageSize ?? this.client.settings.defaultPageSize
444
- ],
445
- ["project_id", request.projectId]
446
- )
447
- },
448
- unmarshalListSqsCredentialsResponse
449
- );
450
- /**
451
- * List Queues credentials. List existing Queues credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
452
- *
453
- * @param request - The request {@link SqsApiListSqsCredentialsRequest}
454
- * @returns A Promise of ListSqsCredentialsResponse
455
- */
456
- listSqsCredentials = (request = {}) => enrichForPagination(
457
- "sqsCredentials",
458
- this.pageOfListSqsCredentials,
459
- request
460
- );
461
- }
462
- export {
463
- NatsAPI,
464
- SnsAPI,
465
- SqsAPI
114
+ /**
115
+ * Topics and Events API.
116
+
117
+ This API allows you to manage your Scaleway Topics and Events.
118
+ */
119
+ var SnsAPI = class extends API {
120
+ /**
121
+ * Locality of this API.
122
+ * type ∈ {'zone','region','global','unspecified'}
123
+ */
124
+ static LOCALITY = toApiLocality({ regions: ["fr-par", "nl-ams"] });
125
+ /**
126
+ * Activate Topics and Events. Activate Topics and Events for the specified Project ID. Topics and Events must be activated before any usage. Activating Topics and Events does not trigger any billing, and you can deactivate at any time.
127
+ *
128
+ * @param request - The request {@link SnsApiActivateSnsRequest}
129
+ * @returns A Promise of SnsInfo
130
+ */
131
+ activateSns = (request = {}) => this.client.fetch({
132
+ body: JSON.stringify(marshalSnsApiActivateSnsRequest(request, this.client.settings)),
133
+ headers: jsonContentHeaders,
134
+ method: "POST",
135
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sns`
136
+ }, unmarshalSnsInfo);
137
+ /**
138
+ * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. information include the activation status and the Topics and Events API endpoint URL.
139
+ *
140
+ * @param request - The request {@link SnsApiGetSnsInfoRequest}
141
+ * @returns A Promise of SnsInfo
142
+ */
143
+ getSnsInfo = (request = {}) => this.client.fetch({
144
+ method: "GET",
145
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-info`,
146
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
147
+ }, unmarshalSnsInfo);
148
+ /**
149
+ * Deactivate Topics and Events. Deactivate Topics and Events for the specified Project ID. You must delete all topics and credentials before this call or you need to set the force_delete parameter.
150
+ *
151
+ * @param request - The request {@link SnsApiDeactivateSnsRequest}
152
+ * @returns A Promise of SnsInfo
153
+ */
154
+ deactivateSns = (request = {}) => this.client.fetch({
155
+ body: JSON.stringify(marshalSnsApiDeactivateSnsRequest(request, this.client.settings)),
156
+ headers: jsonContentHeaders,
157
+ method: "POST",
158
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sns`
159
+ }, unmarshalSnsInfo);
160
+ /**
161
+ * Create Topics and Events credentials. Create a set of credentials for Topics and Events, specified by a Project ID. Credentials give the bearer access to topics, and the level of permissions can be defined granularly.
162
+ *
163
+ * @param request - The request {@link SnsApiCreateSnsCredentialsRequest}
164
+ * @returns A Promise of SnsCredentials
165
+ */
166
+ createSnsCredentials = (request = {}) => this.client.fetch({
167
+ body: JSON.stringify(marshalSnsApiCreateSnsCredentialsRequest(request, this.client.settings)),
168
+ headers: jsonContentHeaders,
169
+ method: "POST",
170
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`
171
+ }, unmarshalSnsCredentials);
172
+ /**
173
+ * Delete Topics and Events credentials. Delete a set of Topics and Events credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Topics and Events.
174
+ *
175
+ * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}
176
+ */
177
+ deleteSnsCredentials = (request) => this.client.fetch({
178
+ method: "DELETE",
179
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
180
+ });
181
+ /**
182
+ * Update Topics and Events credentials. Update a set of Topics and Events credentials. You can update the credentials' name, or their permissions.
183
+ *
184
+ * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest}
185
+ * @returns A Promise of SnsCredentials
186
+ */
187
+ updateSnsCredentials = (request) => this.client.fetch({
188
+ body: JSON.stringify(marshalSnsApiUpdateSnsCredentialsRequest(request, this.client.settings)),
189
+ headers: jsonContentHeaders,
190
+ method: "PATCH",
191
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
192
+ }, unmarshalSnsCredentials);
193
+ /**
194
+ * Get Topics and Events credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
195
+ *
196
+ * @param request - The request {@link SnsApiGetSnsCredentialsRequest}
197
+ * @returns A Promise of SnsCredentials
198
+ */
199
+ getSnsCredentials = (request) => this.client.fetch({
200
+ method: "GET",
201
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
202
+ }, unmarshalSnsCredentials);
203
+ pageOfListSnsCredentials = (request = {}) => this.client.fetch({
204
+ method: "GET",
205
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`,
206
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
207
+ }, unmarshalListSnsCredentialsResponse);
208
+ /**
209
+ * List Topics and Events credentials. List existing Topics and Events credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
210
+ *
211
+ * @param request - The request {@link SnsApiListSnsCredentialsRequest}
212
+ * @returns A Promise of ListSnsCredentialsResponse
213
+ */
214
+ listSnsCredentials = (request = {}) => enrichForPagination("snsCredentials", this.pageOfListSnsCredentials, request);
466
215
  };
216
+ /**
217
+ * Queues API.
218
+
219
+ This API allows you to manage your Scaleway Queues.
220
+ */
221
+ var SqsAPI = class extends API {
222
+ /**
223
+ * Locality of this API.
224
+ * type ∈ {'zone','region','global','unspecified'}
225
+ */
226
+ static LOCALITY = toApiLocality({ regions: ["fr-par", "nl-ams"] });
227
+ /**
228
+ * Activate Queues. Activate Queues for the specified Project ID. Queues must be activated before any usage such as creating credentials and queues. Activating Queues does not trigger any billing, and you can deactivate at any time.
229
+ *
230
+ * @param request - The request {@link SqsApiActivateSqsRequest}
231
+ * @returns A Promise of SqsInfo
232
+ */
233
+ activateSqs = (request = {}) => this.client.fetch({
234
+ body: JSON.stringify(marshalSqsApiActivateSqsRequest(request, this.client.settings)),
235
+ headers: jsonContentHeaders,
236
+ method: "POST",
237
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sqs`
238
+ }, unmarshalSqsInfo);
239
+ /**
240
+ * Get Queues info. Retrieve the Queues information of the specified Project ID. information include the activation status and the Queues API endpoint URL.
241
+ *
242
+ * @param request - The request {@link SqsApiGetSqsInfoRequest}
243
+ * @returns A Promise of SqsInfo
244
+ */
245
+ getSqsInfo = (request = {}) => this.client.fetch({
246
+ method: "GET",
247
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-info`,
248
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
249
+ }, unmarshalSqsInfo);
250
+ /**
251
+ * Deactivate Queues. Deactivate Queues for the specified Project ID. You must delete all queues and credentials before this call or you need to set the force_delete parameter.
252
+ *
253
+ * @param request - The request {@link SqsApiDeactivateSqsRequest}
254
+ * @returns A Promise of SqsInfo
255
+ */
256
+ deactivateSqs = (request = {}) => this.client.fetch({
257
+ body: JSON.stringify(marshalSqsApiDeactivateSqsRequest(request, this.client.settings)),
258
+ headers: jsonContentHeaders,
259
+ method: "POST",
260
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs`
261
+ }, unmarshalSqsInfo);
262
+ /**
263
+ * Create Queues credentials. Create a set of credentials for Queues, specified by a Project ID. Credentials give the bearer access to queues, and the level of permissions can be defined granularly.
264
+ *
265
+ * @param request - The request {@link SqsApiCreateSqsCredentialsRequest}
266
+ * @returns A Promise of SqsCredentials
267
+ */
268
+ createSqsCredentials = (request = {}) => this.client.fetch({
269
+ body: JSON.stringify(marshalSqsApiCreateSqsCredentialsRequest(request, this.client.settings)),
270
+ headers: jsonContentHeaders,
271
+ method: "POST",
272
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`
273
+ }, unmarshalSqsCredentials);
274
+ /**
275
+ * Delete Queues credentials. Delete a set of Queues credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Queues.
276
+ *
277
+ * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}
278
+ */
279
+ deleteSqsCredentials = (request) => this.client.fetch({
280
+ method: "DELETE",
281
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
282
+ });
283
+ /**
284
+ * Update Queues credentials. Update a set of Queues credentials. You can update the credentials' name, or their permissions.
285
+ *
286
+ * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest}
287
+ * @returns A Promise of SqsCredentials
288
+ */
289
+ updateSqsCredentials = (request) => this.client.fetch({
290
+ body: JSON.stringify(marshalSqsApiUpdateSqsCredentialsRequest(request, this.client.settings)),
291
+ headers: jsonContentHeaders,
292
+ method: "PATCH",
293
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
294
+ }, unmarshalSqsCredentials);
295
+ /**
296
+ * Get Queues credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
297
+ *
298
+ * @param request - The request {@link SqsApiGetSqsCredentialsRequest}
299
+ * @returns A Promise of SqsCredentials
300
+ */
301
+ getSqsCredentials = (request) => this.client.fetch({
302
+ method: "GET",
303
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
304
+ }, unmarshalSqsCredentials);
305
+ pageOfListSqsCredentials = (request = {}) => this.client.fetch({
306
+ method: "GET",
307
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`,
308
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
309
+ }, unmarshalListSqsCredentialsResponse);
310
+ /**
311
+ * List Queues credentials. List existing Queues credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
312
+ *
313
+ * @param request - The request {@link SqsApiListSqsCredentialsRequest}
314
+ * @returns A Promise of ListSqsCredentialsResponse
315
+ */
316
+ listSqsCredentials = (request = {}) => enrichForPagination("sqsCredentials", this.pageOfListSqsCredentials, request);
317
+ };
318
+ export { NatsAPI, SnsAPI, SqsAPI };