@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account/index.js +4 -0
- package/dist/api/account/v2/api.gen.js +147 -0
- package/dist/api/account/v2/index.gen.js +4 -0
- package/dist/api/account/v2/marshalling.gen.js +39 -0
- package/dist/api/account/v3/api.gen.js +129 -0
- package/dist/api/account/v3/index.gen.js +6 -0
- package/dist/api/account/v3/marshalling.gen.js +39 -0
- package/dist/api/account/v3/validation-rules.gen.js +39 -0
- package/dist/api/applesilicon/index.js +2 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
- package/dist/api/baremetal/index.js +2 -0
- package/dist/api/baremetal/v1/api.gen.js +523 -0
- package/dist/api/baremetal/v1/api.utils.js +27 -0
- package/dist/api/baremetal/v1/content.gen.js +13 -0
- package/dist/api/baremetal/v1/index.js +5 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +80 -0
- package/dist/api/billing/v2alpha1/index.gen.js +4 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
- package/dist/api/block/index.js +2 -0
- package/dist/api/block/v1alpha1/api.gen.js +249 -0
- package/dist/api/block/v1alpha1/content.gen.js +13 -0
- package/dist/api/block/v1alpha1/index.gen.js +7 -0
- package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
- package/dist/api/cockpit/index.js +2 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
- package/dist/api/container/index.js +2 -0
- package/dist/api/container/v1beta1/api.gen.js +549 -0
- package/dist/api/container/v1beta1/content.gen.js +22 -0
- package/dist/api/container/v1beta1/index.gen.js +7 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/document_db/index.js +2 -0
- package/dist/api/document_db/v1beta1/api.gen.js +830 -0
- package/dist/api/document_db/v1beta1/content.gen.js +19 -0
- package/dist/api/document_db/v1beta1/index.gen.js +7 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
- package/dist/api/domain/index.js +2 -0
- package/dist/api/domain/v2beta1/api.gen.js +867 -0
- package/dist/api/domain/v2beta1/content.gen.js +28 -0
- package/dist/api/domain/v2beta1/index.gen.js +5 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
- package/dist/api/flexibleip/index.js +2 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -0
- package/dist/api/function/v1beta1/api.gen.js +560 -0
- package/dist/api/function/v1beta1/content.gen.js +22 -0
- package/dist/api/function/v1beta1/index.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/iam/index.js +2 -0
- package/dist/api/iam/v1alpha1/api.gen.js +783 -0
- package/dist/api/iam/v1alpha1/index.gen.js +6 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
- package/dist/api/instance/index.js +2 -0
- package/dist/api/instance/v1/api.gen.js +1003 -0
- package/dist/api/instance/v1/api.utils.js +369 -0
- package/dist/api/instance/v1/content.gen.js +31 -0
- package/dist/api/instance/v1/index.js +2 -0
- package/dist/api/instance/v1/marshalling.gen.js +1415 -0
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -0
- package/dist/api/iot/v1/api.gen.js +573 -0
- package/dist/api/iot/v1/content.gen.js +7 -0
- package/dist/api/iot/v1/index.gen.js +5 -0
- package/dist/api/iot/v1/marshalling.gen.js +439 -0
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
- package/dist/api/k8s/index.js +2 -0
- package/dist/api/k8s/v1/api.gen.js +454 -0
- package/dist/api/k8s/v1/api.utils.js +13 -0
- package/dist/api/k8s/v1/content.gen.js +13 -0
- package/dist/api/k8s/v1/index.js +4 -0
- package/dist/api/k8s/v1/marshalling.gen.js +421 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
- package/dist/api/lb/index.js +2 -0
- package/dist/api/lb/v1/api.gen.js +1669 -0
- package/dist/api/lb/v1/api.utils.js +81 -0
- package/dist/api/lb/v1/content.gen.js +16 -0
- package/dist/api/lb/v1/index.js +2 -0
- package/dist/api/lb/v1/marshalling.gen.js +1039 -0
- package/dist/api/marketplace/index.js +4 -0
- package/dist/api/marketplace/v1/api.gen.js +60 -0
- package/dist/api/marketplace/v1/index.gen.js +4 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
- package/dist/api/marketplace/v2/api.gen.js +162 -0
- package/dist/api/marketplace/v2/index.gen.js +4 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
- package/dist/api/mnq/index.js +4 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
- package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
- package/dist/api/mnq/v1beta1/api.gen.js +529 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
- package/dist/api/rdb/index.js +2 -0
- package/dist/api/rdb/v1/api.gen.js +972 -0
- package/dist/api/rdb/v1/content.gen.js +22 -0
- package/dist/api/rdb/v1/index.gen.js +7 -0
- package/dist/api/rdb/v1/marshalling.gen.js +694 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
- package/dist/api/redis/index.js +2 -0
- package/dist/api/redis/v1/api.gen.js +389 -0
- package/dist/api/redis/v1/content.gen.js +7 -0
- package/dist/api/redis/v1/index.gen.js +5 -0
- package/dist/api/redis/v1/marshalling.gen.js +283 -0
- package/dist/api/registry/index.js +2 -0
- package/dist/api/registry/v1/api.gen.js +252 -0
- package/dist/api/registry/v1/content.gen.js +13 -0
- package/dist/api/registry/v1/index.gen.js +5 -0
- package/dist/api/registry/v1/marshalling.gen.js +108 -0
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +415 -0
- package/dist/api/secret/v1alpha1/index.gen.js +4 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +229 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +5 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
- package/dist/api/test/index.js +2 -0
- package/dist/api/test/v1/api.gen.js +152 -0
- package/dist/api/test/v1/content.gen.js +7 -0
- package/dist/api/test/v1/index.gen.js +5 -0
- package/dist/api/test/v1/marshalling.gen.js +81 -0
- package/dist/api/vpc/index.js +4 -0
- package/dist/api/vpc/v1/api.gen.js +110 -0
- package/dist/api/vpc/v1/index.gen.js +4 -0
- package/dist/api/vpc/v1/marshalling.gen.js +44 -0
- package/dist/api/vpc/v2/api.gen.js +276 -0
- package/dist/api/vpc/v2/index.gen.js +4 -0
- package/dist/api/vpc/v2/marshalling.gen.js +137 -0
- package/dist/api/vpcgw/index.js +2 -0
- package/dist/api/vpcgw/v1/api.gen.js +669 -0
- package/dist/api/vpcgw/v1/content.gen.js +10 -0
- package/dist/api/vpcgw/v1/index.gen.js +5 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
- package/dist/api/webhosting/index.js +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/helpers/is-browser.js +5 -0
- package/dist/helpers/is-response.js +10 -0
- package/dist/helpers/json.js +11 -0
- package/dist/helpers/marshalling.js +130 -0
- package/dist/index.cjs +26484 -0
- package/dist/index.d.ts +31184 -0
- package/dist/index.js +71 -0
- package/dist/internal/async/interval-retrier.js +105 -0
- package/dist/internal/async/sleep.js +13 -0
- package/dist/internal/interceptors/composer.js +46 -0
- package/dist/internal/interceptors/helpers.js +32 -0
- package/dist/internal/logger/console-logger.js +38 -0
- package/dist/internal/logger/index.js +41 -0
- package/dist/internal/logger/level-resolver.js +13 -0
- package/dist/internal/validations/string-validation.js +38 -0
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +12 -0
- package/dist/scw/auth.js +68 -0
- package/dist/scw/client-ini-factory.js +174 -0
- package/dist/scw/client-ini-profile.js +54 -0
- package/dist/scw/client-settings.js +78 -0
- package/dist/scw/client.js +98 -0
- package/dist/scw/constants.js +4 -0
- package/dist/scw/custom-marshalling.js +131 -0
- package/dist/scw/errors/error-parser.js +107 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
- package/dist/scw/errors/scw-error.js +66 -0
- package/dist/scw/errors/standard/already-exists-error.js +26 -0
- package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
- package/dist/scw/errors/standard/index.js +13 -0
- package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
- package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
- package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
- package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
- package/dist/scw/errors/standard/resource-expired-error.js +26 -0
- package/dist/scw/errors/standard/resource-locked-error.js +25 -0
- package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
- package/dist/scw/errors/standard/transient-state-error.js +26 -0
- package/dist/scw/errors/types.js +23 -0
- package/dist/scw/fetch/build-fetcher.js +72 -0
- package/dist/scw/fetch/http-dumper.js +54 -0
- package/dist/scw/fetch/http-interceptors.js +99 -0
- package/dist/scw/fetch/resource-paginator.js +84 -0
- package/dist/scw/fetch/response-parser.js +72 -0
- package/package.json +2 -2
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
+
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
+
const unmarshalSecretHashedValue = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
hashedValue: data.hashed_value,
|
|
13
|
+
key: data.key
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalContainer = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
cpuLimit: data.cpu_limit,
|
|
22
|
+
description: data.description,
|
|
23
|
+
domainName: data.domain_name,
|
|
24
|
+
environmentVariables: data.environment_variables,
|
|
25
|
+
errorMessage: data.error_message,
|
|
26
|
+
httpOption: data.http_option,
|
|
27
|
+
id: data.id,
|
|
28
|
+
maxConcurrency: data.max_concurrency,
|
|
29
|
+
maxScale: data.max_scale,
|
|
30
|
+
memoryLimit: data.memory_limit,
|
|
31
|
+
minScale: data.min_scale,
|
|
32
|
+
name: data.name,
|
|
33
|
+
namespaceId: data.namespace_id,
|
|
34
|
+
port: data.port,
|
|
35
|
+
privacy: data.privacy,
|
|
36
|
+
protocol: data.protocol,
|
|
37
|
+
region: data.region,
|
|
38
|
+
registryImage: data.registry_image,
|
|
39
|
+
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
40
|
+
status: data.status,
|
|
41
|
+
timeout: data.timeout
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const unmarshalCron = data => {
|
|
45
|
+
if (!isJSONObject(data)) {
|
|
46
|
+
throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
args: data.args,
|
|
50
|
+
containerId: data.container_id,
|
|
51
|
+
id: data.id,
|
|
52
|
+
name: data.name,
|
|
53
|
+
schedule: data.schedule,
|
|
54
|
+
status: data.status
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const unmarshalDomain = data => {
|
|
58
|
+
if (!isJSONObject(data)) {
|
|
59
|
+
throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
containerId: data.container_id,
|
|
63
|
+
errorMessage: data.error_message,
|
|
64
|
+
hostname: data.hostname,
|
|
65
|
+
id: data.id,
|
|
66
|
+
status: data.status,
|
|
67
|
+
url: data.url
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const unmarshalNamespace = data => {
|
|
71
|
+
if (!isJSONObject(data)) {
|
|
72
|
+
throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
description: data.description,
|
|
76
|
+
environmentVariables: data.environment_variables,
|
|
77
|
+
errorMessage: data.error_message,
|
|
78
|
+
id: data.id,
|
|
79
|
+
name: data.name,
|
|
80
|
+
organizationId: data.organization_id,
|
|
81
|
+
projectId: data.project_id,
|
|
82
|
+
region: data.region,
|
|
83
|
+
registryEndpoint: data.registry_endpoint,
|
|
84
|
+
registryNamespaceId: data.registry_namespace_id,
|
|
85
|
+
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
86
|
+
status: data.status
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const unmarshalToken = data => {
|
|
90
|
+
if (!isJSONObject(data)) {
|
|
91
|
+
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
containerId: data.container_id,
|
|
95
|
+
description: data.description,
|
|
96
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
97
|
+
id: data.id,
|
|
98
|
+
namespaceId: data.namespace_id,
|
|
99
|
+
publicKey: data.public_key,
|
|
100
|
+
status: data.status,
|
|
101
|
+
token: data.token
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
105
|
+
if (!isJSONObject(data)) {
|
|
106
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
110
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
111
|
+
mnqNatsAccountId: data.mnq_nats_account_id,
|
|
112
|
+
mnqProjectId: data.mnq_project_id,
|
|
113
|
+
mnqRegion: data.mnq_region,
|
|
114
|
+
subject: data.subject
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const unmarshalTriggerMnqSqsClientConfig = data => {
|
|
118
|
+
if (!isJSONObject(data)) {
|
|
119
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
123
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
124
|
+
mnqProjectId: data.mnq_project_id,
|
|
125
|
+
mnqRegion: data.mnq_region,
|
|
126
|
+
queue: data.queue
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const unmarshalTriggerSqsClientConfig = data => {
|
|
130
|
+
if (!isJSONObject(data)) {
|
|
131
|
+
throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
accessKey: data.access_key,
|
|
135
|
+
endpoint: data.endpoint,
|
|
136
|
+
queueUrl: data.queue_url,
|
|
137
|
+
secretKey: data.secret_key
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
const unmarshalTrigger = data => {
|
|
141
|
+
if (!isJSONObject(data)) {
|
|
142
|
+
throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
containerId: data.container_id,
|
|
146
|
+
description: data.description,
|
|
147
|
+
errorMessage: data.error_message,
|
|
148
|
+
id: data.id,
|
|
149
|
+
inputType: data.input_type,
|
|
150
|
+
name: data.name,
|
|
151
|
+
scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,
|
|
152
|
+
scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,
|
|
153
|
+
sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,
|
|
154
|
+
status: data.status
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const unmarshalListContainersResponse = data => {
|
|
158
|
+
if (!isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
containers: unmarshalArrayOfObject(data.containers, unmarshalContainer),
|
|
163
|
+
totalCount: data.total_count
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const unmarshalListCronsResponse = data => {
|
|
167
|
+
if (!isJSONObject(data)) {
|
|
168
|
+
throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
|
|
172
|
+
totalCount: data.total_count
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
const unmarshalListDomainsResponse = data => {
|
|
176
|
+
if (!isJSONObject(data)) {
|
|
177
|
+
throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
181
|
+
totalCount: data.total_count
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const unmarshalLog = data => {
|
|
185
|
+
if (!isJSONObject(data)) {
|
|
186
|
+
throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
id: data.id,
|
|
190
|
+
level: data.level,
|
|
191
|
+
message: data.message,
|
|
192
|
+
source: data.source,
|
|
193
|
+
stream: data.stream,
|
|
194
|
+
timestamp: unmarshalDate(data.timestamp)
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
const unmarshalListLogsResponse = data => {
|
|
198
|
+
if (!isJSONObject(data)) {
|
|
199
|
+
throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
|
|
203
|
+
totalCount: data.total_count
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
const unmarshalListNamespacesResponse = data => {
|
|
207
|
+
if (!isJSONObject(data)) {
|
|
208
|
+
throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
|
|
212
|
+
totalCount: data.total_count
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
const unmarshalListTokensResponse = data => {
|
|
216
|
+
if (!isJSONObject(data)) {
|
|
217
|
+
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
221
|
+
totalCount: data.total_count
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
const unmarshalListTriggersResponse = data => {
|
|
225
|
+
if (!isJSONObject(data)) {
|
|
226
|
+
throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
totalCount: data.total_count,
|
|
230
|
+
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
const marshalSecret = (request, defaults) => ({
|
|
234
|
+
key: request.key,
|
|
235
|
+
value: request.value
|
|
236
|
+
});
|
|
237
|
+
const marshalCreateContainerRequest = (request, defaults) => ({
|
|
238
|
+
cpu_limit: request.cpuLimit,
|
|
239
|
+
description: request.description,
|
|
240
|
+
environment_variables: request.environmentVariables,
|
|
241
|
+
http_option: request.httpOption,
|
|
242
|
+
max_concurrency: request.maxConcurrency,
|
|
243
|
+
max_scale: request.maxScale,
|
|
244
|
+
memory_limit: request.memoryLimit,
|
|
245
|
+
min_scale: request.minScale,
|
|
246
|
+
name: request.name,
|
|
247
|
+
namespace_id: request.namespaceId,
|
|
248
|
+
port: request.port,
|
|
249
|
+
privacy: request.privacy,
|
|
250
|
+
protocol: request.protocol,
|
|
251
|
+
registry_image: request.registryImage,
|
|
252
|
+
secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
|
|
253
|
+
timeout: request.timeout
|
|
254
|
+
});
|
|
255
|
+
const marshalCreateCronRequest = (request, defaults) => ({
|
|
256
|
+
args: request.args,
|
|
257
|
+
container_id: request.containerId,
|
|
258
|
+
name: request.name,
|
|
259
|
+
schedule: request.schedule
|
|
260
|
+
});
|
|
261
|
+
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
262
|
+
container_id: request.containerId,
|
|
263
|
+
hostname: request.hostname
|
|
264
|
+
});
|
|
265
|
+
const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
266
|
+
description: request.description,
|
|
267
|
+
environment_variables: request.environmentVariables,
|
|
268
|
+
name: request.name || randomName('cns'),
|
|
269
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
270
|
+
secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
|
|
271
|
+
});
|
|
272
|
+
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
273
|
+
description: request.description,
|
|
274
|
+
expires_at: request.expiresAt,
|
|
275
|
+
...resolveOneOf([{
|
|
276
|
+
param: 'container_id',
|
|
277
|
+
value: request.containerId
|
|
278
|
+
}, {
|
|
279
|
+
param: 'namespace_id',
|
|
280
|
+
value: request.namespaceId
|
|
281
|
+
}])
|
|
282
|
+
});
|
|
283
|
+
const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
284
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
285
|
+
mnq_nats_account_id: request.mnqNatsAccountId,
|
|
286
|
+
mnq_project_id: request.mnqProjectId,
|
|
287
|
+
mnq_region: request.mnqRegion,
|
|
288
|
+
subject: request.subject
|
|
289
|
+
});
|
|
290
|
+
const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
291
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
292
|
+
mnq_project_id: request.mnqProjectId,
|
|
293
|
+
mnq_region: request.mnqRegion,
|
|
294
|
+
queue: request.queue
|
|
295
|
+
});
|
|
296
|
+
const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
297
|
+
access_key: request.accessKey,
|
|
298
|
+
endpoint: request.endpoint,
|
|
299
|
+
queue_url: request.queueUrl,
|
|
300
|
+
secret_key: request.secretKey
|
|
301
|
+
});
|
|
302
|
+
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
303
|
+
container_id: request.containerId,
|
|
304
|
+
description: request.description,
|
|
305
|
+
name: request.name,
|
|
306
|
+
...resolveOneOf([{
|
|
307
|
+
param: 'scw_sqs_config',
|
|
308
|
+
value: request.scwSqsConfig !== undefined ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
309
|
+
}, {
|
|
310
|
+
param: 'sqs_config',
|
|
311
|
+
value: request.sqsConfig !== undefined ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
312
|
+
}, {
|
|
313
|
+
param: 'scw_nats_config',
|
|
314
|
+
value: request.scwNatsConfig !== undefined ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
315
|
+
}])
|
|
316
|
+
});
|
|
317
|
+
const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
318
|
+
cpu_limit: request.cpuLimit,
|
|
319
|
+
description: request.description,
|
|
320
|
+
environment_variables: request.environmentVariables,
|
|
321
|
+
http_option: request.httpOption,
|
|
322
|
+
max_concurrency: request.maxConcurrency,
|
|
323
|
+
max_scale: request.maxScale,
|
|
324
|
+
memory_limit: request.memoryLimit,
|
|
325
|
+
min_scale: request.minScale,
|
|
326
|
+
port: request.port,
|
|
327
|
+
privacy: request.privacy,
|
|
328
|
+
protocol: request.protocol,
|
|
329
|
+
redeploy: request.redeploy,
|
|
330
|
+
registry_image: request.registryImage,
|
|
331
|
+
secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
|
|
332
|
+
timeout: request.timeout
|
|
333
|
+
});
|
|
334
|
+
const marshalUpdateCronRequest = (request, defaults) => ({
|
|
335
|
+
args: request.args,
|
|
336
|
+
container_id: request.containerId,
|
|
337
|
+
name: request.name,
|
|
338
|
+
schedule: request.schedule
|
|
339
|
+
});
|
|
340
|
+
const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
341
|
+
description: request.description,
|
|
342
|
+
environment_variables: request.environmentVariables,
|
|
343
|
+
secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
|
|
344
|
+
});
|
|
345
|
+
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
346
|
+
access_key: request.accessKey,
|
|
347
|
+
secret_key: request.secretKey
|
|
348
|
+
});
|
|
349
|
+
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
350
|
+
description: request.description,
|
|
351
|
+
name: request.name,
|
|
352
|
+
...resolveOneOf([{
|
|
353
|
+
param: 'sqs_config',
|
|
354
|
+
value: request.sqsConfig !== undefined ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
355
|
+
}])
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
export { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
+
|
|
4
|
+
const CreateTriggerRequest = {
|
|
5
|
+
description: {
|
|
6
|
+
maxLength: 255
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
maxLength: 50,
|
|
10
|
+
minLength: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const CreateTriggerRequestMnqNatsClientConfig = {
|
|
14
|
+
mnqRegion: {
|
|
15
|
+
maxLength: 20,
|
|
16
|
+
minLength: 1
|
|
17
|
+
},
|
|
18
|
+
subject: {
|
|
19
|
+
maxLength: 100,
|
|
20
|
+
minLength: 1,
|
|
21
|
+
pattern: /^[^\s]+$/
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const CreateTriggerRequestMnqSqsClientConfig = {
|
|
25
|
+
mnqRegion: {
|
|
26
|
+
maxLength: 20,
|
|
27
|
+
minLength: 1
|
|
28
|
+
},
|
|
29
|
+
queue: {
|
|
30
|
+
maxLength: 100,
|
|
31
|
+
minLength: 1
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const UpdateTriggerRequest = {
|
|
35
|
+
description: {
|
|
36
|
+
maxLength: 255
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
maxLength: 50,
|
|
40
|
+
minLength: 1
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, UpdateTriggerRequest };
|