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