@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.
- package/LICENSE +191 -0
- package/dist/index.gen.cjs +4 -0
- package/dist/index.gen.d.ts +5 -0
- package/dist/index.gen.js +4 -0
- package/dist/v1beta1/api.gen.cjs +451 -0
- package/dist/v1beta1/api.gen.d.ts +217 -0
- package/dist/v1beta1/api.gen.js +451 -0
- package/dist/v1beta1/index.gen.cjs +30 -0
- package/dist/v1beta1/index.gen.d.ts +4 -0
- package/dist/v1beta1/index.gen.js +30 -0
- package/dist/v1beta1/marshalling.gen.cjs +267 -0
- package/dist/v1beta1/marshalling.gen.d.ts +23 -0
- package/dist/v1beta1/marshalling.gen.js +267 -0
- package/dist/v1beta1/types.gen.d.ts +627 -0
- package/dist/v1beta1/validation-rules.gen.cjs +85 -0
- package/dist/v1beta1/validation-rules.gen.d.ts +72 -0
- package/dist/v1beta1/validation-rules.gen.js +85 -0
- package/package.json +51 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api_gen = require("./api.gen.cjs");
|
|
4
|
+
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
5
|
+
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
6
|
+
exports.NatsAPI = api_gen.NatsAPI;
|
|
7
|
+
exports.SnsAPI = api_gen.SnsAPI;
|
|
8
|
+
exports.SqsAPI = api_gen.SqsAPI;
|
|
9
|
+
exports.marshalNatsApiCreateNatsAccountRequest = marshalling_gen.marshalNatsApiCreateNatsAccountRequest;
|
|
10
|
+
exports.marshalNatsApiCreateNatsCredentialsRequest = marshalling_gen.marshalNatsApiCreateNatsCredentialsRequest;
|
|
11
|
+
exports.marshalNatsApiUpdateNatsAccountRequest = marshalling_gen.marshalNatsApiUpdateNatsAccountRequest;
|
|
12
|
+
exports.marshalSnsApiActivateSnsRequest = marshalling_gen.marshalSnsApiActivateSnsRequest;
|
|
13
|
+
exports.marshalSnsApiCreateSnsCredentialsRequest = marshalling_gen.marshalSnsApiCreateSnsCredentialsRequest;
|
|
14
|
+
exports.marshalSnsApiDeactivateSnsRequest = marshalling_gen.marshalSnsApiDeactivateSnsRequest;
|
|
15
|
+
exports.marshalSnsApiUpdateSnsCredentialsRequest = marshalling_gen.marshalSnsApiUpdateSnsCredentialsRequest;
|
|
16
|
+
exports.marshalSqsApiActivateSqsRequest = marshalling_gen.marshalSqsApiActivateSqsRequest;
|
|
17
|
+
exports.marshalSqsApiCreateSqsCredentialsRequest = marshalling_gen.marshalSqsApiCreateSqsCredentialsRequest;
|
|
18
|
+
exports.marshalSqsApiDeactivateSqsRequest = marshalling_gen.marshalSqsApiDeactivateSqsRequest;
|
|
19
|
+
exports.marshalSqsApiUpdateSqsCredentialsRequest = marshalling_gen.marshalSqsApiUpdateSqsCredentialsRequest;
|
|
20
|
+
exports.unmarshalListNatsAccountsResponse = marshalling_gen.unmarshalListNatsAccountsResponse;
|
|
21
|
+
exports.unmarshalListNatsCredentialsResponse = marshalling_gen.unmarshalListNatsCredentialsResponse;
|
|
22
|
+
exports.unmarshalListSnsCredentialsResponse = marshalling_gen.unmarshalListSnsCredentialsResponse;
|
|
23
|
+
exports.unmarshalListSqsCredentialsResponse = marshalling_gen.unmarshalListSqsCredentialsResponse;
|
|
24
|
+
exports.unmarshalNatsAccount = marshalling_gen.unmarshalNatsAccount;
|
|
25
|
+
exports.unmarshalNatsCredentials = marshalling_gen.unmarshalNatsCredentials;
|
|
26
|
+
exports.unmarshalSnsCredentials = marshalling_gen.unmarshalSnsCredentials;
|
|
27
|
+
exports.unmarshalSnsInfo = marshalling_gen.unmarshalSnsInfo;
|
|
28
|
+
exports.unmarshalSqsCredentials = marshalling_gen.unmarshalSqsCredentials;
|
|
29
|
+
exports.unmarshalSqsInfo = marshalling_gen.unmarshalSqsInfo;
|
|
30
|
+
exports.ValidationRules = validationRules_gen;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { NatsAPI, SnsAPI, SqsAPI, } from './api.gen';
|
|
2
|
+
export * from './marshalling.gen';
|
|
3
|
+
export type { File, ListNatsAccountsRequestOrderBy, ListNatsAccountsResponse, ListNatsCredentialsRequestOrderBy, ListNatsCredentialsResponse, ListSnsCredentialsRequestOrderBy, ListSnsCredentialsResponse, ListSqsCredentialsRequestOrderBy, ListSqsCredentialsResponse, NatsAccount, NatsApiCreateNatsAccountRequest, NatsApiCreateNatsCredentialsRequest, NatsApiDeleteNatsAccountRequest, NatsApiDeleteNatsCredentialsRequest, NatsApiGetNatsAccountRequest, NatsApiGetNatsCredentialsRequest, NatsApiListNatsAccountsRequest, NatsApiListNatsCredentialsRequest, NatsApiUpdateNatsAccountRequest, NatsCredentials, SnsApiActivateSnsRequest, SnsApiCreateSnsCredentialsRequest, SnsApiDeactivateSnsRequest, SnsApiDeleteSnsCredentialsRequest, SnsApiGetSnsCredentialsRequest, SnsApiGetSnsInfoRequest, SnsApiListSnsCredentialsRequest, SnsApiUpdateSnsCredentialsRequest, SnsCredentials, SnsInfo, SnsInfoStatus, SnsPermissions, SqsApiActivateSqsRequest, SqsApiCreateSqsCredentialsRequest, SqsApiDeactivateSqsRequest, SqsApiDeleteSqsCredentialsRequest, SqsApiGetSqsCredentialsRequest, SqsApiGetSqsInfoRequest, SqsApiListSqsCredentialsRequest, SqsApiUpdateSqsCredentialsRequest, SqsCredentials, SqsInfo, SqsInfoStatus, SqsPermissions, } from './types.gen';
|
|
4
|
+
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NatsAPI, SnsAPI, SqsAPI } from "./api.gen.js";
|
|
2
|
+
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";
|
|
3
|
+
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
|
+
export {
|
|
5
|
+
NatsAPI,
|
|
6
|
+
SnsAPI,
|
|
7
|
+
SqsAPI,
|
|
8
|
+
validationRules_gen as ValidationRules,
|
|
9
|
+
marshalNatsApiCreateNatsAccountRequest,
|
|
10
|
+
marshalNatsApiCreateNatsCredentialsRequest,
|
|
11
|
+
marshalNatsApiUpdateNatsAccountRequest,
|
|
12
|
+
marshalSnsApiActivateSnsRequest,
|
|
13
|
+
marshalSnsApiCreateSnsCredentialsRequest,
|
|
14
|
+
marshalSnsApiDeactivateSnsRequest,
|
|
15
|
+
marshalSnsApiUpdateSnsCredentialsRequest,
|
|
16
|
+
marshalSqsApiActivateSqsRequest,
|
|
17
|
+
marshalSqsApiCreateSqsCredentialsRequest,
|
|
18
|
+
marshalSqsApiDeactivateSqsRequest,
|
|
19
|
+
marshalSqsApiUpdateSqsCredentialsRequest,
|
|
20
|
+
unmarshalListNatsAccountsResponse,
|
|
21
|
+
unmarshalListNatsCredentialsResponse,
|
|
22
|
+
unmarshalListSnsCredentialsResponse,
|
|
23
|
+
unmarshalListSqsCredentialsResponse,
|
|
24
|
+
unmarshalNatsAccount,
|
|
25
|
+
unmarshalNatsCredentials,
|
|
26
|
+
unmarshalSnsCredentials,
|
|
27
|
+
unmarshalSnsInfo,
|
|
28
|
+
unmarshalSqsCredentials,
|
|
29
|
+
unmarshalSqsInfo
|
|
30
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const randomName = require("@scaleway/random-name");
|
|
4
|
+
const sdkClient = require("@scaleway/sdk-client");
|
|
5
|
+
const unmarshalNatsAccount = (data) => {
|
|
6
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
13
|
+
endpoint: data.endpoint,
|
|
14
|
+
id: data.id,
|
|
15
|
+
name: data.name,
|
|
16
|
+
projectId: data.project_id,
|
|
17
|
+
region: data.region,
|
|
18
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const unmarshalFile = (data) => {
|
|
22
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
23
|
+
throw new TypeError(
|
|
24
|
+
`Unmarshalling the type 'File' failed as data isn't a dictionary.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
content: data.content,
|
|
29
|
+
name: data.name
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const unmarshalNatsCredentials = (data) => {
|
|
33
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
34
|
+
throw new TypeError(
|
|
35
|
+
`Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
checksum: data.checksum,
|
|
40
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
41
|
+
credentials: data.credentials ? unmarshalFile(data.credentials) : void 0,
|
|
42
|
+
id: data.id,
|
|
43
|
+
name: data.name,
|
|
44
|
+
natsAccountId: data.nats_account_id,
|
|
45
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const unmarshalSnsPermissions = (data) => {
|
|
49
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
50
|
+
throw new TypeError(
|
|
51
|
+
`Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
canManage: data.can_manage,
|
|
56
|
+
canPublish: data.can_publish,
|
|
57
|
+
canReceive: data.can_receive
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const unmarshalSnsCredentials = (data) => {
|
|
61
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
62
|
+
throw new TypeError(
|
|
63
|
+
`Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
accessKey: data.access_key,
|
|
68
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
69
|
+
id: data.id,
|
|
70
|
+
name: data.name,
|
|
71
|
+
permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : void 0,
|
|
72
|
+
projectId: data.project_id,
|
|
73
|
+
region: data.region,
|
|
74
|
+
secretChecksum: data.secret_checksum,
|
|
75
|
+
secretKey: data.secret_key,
|
|
76
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const unmarshalSqsPermissions = (data) => {
|
|
80
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
81
|
+
throw new TypeError(
|
|
82
|
+
`Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
canManage: data.can_manage,
|
|
87
|
+
canPublish: data.can_publish,
|
|
88
|
+
canReceive: data.can_receive
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
const unmarshalSqsCredentials = (data) => {
|
|
92
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
93
|
+
throw new TypeError(
|
|
94
|
+
`Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
accessKey: data.access_key,
|
|
99
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
100
|
+
id: data.id,
|
|
101
|
+
name: data.name,
|
|
102
|
+
permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : void 0,
|
|
103
|
+
projectId: data.project_id,
|
|
104
|
+
region: data.region,
|
|
105
|
+
secretChecksum: data.secret_checksum,
|
|
106
|
+
secretKey: data.secret_key,
|
|
107
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const unmarshalListNatsAccountsResponse = (data) => {
|
|
111
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
112
|
+
throw new TypeError(
|
|
113
|
+
`Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
natsAccounts: sdkClient.unmarshalArrayOfObject(
|
|
118
|
+
data.nats_accounts,
|
|
119
|
+
unmarshalNatsAccount
|
|
120
|
+
),
|
|
121
|
+
totalCount: data.total_count
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
const unmarshalListNatsCredentialsResponse = (data) => {
|
|
125
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
126
|
+
throw new TypeError(
|
|
127
|
+
`Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
natsCredentials: sdkClient.unmarshalArrayOfObject(
|
|
132
|
+
data.nats_credentials,
|
|
133
|
+
unmarshalNatsCredentials
|
|
134
|
+
),
|
|
135
|
+
totalCount: data.total_count
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const unmarshalListSnsCredentialsResponse = (data) => {
|
|
139
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
140
|
+
throw new TypeError(
|
|
141
|
+
`Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
snsCredentials: sdkClient.unmarshalArrayOfObject(
|
|
146
|
+
data.sns_credentials,
|
|
147
|
+
unmarshalSnsCredentials
|
|
148
|
+
),
|
|
149
|
+
totalCount: data.total_count
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const unmarshalListSqsCredentialsResponse = (data) => {
|
|
153
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
154
|
+
throw new TypeError(
|
|
155
|
+
`Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
sqsCredentials: sdkClient.unmarshalArrayOfObject(
|
|
160
|
+
data.sqs_credentials,
|
|
161
|
+
unmarshalSqsCredentials
|
|
162
|
+
),
|
|
163
|
+
totalCount: data.total_count
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const unmarshalSnsInfo = (data) => {
|
|
167
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
168
|
+
throw new TypeError(
|
|
169
|
+
`Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
174
|
+
projectId: data.project_id,
|
|
175
|
+
region: data.region,
|
|
176
|
+
snsEndpointUrl: data.sns_endpoint_url,
|
|
177
|
+
status: data.status,
|
|
178
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const unmarshalSqsInfo = (data) => {
|
|
182
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
183
|
+
throw new TypeError(
|
|
184
|
+
`Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
189
|
+
projectId: data.project_id,
|
|
190
|
+
region: data.region,
|
|
191
|
+
sqsEndpointUrl: data.sqs_endpoint_url,
|
|
192
|
+
status: data.status,
|
|
193
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({
|
|
197
|
+
name: request.name || randomName("mnq"),
|
|
198
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
199
|
+
});
|
|
200
|
+
const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({
|
|
201
|
+
name: request.name || randomName("mnq"),
|
|
202
|
+
nats_account_id: request.natsAccountId
|
|
203
|
+
});
|
|
204
|
+
const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({
|
|
205
|
+
name: request.name
|
|
206
|
+
});
|
|
207
|
+
const marshalSnsApiActivateSnsRequest = (request, defaults) => ({
|
|
208
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
209
|
+
});
|
|
210
|
+
const marshalSnsPermissions = (request, defaults) => ({
|
|
211
|
+
can_manage: request.canManage,
|
|
212
|
+
can_publish: request.canPublish,
|
|
213
|
+
can_receive: request.canReceive
|
|
214
|
+
});
|
|
215
|
+
const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({
|
|
216
|
+
name: request.name || randomName("mnq_sns"),
|
|
217
|
+
permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0,
|
|
218
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
219
|
+
});
|
|
220
|
+
const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({
|
|
221
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
222
|
+
});
|
|
223
|
+
const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({
|
|
224
|
+
name: request.name,
|
|
225
|
+
permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0
|
|
226
|
+
});
|
|
227
|
+
const marshalSqsApiActivateSqsRequest = (request, defaults) => ({
|
|
228
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
229
|
+
});
|
|
230
|
+
const marshalSqsPermissions = (request, defaults) => ({
|
|
231
|
+
can_manage: request.canManage,
|
|
232
|
+
can_publish: request.canPublish,
|
|
233
|
+
can_receive: request.canReceive
|
|
234
|
+
});
|
|
235
|
+
const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({
|
|
236
|
+
name: request.name || randomName("mnq_sqs"),
|
|
237
|
+
permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0,
|
|
238
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
239
|
+
});
|
|
240
|
+
const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({
|
|
241
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
242
|
+
});
|
|
243
|
+
const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({
|
|
244
|
+
name: request.name,
|
|
245
|
+
permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0
|
|
246
|
+
});
|
|
247
|
+
exports.marshalNatsApiCreateNatsAccountRequest = marshalNatsApiCreateNatsAccountRequest;
|
|
248
|
+
exports.marshalNatsApiCreateNatsCredentialsRequest = marshalNatsApiCreateNatsCredentialsRequest;
|
|
249
|
+
exports.marshalNatsApiUpdateNatsAccountRequest = marshalNatsApiUpdateNatsAccountRequest;
|
|
250
|
+
exports.marshalSnsApiActivateSnsRequest = marshalSnsApiActivateSnsRequest;
|
|
251
|
+
exports.marshalSnsApiCreateSnsCredentialsRequest = marshalSnsApiCreateSnsCredentialsRequest;
|
|
252
|
+
exports.marshalSnsApiDeactivateSnsRequest = marshalSnsApiDeactivateSnsRequest;
|
|
253
|
+
exports.marshalSnsApiUpdateSnsCredentialsRequest = marshalSnsApiUpdateSnsCredentialsRequest;
|
|
254
|
+
exports.marshalSqsApiActivateSqsRequest = marshalSqsApiActivateSqsRequest;
|
|
255
|
+
exports.marshalSqsApiCreateSqsCredentialsRequest = marshalSqsApiCreateSqsCredentialsRequest;
|
|
256
|
+
exports.marshalSqsApiDeactivateSqsRequest = marshalSqsApiDeactivateSqsRequest;
|
|
257
|
+
exports.marshalSqsApiUpdateSqsCredentialsRequest = marshalSqsApiUpdateSqsCredentialsRequest;
|
|
258
|
+
exports.unmarshalListNatsAccountsResponse = unmarshalListNatsAccountsResponse;
|
|
259
|
+
exports.unmarshalListNatsCredentialsResponse = unmarshalListNatsCredentialsResponse;
|
|
260
|
+
exports.unmarshalListSnsCredentialsResponse = unmarshalListSnsCredentialsResponse;
|
|
261
|
+
exports.unmarshalListSqsCredentialsResponse = unmarshalListSqsCredentialsResponse;
|
|
262
|
+
exports.unmarshalNatsAccount = unmarshalNatsAccount;
|
|
263
|
+
exports.unmarshalNatsCredentials = unmarshalNatsCredentials;
|
|
264
|
+
exports.unmarshalSnsCredentials = unmarshalSnsCredentials;
|
|
265
|
+
exports.unmarshalSnsInfo = unmarshalSnsInfo;
|
|
266
|
+
exports.unmarshalSqsCredentials = unmarshalSqsCredentials;
|
|
267
|
+
exports.unmarshalSqsInfo = unmarshalSqsInfo;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { ListNatsAccountsResponse, ListNatsCredentialsResponse, ListSnsCredentialsResponse, ListSqsCredentialsResponse, NatsAccount, NatsApiCreateNatsAccountRequest, NatsApiCreateNatsCredentialsRequest, NatsApiUpdateNatsAccountRequest, NatsCredentials, SnsApiActivateSnsRequest, SnsApiCreateSnsCredentialsRequest, SnsApiDeactivateSnsRequest, SnsApiUpdateSnsCredentialsRequest, SnsCredentials, SnsInfo, SqsApiActivateSqsRequest, SqsApiCreateSqsCredentialsRequest, SqsApiDeactivateSqsRequest, SqsApiUpdateSqsCredentialsRequest, SqsCredentials, SqsInfo } from './types.gen';
|
|
3
|
+
export declare const unmarshalNatsAccount: (data: unknown) => NatsAccount;
|
|
4
|
+
export declare const unmarshalNatsCredentials: (data: unknown) => NatsCredentials;
|
|
5
|
+
export declare const unmarshalSnsCredentials: (data: unknown) => SnsCredentials;
|
|
6
|
+
export declare const unmarshalSqsCredentials: (data: unknown) => SqsCredentials;
|
|
7
|
+
export declare const unmarshalListNatsAccountsResponse: (data: unknown) => ListNatsAccountsResponse;
|
|
8
|
+
export declare const unmarshalListNatsCredentialsResponse: (data: unknown) => ListNatsCredentialsResponse;
|
|
9
|
+
export declare const unmarshalListSnsCredentialsResponse: (data: unknown) => ListSnsCredentialsResponse;
|
|
10
|
+
export declare const unmarshalListSqsCredentialsResponse: (data: unknown) => ListSqsCredentialsResponse;
|
|
11
|
+
export declare const unmarshalSnsInfo: (data: unknown) => SnsInfo;
|
|
12
|
+
export declare const unmarshalSqsInfo: (data: unknown) => SqsInfo;
|
|
13
|
+
export declare const marshalNatsApiCreateNatsAccountRequest: (request: NatsApiCreateNatsAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalNatsApiCreateNatsCredentialsRequest: (request: NatsApiCreateNatsCredentialsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalNatsApiUpdateNatsAccountRequest: (request: NatsApiUpdateNatsAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalSnsApiActivateSnsRequest: (request: SnsApiActivateSnsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
|
+
export declare const marshalSnsApiCreateSnsCredentialsRequest: (request: SnsApiCreateSnsCredentialsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalSnsApiDeactivateSnsRequest: (request: SnsApiDeactivateSnsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
19
|
+
export declare const marshalSnsApiUpdateSnsCredentialsRequest: (request: SnsApiUpdateSnsCredentialsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
20
|
+
export declare const marshalSqsApiActivateSqsRequest: (request: SqsApiActivateSqsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
21
|
+
export declare const marshalSqsApiCreateSqsCredentialsRequest: (request: SqsApiCreateSqsCredentialsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
|
+
export declare const marshalSqsApiDeactivateSqsRequest: (request: SqsApiDeactivateSqsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
23
|
+
export declare const marshalSqsApiUpdateSqsCredentialsRequest: (request: SqsApiUpdateSqsCredentialsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import randomName from "@scaleway/random-name";
|
|
2
|
+
import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
|
|
3
|
+
const unmarshalNatsAccount = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) {
|
|
5
|
+
throw new TypeError(
|
|
6
|
+
`Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
createdAt: unmarshalDate(data.created_at),
|
|
11
|
+
endpoint: data.endpoint,
|
|
12
|
+
id: data.id,
|
|
13
|
+
name: data.name,
|
|
14
|
+
projectId: data.project_id,
|
|
15
|
+
region: data.region,
|
|
16
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const unmarshalFile = (data) => {
|
|
20
|
+
if (!isJSONObject(data)) {
|
|
21
|
+
throw new TypeError(
|
|
22
|
+
`Unmarshalling the type 'File' failed as data isn't a dictionary.`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
content: data.content,
|
|
27
|
+
name: data.name
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const unmarshalNatsCredentials = (data) => {
|
|
31
|
+
if (!isJSONObject(data)) {
|
|
32
|
+
throw new TypeError(
|
|
33
|
+
`Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
checksum: data.checksum,
|
|
38
|
+
createdAt: unmarshalDate(data.created_at),
|
|
39
|
+
credentials: data.credentials ? unmarshalFile(data.credentials) : void 0,
|
|
40
|
+
id: data.id,
|
|
41
|
+
name: data.name,
|
|
42
|
+
natsAccountId: data.nats_account_id,
|
|
43
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const unmarshalSnsPermissions = (data) => {
|
|
47
|
+
if (!isJSONObject(data)) {
|
|
48
|
+
throw new TypeError(
|
|
49
|
+
`Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
canManage: data.can_manage,
|
|
54
|
+
canPublish: data.can_publish,
|
|
55
|
+
canReceive: data.can_receive
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const unmarshalSnsCredentials = (data) => {
|
|
59
|
+
if (!isJSONObject(data)) {
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
`Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
accessKey: data.access_key,
|
|
66
|
+
createdAt: unmarshalDate(data.created_at),
|
|
67
|
+
id: data.id,
|
|
68
|
+
name: data.name,
|
|
69
|
+
permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : void 0,
|
|
70
|
+
projectId: data.project_id,
|
|
71
|
+
region: data.region,
|
|
72
|
+
secretChecksum: data.secret_checksum,
|
|
73
|
+
secretKey: data.secret_key,
|
|
74
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const unmarshalSqsPermissions = (data) => {
|
|
78
|
+
if (!isJSONObject(data)) {
|
|
79
|
+
throw new TypeError(
|
|
80
|
+
`Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
canManage: data.can_manage,
|
|
85
|
+
canPublish: data.can_publish,
|
|
86
|
+
canReceive: data.can_receive
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const unmarshalSqsCredentials = (data) => {
|
|
90
|
+
if (!isJSONObject(data)) {
|
|
91
|
+
throw new TypeError(
|
|
92
|
+
`Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
accessKey: data.access_key,
|
|
97
|
+
createdAt: unmarshalDate(data.created_at),
|
|
98
|
+
id: data.id,
|
|
99
|
+
name: data.name,
|
|
100
|
+
permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : void 0,
|
|
101
|
+
projectId: data.project_id,
|
|
102
|
+
region: data.region,
|
|
103
|
+
secretChecksum: data.secret_checksum,
|
|
104
|
+
secretKey: data.secret_key,
|
|
105
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
const unmarshalListNatsAccountsResponse = (data) => {
|
|
109
|
+
if (!isJSONObject(data)) {
|
|
110
|
+
throw new TypeError(
|
|
111
|
+
`Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
natsAccounts: unmarshalArrayOfObject(
|
|
116
|
+
data.nats_accounts,
|
|
117
|
+
unmarshalNatsAccount
|
|
118
|
+
),
|
|
119
|
+
totalCount: data.total_count
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const unmarshalListNatsCredentialsResponse = (data) => {
|
|
123
|
+
if (!isJSONObject(data)) {
|
|
124
|
+
throw new TypeError(
|
|
125
|
+
`Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
natsCredentials: unmarshalArrayOfObject(
|
|
130
|
+
data.nats_credentials,
|
|
131
|
+
unmarshalNatsCredentials
|
|
132
|
+
),
|
|
133
|
+
totalCount: data.total_count
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
const unmarshalListSnsCredentialsResponse = (data) => {
|
|
137
|
+
if (!isJSONObject(data)) {
|
|
138
|
+
throw new TypeError(
|
|
139
|
+
`Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
snsCredentials: unmarshalArrayOfObject(
|
|
144
|
+
data.sns_credentials,
|
|
145
|
+
unmarshalSnsCredentials
|
|
146
|
+
),
|
|
147
|
+
totalCount: data.total_count
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const unmarshalListSqsCredentialsResponse = (data) => {
|
|
151
|
+
if (!isJSONObject(data)) {
|
|
152
|
+
throw new TypeError(
|
|
153
|
+
`Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
sqsCredentials: unmarshalArrayOfObject(
|
|
158
|
+
data.sqs_credentials,
|
|
159
|
+
unmarshalSqsCredentials
|
|
160
|
+
),
|
|
161
|
+
totalCount: data.total_count
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
const unmarshalSnsInfo = (data) => {
|
|
165
|
+
if (!isJSONObject(data)) {
|
|
166
|
+
throw new TypeError(
|
|
167
|
+
`Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
createdAt: unmarshalDate(data.created_at),
|
|
172
|
+
projectId: data.project_id,
|
|
173
|
+
region: data.region,
|
|
174
|
+
snsEndpointUrl: data.sns_endpoint_url,
|
|
175
|
+
status: data.status,
|
|
176
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
const unmarshalSqsInfo = (data) => {
|
|
180
|
+
if (!isJSONObject(data)) {
|
|
181
|
+
throw new TypeError(
|
|
182
|
+
`Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
createdAt: unmarshalDate(data.created_at),
|
|
187
|
+
projectId: data.project_id,
|
|
188
|
+
region: data.region,
|
|
189
|
+
sqsEndpointUrl: data.sqs_endpoint_url,
|
|
190
|
+
status: data.status,
|
|
191
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({
|
|
195
|
+
name: request.name || randomName("mnq"),
|
|
196
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
197
|
+
});
|
|
198
|
+
const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({
|
|
199
|
+
name: request.name || randomName("mnq"),
|
|
200
|
+
nats_account_id: request.natsAccountId
|
|
201
|
+
});
|
|
202
|
+
const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({
|
|
203
|
+
name: request.name
|
|
204
|
+
});
|
|
205
|
+
const marshalSnsApiActivateSnsRequest = (request, defaults) => ({
|
|
206
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
207
|
+
});
|
|
208
|
+
const marshalSnsPermissions = (request, defaults) => ({
|
|
209
|
+
can_manage: request.canManage,
|
|
210
|
+
can_publish: request.canPublish,
|
|
211
|
+
can_receive: request.canReceive
|
|
212
|
+
});
|
|
213
|
+
const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({
|
|
214
|
+
name: request.name || randomName("mnq_sns"),
|
|
215
|
+
permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0,
|
|
216
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
217
|
+
});
|
|
218
|
+
const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({
|
|
219
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
220
|
+
});
|
|
221
|
+
const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({
|
|
222
|
+
name: request.name,
|
|
223
|
+
permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0
|
|
224
|
+
});
|
|
225
|
+
const marshalSqsApiActivateSqsRequest = (request, defaults) => ({
|
|
226
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
227
|
+
});
|
|
228
|
+
const marshalSqsPermissions = (request, defaults) => ({
|
|
229
|
+
can_manage: request.canManage,
|
|
230
|
+
can_publish: request.canPublish,
|
|
231
|
+
can_receive: request.canReceive
|
|
232
|
+
});
|
|
233
|
+
const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({
|
|
234
|
+
name: request.name || randomName("mnq_sqs"),
|
|
235
|
+
permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0,
|
|
236
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
237
|
+
});
|
|
238
|
+
const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({
|
|
239
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
240
|
+
});
|
|
241
|
+
const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({
|
|
242
|
+
name: request.name,
|
|
243
|
+
permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0
|
|
244
|
+
});
|
|
245
|
+
export {
|
|
246
|
+
marshalNatsApiCreateNatsAccountRequest,
|
|
247
|
+
marshalNatsApiCreateNatsCredentialsRequest,
|
|
248
|
+
marshalNatsApiUpdateNatsAccountRequest,
|
|
249
|
+
marshalSnsApiActivateSnsRequest,
|
|
250
|
+
marshalSnsApiCreateSnsCredentialsRequest,
|
|
251
|
+
marshalSnsApiDeactivateSnsRequest,
|
|
252
|
+
marshalSnsApiUpdateSnsCredentialsRequest,
|
|
253
|
+
marshalSqsApiActivateSqsRequest,
|
|
254
|
+
marshalSqsApiCreateSqsCredentialsRequest,
|
|
255
|
+
marshalSqsApiDeactivateSqsRequest,
|
|
256
|
+
marshalSqsApiUpdateSqsCredentialsRequest,
|
|
257
|
+
unmarshalListNatsAccountsResponse,
|
|
258
|
+
unmarshalListNatsCredentialsResponse,
|
|
259
|
+
unmarshalListSnsCredentialsResponse,
|
|
260
|
+
unmarshalListSqsCredentialsResponse,
|
|
261
|
+
unmarshalNatsAccount,
|
|
262
|
+
unmarshalNatsCredentials,
|
|
263
|
+
unmarshalSnsCredentials,
|
|
264
|
+
unmarshalSnsInfo,
|
|
265
|
+
unmarshalSqsCredentials,
|
|
266
|
+
unmarshalSqsInfo
|
|
267
|
+
};
|