@scaleway/sdk-container 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +602 -0
- package/dist/v1beta1/api.gen.d.ts +287 -0
- package/dist/v1beta1/api.gen.js +602 -0
- package/dist/v1beta1/content.gen.cjs +34 -0
- package/dist/v1beta1/content.gen.d.ts +13 -0
- package/dist/v1beta1/content.gen.js +34 -0
- package/dist/v1beta1/index.gen.cjs +36 -0
- package/dist/v1beta1/index.gen.d.ts +5 -0
- package/dist/v1beta1/index.gen.js +36 -0
- package/dist/v1beta1/marshalling.gen.cjs +501 -0
- package/dist/v1beta1/marshalling.gen.d.ts +24 -0
- package/dist/v1beta1/marshalling.gen.js +501 -0
- package/dist/v1beta1/types.gen.d.ts +1224 -0
- package/dist/v1beta1/validation-rules.gen.cjs +61 -0
- package/dist/v1beta1/validation-rules.gen.d.ts +52 -0
- package/dist/v1beta1/validation-rules.gen.js +61 -0
- package/package.json +51 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api_gen = require("./api.gen.cjs");
|
|
4
|
+
const content_gen = require("./content.gen.cjs");
|
|
5
|
+
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
+
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
7
|
+
exports.API = api_gen.API;
|
|
8
|
+
exports.CONTAINER_TRANSIENT_STATUSES = content_gen.CONTAINER_TRANSIENT_STATUSES;
|
|
9
|
+
exports.CRON_TRANSIENT_STATUSES = content_gen.CRON_TRANSIENT_STATUSES;
|
|
10
|
+
exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;
|
|
11
|
+
exports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES;
|
|
12
|
+
exports.TOKEN_TRANSIENT_STATUSES = content_gen.TOKEN_TRANSIENT_STATUSES;
|
|
13
|
+
exports.TRIGGER_TRANSIENT_STATUSES = content_gen.TRIGGER_TRANSIENT_STATUSES;
|
|
14
|
+
exports.marshalCreateContainerRequest = marshalling_gen.marshalCreateContainerRequest;
|
|
15
|
+
exports.marshalCreateCronRequest = marshalling_gen.marshalCreateCronRequest;
|
|
16
|
+
exports.marshalCreateDomainRequest = marshalling_gen.marshalCreateDomainRequest;
|
|
17
|
+
exports.marshalCreateNamespaceRequest = marshalling_gen.marshalCreateNamespaceRequest;
|
|
18
|
+
exports.marshalCreateTokenRequest = marshalling_gen.marshalCreateTokenRequest;
|
|
19
|
+
exports.marshalCreateTriggerRequest = marshalling_gen.marshalCreateTriggerRequest;
|
|
20
|
+
exports.marshalUpdateContainerRequest = marshalling_gen.marshalUpdateContainerRequest;
|
|
21
|
+
exports.marshalUpdateCronRequest = marshalling_gen.marshalUpdateCronRequest;
|
|
22
|
+
exports.marshalUpdateNamespaceRequest = marshalling_gen.marshalUpdateNamespaceRequest;
|
|
23
|
+
exports.marshalUpdateTriggerRequest = marshalling_gen.marshalUpdateTriggerRequest;
|
|
24
|
+
exports.unmarshalContainer = marshalling_gen.unmarshalContainer;
|
|
25
|
+
exports.unmarshalCron = marshalling_gen.unmarshalCron;
|
|
26
|
+
exports.unmarshalDomain = marshalling_gen.unmarshalDomain;
|
|
27
|
+
exports.unmarshalListContainersResponse = marshalling_gen.unmarshalListContainersResponse;
|
|
28
|
+
exports.unmarshalListCronsResponse = marshalling_gen.unmarshalListCronsResponse;
|
|
29
|
+
exports.unmarshalListDomainsResponse = marshalling_gen.unmarshalListDomainsResponse;
|
|
30
|
+
exports.unmarshalListNamespacesResponse = marshalling_gen.unmarshalListNamespacesResponse;
|
|
31
|
+
exports.unmarshalListTokensResponse = marshalling_gen.unmarshalListTokensResponse;
|
|
32
|
+
exports.unmarshalListTriggersResponse = marshalling_gen.unmarshalListTriggersResponse;
|
|
33
|
+
exports.unmarshalNamespace = marshalling_gen.unmarshalNamespace;
|
|
34
|
+
exports.unmarshalToken = marshalling_gen.unmarshalToken;
|
|
35
|
+
exports.unmarshalTrigger = marshalling_gen.unmarshalTrigger;
|
|
36
|
+
exports.ValidationRules = validationRules_gen;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { API } from './api.gen';
|
|
2
|
+
export * from './content.gen';
|
|
3
|
+
export * from './marshalling.gen';
|
|
4
|
+
export type { Container, ContainerHealthCheckSpec, ContainerHealthCheckSpecHTTPProbe, ContainerHealthCheckSpecTCPProbe, ContainerHttpOption, ContainerPrivacy, ContainerProtocol, ContainerSandbox, ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, CreateTriggerRequestSqsClientConfig, Cron, CronStatus, DeleteContainerRequest, DeleteCronRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployContainerRequest, Domain, DomainStatus, GetContainerRequest, GetCronRequest, GetDomainRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListContainersRequest, ListContainersRequestOrderBy, ListContainersResponse, ListCronsRequest, ListCronsRequestOrderBy, ListCronsResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTokensRequest, ListTokensRequestOrderBy, ListTokensResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, Secret, SecretHashedValue, Token, TokenStatus, Trigger, TriggerInputType, TriggerMnqNatsClientConfig, TriggerMnqSqsClientConfig, TriggerSqsClientConfig, TriggerStatus, UpdateContainerRequest, UpdateCronRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestSqsClientConfig, } from './types.gen';
|
|
5
|
+
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { API } from "./api.gen.js";
|
|
2
|
+
import { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger } from "./marshalling.gen.js";
|
|
4
|
+
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
5
|
+
export {
|
|
6
|
+
API,
|
|
7
|
+
CONTAINER_TRANSIENT_STATUSES,
|
|
8
|
+
CRON_TRANSIENT_STATUSES,
|
|
9
|
+
DOMAIN_TRANSIENT_STATUSES,
|
|
10
|
+
NAMESPACE_TRANSIENT_STATUSES,
|
|
11
|
+
TOKEN_TRANSIENT_STATUSES,
|
|
12
|
+
TRIGGER_TRANSIENT_STATUSES,
|
|
13
|
+
validationRules_gen as ValidationRules,
|
|
14
|
+
marshalCreateContainerRequest,
|
|
15
|
+
marshalCreateCronRequest,
|
|
16
|
+
marshalCreateDomainRequest,
|
|
17
|
+
marshalCreateNamespaceRequest,
|
|
18
|
+
marshalCreateTokenRequest,
|
|
19
|
+
marshalCreateTriggerRequest,
|
|
20
|
+
marshalUpdateContainerRequest,
|
|
21
|
+
marshalUpdateCronRequest,
|
|
22
|
+
marshalUpdateNamespaceRequest,
|
|
23
|
+
marshalUpdateTriggerRequest,
|
|
24
|
+
unmarshalContainer,
|
|
25
|
+
unmarshalCron,
|
|
26
|
+
unmarshalDomain,
|
|
27
|
+
unmarshalListContainersResponse,
|
|
28
|
+
unmarshalListCronsResponse,
|
|
29
|
+
unmarshalListDomainsResponse,
|
|
30
|
+
unmarshalListNamespacesResponse,
|
|
31
|
+
unmarshalListTokensResponse,
|
|
32
|
+
unmarshalListTriggersResponse,
|
|
33
|
+
unmarshalNamespace,
|
|
34
|
+
unmarshalToken,
|
|
35
|
+
unmarshalTrigger
|
|
36
|
+
};
|
|
@@ -0,0 +1,501 @@
|
|
|
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 unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
|
|
6
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
path: data.path
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalContainerHealthCheckSpecTCPProbe = (data) => {
|
|
16
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
};
|
|
23
|
+
const unmarshalContainerHealthCheckSpec = (data) => {
|
|
24
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
25
|
+
throw new TypeError(
|
|
26
|
+
`Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
failureThreshold: data.failure_threshold,
|
|
31
|
+
http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : void 0,
|
|
32
|
+
interval: data.interval,
|
|
33
|
+
tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : void 0
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const unmarshalContainerScalingOption = (data) => {
|
|
37
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
38
|
+
throw new TypeError(
|
|
39
|
+
`Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
concurrentRequestsThreshold: data.concurrent_requests_threshold,
|
|
44
|
+
cpuUsageThreshold: data.cpu_usage_threshold,
|
|
45
|
+
memoryUsageThreshold: data.memory_usage_threshold
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const unmarshalSecretHashedValue = (data) => {
|
|
49
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
50
|
+
throw new TypeError(
|
|
51
|
+
`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
hashedValue: data.hashed_value,
|
|
56
|
+
key: data.key
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const unmarshalContainer = (data) => {
|
|
60
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
61
|
+
throw new TypeError(
|
|
62
|
+
`Unmarshalling the type 'Container' failed as data isn't a dictionary.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
cpuLimit: data.cpu_limit,
|
|
67
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
68
|
+
description: data.description,
|
|
69
|
+
domainName: data.domain_name,
|
|
70
|
+
environmentVariables: data.environment_variables,
|
|
71
|
+
errorMessage: data.error_message,
|
|
72
|
+
healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : void 0,
|
|
73
|
+
httpOption: data.http_option,
|
|
74
|
+
id: data.id,
|
|
75
|
+
localStorageLimit: data.local_storage_limit,
|
|
76
|
+
maxConcurrency: data.max_concurrency,
|
|
77
|
+
maxScale: data.max_scale,
|
|
78
|
+
memoryLimit: data.memory_limit,
|
|
79
|
+
minScale: data.min_scale,
|
|
80
|
+
name: data.name,
|
|
81
|
+
namespaceId: data.namespace_id,
|
|
82
|
+
port: data.port,
|
|
83
|
+
privacy: data.privacy,
|
|
84
|
+
protocol: data.protocol,
|
|
85
|
+
readyAt: sdkClient.unmarshalDate(data.ready_at),
|
|
86
|
+
region: data.region,
|
|
87
|
+
registryImage: data.registry_image,
|
|
88
|
+
sandbox: data.sandbox,
|
|
89
|
+
scalingOption: data.scaling_option ? unmarshalContainerScalingOption(data.scaling_option) : void 0,
|
|
90
|
+
secretEnvironmentVariables: sdkClient.unmarshalArrayOfObject(
|
|
91
|
+
data.secret_environment_variables,
|
|
92
|
+
unmarshalSecretHashedValue
|
|
93
|
+
),
|
|
94
|
+
status: data.status,
|
|
95
|
+
tags: data.tags,
|
|
96
|
+
timeout: data.timeout,
|
|
97
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const unmarshalCron = (data) => {
|
|
101
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
102
|
+
throw new TypeError(
|
|
103
|
+
`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
args: data.args,
|
|
108
|
+
containerId: data.container_id,
|
|
109
|
+
id: data.id,
|
|
110
|
+
name: data.name,
|
|
111
|
+
schedule: data.schedule,
|
|
112
|
+
status: data.status
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const unmarshalDomain = (data) => {
|
|
116
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
117
|
+
throw new TypeError(
|
|
118
|
+
`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
containerId: data.container_id,
|
|
123
|
+
errorMessage: data.error_message,
|
|
124
|
+
hostname: data.hostname,
|
|
125
|
+
id: data.id,
|
|
126
|
+
status: data.status,
|
|
127
|
+
url: data.url
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const unmarshalNamespace = (data) => {
|
|
131
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
132
|
+
throw new TypeError(
|
|
133
|
+
`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
138
|
+
description: data.description,
|
|
139
|
+
environmentVariables: data.environment_variables,
|
|
140
|
+
errorMessage: data.error_message,
|
|
141
|
+
id: data.id,
|
|
142
|
+
name: data.name,
|
|
143
|
+
organizationId: data.organization_id,
|
|
144
|
+
projectId: data.project_id,
|
|
145
|
+
region: data.region,
|
|
146
|
+
registryEndpoint: data.registry_endpoint,
|
|
147
|
+
registryNamespaceId: data.registry_namespace_id,
|
|
148
|
+
secretEnvironmentVariables: sdkClient.unmarshalArrayOfObject(
|
|
149
|
+
data.secret_environment_variables,
|
|
150
|
+
unmarshalSecretHashedValue
|
|
151
|
+
),
|
|
152
|
+
status: data.status,
|
|
153
|
+
tags: data.tags,
|
|
154
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const unmarshalToken = (data) => {
|
|
158
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(
|
|
160
|
+
`Unmarshalling the type 'Token' failed as data isn't a dictionary.`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
containerId: data.container_id,
|
|
165
|
+
description: data.description,
|
|
166
|
+
expiresAt: sdkClient.unmarshalDate(data.expires_at),
|
|
167
|
+
id: data.id,
|
|
168
|
+
namespaceId: data.namespace_id,
|
|
169
|
+
publicKey: data.public_key,
|
|
170
|
+
status: data.status,
|
|
171
|
+
token: data.token
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
const unmarshalTriggerMnqNatsClientConfig = (data) => {
|
|
175
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
176
|
+
throw new TypeError(
|
|
177
|
+
`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
182
|
+
mnqNatsAccountId: data.mnq_nats_account_id,
|
|
183
|
+
mnqProjectId: data.mnq_project_id,
|
|
184
|
+
mnqRegion: data.mnq_region,
|
|
185
|
+
subject: data.subject
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
const unmarshalTriggerMnqSqsClientConfig = (data) => {
|
|
189
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
190
|
+
throw new TypeError(
|
|
191
|
+
`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
196
|
+
mnqProjectId: data.mnq_project_id,
|
|
197
|
+
mnqRegion: data.mnq_region,
|
|
198
|
+
queue: data.queue
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
const unmarshalTriggerSqsClientConfig = (data) => {
|
|
202
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
203
|
+
throw new TypeError(
|
|
204
|
+
`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
accessKey: data.access_key,
|
|
209
|
+
endpoint: data.endpoint,
|
|
210
|
+
queueUrl: data.queue_url,
|
|
211
|
+
secretKey: data.secret_key
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
const unmarshalTrigger = (data) => {
|
|
215
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
216
|
+
throw new TypeError(
|
|
217
|
+
`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
containerId: data.container_id,
|
|
222
|
+
description: data.description,
|
|
223
|
+
errorMessage: data.error_message,
|
|
224
|
+
id: data.id,
|
|
225
|
+
inputType: data.input_type,
|
|
226
|
+
name: data.name,
|
|
227
|
+
scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0,
|
|
228
|
+
scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0,
|
|
229
|
+
sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0,
|
|
230
|
+
status: data.status
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
const unmarshalListContainersResponse = (data) => {
|
|
234
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
235
|
+
throw new TypeError(
|
|
236
|
+
`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
containers: sdkClient.unmarshalArrayOfObject(data.containers, unmarshalContainer),
|
|
241
|
+
totalCount: data.total_count
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
const unmarshalListCronsResponse = (data) => {
|
|
245
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
246
|
+
throw new TypeError(
|
|
247
|
+
`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
crons: sdkClient.unmarshalArrayOfObject(data.crons, unmarshalCron),
|
|
252
|
+
totalCount: data.total_count
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
const unmarshalListDomainsResponse = (data) => {
|
|
256
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
257
|
+
throw new TypeError(
|
|
258
|
+
`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
domains: sdkClient.unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
263
|
+
totalCount: data.total_count
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
const unmarshalListNamespacesResponse = (data) => {
|
|
267
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
268
|
+
throw new TypeError(
|
|
269
|
+
`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
namespaces: sdkClient.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
|
|
274
|
+
totalCount: data.total_count
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
const unmarshalListTokensResponse = (data) => {
|
|
278
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
279
|
+
throw new TypeError(
|
|
280
|
+
`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
tokens: sdkClient.unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
285
|
+
totalCount: data.total_count
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
const unmarshalListTriggersResponse = (data) => {
|
|
289
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
290
|
+
throw new TypeError(
|
|
291
|
+
`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
totalCount: data.total_count,
|
|
296
|
+
triggers: sdkClient.unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
const marshalContainerHealthCheckSpecHTTPProbe = (request, defaults) => ({
|
|
300
|
+
path: request.path
|
|
301
|
+
});
|
|
302
|
+
const marshalContainerHealthCheckSpecTCPProbe = (request, defaults) => ({});
|
|
303
|
+
const marshalContainerHealthCheckSpec = (request, defaults) => ({
|
|
304
|
+
failure_threshold: request.failureThreshold,
|
|
305
|
+
interval: request.interval,
|
|
306
|
+
...sdkClient.resolveOneOf([
|
|
307
|
+
{
|
|
308
|
+
param: "http",
|
|
309
|
+
value: request.http !== void 0 ? marshalContainerHealthCheckSpecHTTPProbe(request.http) : void 0
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
param: "tcp",
|
|
313
|
+
value: request.tcp !== void 0 ? marshalContainerHealthCheckSpecTCPProbe(request.tcp) : void 0
|
|
314
|
+
}
|
|
315
|
+
])
|
|
316
|
+
});
|
|
317
|
+
const marshalContainerScalingOption = (request, defaults) => ({
|
|
318
|
+
...sdkClient.resolveOneOf([
|
|
319
|
+
{
|
|
320
|
+
param: "concurrent_requests_threshold",
|
|
321
|
+
value: request.concurrentRequestsThreshold
|
|
322
|
+
},
|
|
323
|
+
{ param: "cpu_usage_threshold", value: request.cpuUsageThreshold },
|
|
324
|
+
{ param: "memory_usage_threshold", value: request.memoryUsageThreshold }
|
|
325
|
+
])
|
|
326
|
+
});
|
|
327
|
+
const marshalSecret = (request, defaults) => ({
|
|
328
|
+
key: request.key,
|
|
329
|
+
value: request.value
|
|
330
|
+
});
|
|
331
|
+
const marshalCreateContainerRequest = (request, defaults) => ({
|
|
332
|
+
cpu_limit: request.cpuLimit,
|
|
333
|
+
description: request.description,
|
|
334
|
+
environment_variables: request.environmentVariables,
|
|
335
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
336
|
+
http_option: request.httpOption,
|
|
337
|
+
local_storage_limit: request.localStorageLimit,
|
|
338
|
+
max_concurrency: request.maxConcurrency,
|
|
339
|
+
max_scale: request.maxScale,
|
|
340
|
+
memory_limit: request.memoryLimit,
|
|
341
|
+
min_scale: request.minScale,
|
|
342
|
+
name: request.name,
|
|
343
|
+
namespace_id: request.namespaceId,
|
|
344
|
+
port: request.port,
|
|
345
|
+
privacy: request.privacy,
|
|
346
|
+
protocol: request.protocol,
|
|
347
|
+
registry_image: request.registryImage,
|
|
348
|
+
sandbox: request.sandbox,
|
|
349
|
+
scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption) : void 0,
|
|
350
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
351
|
+
(elt) => marshalSecret(elt)
|
|
352
|
+
) : void 0,
|
|
353
|
+
tags: request.tags,
|
|
354
|
+
timeout: request.timeout
|
|
355
|
+
});
|
|
356
|
+
const marshalCreateCronRequest = (request, defaults) => ({
|
|
357
|
+
args: request.args,
|
|
358
|
+
container_id: request.containerId,
|
|
359
|
+
name: request.name,
|
|
360
|
+
schedule: request.schedule
|
|
361
|
+
});
|
|
362
|
+
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
363
|
+
container_id: request.containerId,
|
|
364
|
+
hostname: request.hostname
|
|
365
|
+
});
|
|
366
|
+
const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
367
|
+
description: request.description,
|
|
368
|
+
environment_variables: request.environmentVariables,
|
|
369
|
+
name: request.name || randomName("cns"),
|
|
370
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
371
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
372
|
+
(elt) => marshalSecret(elt)
|
|
373
|
+
) : void 0,
|
|
374
|
+
tags: request.tags
|
|
375
|
+
});
|
|
376
|
+
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
377
|
+
description: request.description,
|
|
378
|
+
expires_at: request.expiresAt,
|
|
379
|
+
...sdkClient.resolveOneOf([
|
|
380
|
+
{ param: "container_id", value: request.containerId },
|
|
381
|
+
{ param: "namespace_id", value: request.namespaceId }
|
|
382
|
+
])
|
|
383
|
+
});
|
|
384
|
+
const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
385
|
+
mnq_nats_account_id: request.mnqNatsAccountId,
|
|
386
|
+
mnq_project_id: request.mnqProjectId,
|
|
387
|
+
mnq_region: request.mnqRegion,
|
|
388
|
+
subject: request.subject
|
|
389
|
+
});
|
|
390
|
+
const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
391
|
+
mnq_project_id: request.mnqProjectId,
|
|
392
|
+
mnq_region: request.mnqRegion,
|
|
393
|
+
queue: request.queue
|
|
394
|
+
});
|
|
395
|
+
const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
396
|
+
access_key: request.accessKey,
|
|
397
|
+
endpoint: request.endpoint,
|
|
398
|
+
queue_url: request.queueUrl,
|
|
399
|
+
secret_key: request.secretKey
|
|
400
|
+
});
|
|
401
|
+
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
402
|
+
container_id: request.containerId,
|
|
403
|
+
description: request.description,
|
|
404
|
+
name: request.name,
|
|
405
|
+
...sdkClient.resolveOneOf([
|
|
406
|
+
{
|
|
407
|
+
param: "scw_sqs_config",
|
|
408
|
+
value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(
|
|
409
|
+
request.scwSqsConfig
|
|
410
|
+
) : void 0
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
param: "scw_nats_config",
|
|
414
|
+
value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(
|
|
415
|
+
request.scwNatsConfig
|
|
416
|
+
) : void 0
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
param: "sqs_config",
|
|
420
|
+
value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(
|
|
421
|
+
request.sqsConfig
|
|
422
|
+
) : void 0
|
|
423
|
+
}
|
|
424
|
+
])
|
|
425
|
+
});
|
|
426
|
+
const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
427
|
+
cpu_limit: request.cpuLimit,
|
|
428
|
+
description: request.description,
|
|
429
|
+
environment_variables: request.environmentVariables,
|
|
430
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
431
|
+
http_option: request.httpOption,
|
|
432
|
+
local_storage_limit: request.localStorageLimit,
|
|
433
|
+
max_concurrency: request.maxConcurrency,
|
|
434
|
+
max_scale: request.maxScale,
|
|
435
|
+
memory_limit: request.memoryLimit,
|
|
436
|
+
min_scale: request.minScale,
|
|
437
|
+
port: request.port,
|
|
438
|
+
privacy: request.privacy,
|
|
439
|
+
protocol: request.protocol,
|
|
440
|
+
redeploy: request.redeploy,
|
|
441
|
+
registry_image: request.registryImage,
|
|
442
|
+
sandbox: request.sandbox,
|
|
443
|
+
scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption) : void 0,
|
|
444
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
445
|
+
(elt) => marshalSecret(elt)
|
|
446
|
+
) : void 0,
|
|
447
|
+
tags: request.tags,
|
|
448
|
+
timeout: request.timeout
|
|
449
|
+
});
|
|
450
|
+
const marshalUpdateCronRequest = (request, defaults) => ({
|
|
451
|
+
args: request.args,
|
|
452
|
+
container_id: request.containerId,
|
|
453
|
+
name: request.name,
|
|
454
|
+
schedule: request.schedule
|
|
455
|
+
});
|
|
456
|
+
const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
457
|
+
description: request.description,
|
|
458
|
+
environment_variables: request.environmentVariables,
|
|
459
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
460
|
+
(elt) => marshalSecret(elt)
|
|
461
|
+
) : void 0,
|
|
462
|
+
tags: request.tags
|
|
463
|
+
});
|
|
464
|
+
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
465
|
+
access_key: request.accessKey,
|
|
466
|
+
secret_key: request.secretKey
|
|
467
|
+
});
|
|
468
|
+
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
469
|
+
description: request.description,
|
|
470
|
+
name: request.name,
|
|
471
|
+
...sdkClient.resolveOneOf([
|
|
472
|
+
{
|
|
473
|
+
param: "sqs_config",
|
|
474
|
+
value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(
|
|
475
|
+
request.sqsConfig
|
|
476
|
+
) : void 0
|
|
477
|
+
}
|
|
478
|
+
])
|
|
479
|
+
});
|
|
480
|
+
exports.marshalCreateContainerRequest = marshalCreateContainerRequest;
|
|
481
|
+
exports.marshalCreateCronRequest = marshalCreateCronRequest;
|
|
482
|
+
exports.marshalCreateDomainRequest = marshalCreateDomainRequest;
|
|
483
|
+
exports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest;
|
|
484
|
+
exports.marshalCreateTokenRequest = marshalCreateTokenRequest;
|
|
485
|
+
exports.marshalCreateTriggerRequest = marshalCreateTriggerRequest;
|
|
486
|
+
exports.marshalUpdateContainerRequest = marshalUpdateContainerRequest;
|
|
487
|
+
exports.marshalUpdateCronRequest = marshalUpdateCronRequest;
|
|
488
|
+
exports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest;
|
|
489
|
+
exports.marshalUpdateTriggerRequest = marshalUpdateTriggerRequest;
|
|
490
|
+
exports.unmarshalContainer = unmarshalContainer;
|
|
491
|
+
exports.unmarshalCron = unmarshalCron;
|
|
492
|
+
exports.unmarshalDomain = unmarshalDomain;
|
|
493
|
+
exports.unmarshalListContainersResponse = unmarshalListContainersResponse;
|
|
494
|
+
exports.unmarshalListCronsResponse = unmarshalListCronsResponse;
|
|
495
|
+
exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;
|
|
496
|
+
exports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse;
|
|
497
|
+
exports.unmarshalListTokensResponse = unmarshalListTokensResponse;
|
|
498
|
+
exports.unmarshalListTriggersResponse = unmarshalListTriggersResponse;
|
|
499
|
+
exports.unmarshalNamespace = unmarshalNamespace;
|
|
500
|
+
exports.unmarshalToken = unmarshalToken;
|
|
501
|
+
exports.unmarshalTrigger = unmarshalTrigger;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Container, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, Cron, Domain, ListContainersResponse, ListCronsResponse, ListDomainsResponse, ListNamespacesResponse, ListTokensResponse, ListTriggersResponse, Namespace, Token, Trigger, UpdateContainerRequest, UpdateCronRequest, UpdateNamespaceRequest, UpdateTriggerRequest } from './types.gen';
|
|
3
|
+
export declare const unmarshalContainer: (data: unknown) => Container;
|
|
4
|
+
export declare const unmarshalCron: (data: unknown) => Cron;
|
|
5
|
+
export declare const unmarshalDomain: (data: unknown) => Domain;
|
|
6
|
+
export declare const unmarshalNamespace: (data: unknown) => Namespace;
|
|
7
|
+
export declare const unmarshalToken: (data: unknown) => Token;
|
|
8
|
+
export declare const unmarshalTrigger: (data: unknown) => Trigger;
|
|
9
|
+
export declare const unmarshalListContainersResponse: (data: unknown) => ListContainersResponse;
|
|
10
|
+
export declare const unmarshalListCronsResponse: (data: unknown) => ListCronsResponse;
|
|
11
|
+
export declare const unmarshalListDomainsResponse: (data: unknown) => ListDomainsResponse;
|
|
12
|
+
export declare const unmarshalListNamespacesResponse: (data: unknown) => ListNamespacesResponse;
|
|
13
|
+
export declare const unmarshalListTokensResponse: (data: unknown) => ListTokensResponse;
|
|
14
|
+
export declare const unmarshalListTriggersResponse: (data: unknown) => ListTriggersResponse;
|
|
15
|
+
export declare const marshalCreateContainerRequest: (request: CreateContainerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalCreateCronRequest: (request: CreateCronRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
|
+
export declare const marshalCreateDomainRequest: (request: CreateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalCreateNamespaceRequest: (request: CreateNamespaceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
19
|
+
export declare const marshalCreateTokenRequest: (request: CreateTokenRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
20
|
+
export declare const marshalCreateTriggerRequest: (request: CreateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
21
|
+
export declare const marshalUpdateContainerRequest: (request: UpdateContainerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
|
+
export declare const marshalUpdateCronRequest: (request: UpdateCronRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
23
|
+
export declare const marshalUpdateNamespaceRequest: (request: UpdateNamespaceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
24
|
+
export declare const marshalUpdateTriggerRequest: (request: UpdateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
|