@scaleway/sdk 2.17.0 → 2.18.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/dist/api/mnq/v1beta1/api.gen.js +3 -3
- package/dist/api/redis/v1/api.gen.js +7 -7
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1beta1/api.gen.js +253 -0
- package/dist/api/secret/v1beta1/index.gen.js +4 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +173 -0
- package/dist/api/vpcgw/v1/api.gen.js +14 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +1 -0
- package/dist/index.cjs +964 -524
- package/dist/index.d.ts +1749 -1116
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ const jsonContentHeaders = {
|
|
|
16
16
|
*/
|
|
17
17
|
class NatsAPI extends API$1 {
|
|
18
18
|
/** Lists the available regions of the API. */
|
|
19
|
-
static LOCALITIES = ['fr-par'];
|
|
19
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Create a NATS account. Create a NATS account associated with a Project.
|
|
@@ -152,7 +152,7 @@ class NatsAPI extends API$1 {
|
|
|
152
152
|
*/
|
|
153
153
|
class SnsAPI extends API$1 {
|
|
154
154
|
/** Lists the available regions of the API. */
|
|
155
|
-
static LOCALITIES = ['fr-par'];
|
|
155
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* Activate SNS. Activate SNS for the specified Project ID. SNS must be
|
|
@@ -274,7 +274,7 @@ class SnsAPI extends API$1 {
|
|
|
274
274
|
*/
|
|
275
275
|
class SqsAPI extends API$1 {
|
|
276
276
|
/** Lists the available regions of the API. */
|
|
277
|
-
static LOCALITIES = ['fr-par'];
|
|
277
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
280
|
* Activate SQS. Activate SQS for the specified Project ID. SQS must be
|
|
@@ -90,13 +90,13 @@ class API extends API$1 {
|
|
|
90
90
|
listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request);
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Scale up a Redis™ Database Instance. Upgrade your
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* scaling horizontally your Redis™ Database Instance will not renew
|
|
98
|
-
* certificate. In order to refresh the TLS certificate, you must use
|
|
99
|
-
* Renew TLS certificate endpoint.
|
|
93
|
+
* Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance,
|
|
94
|
+
* either by upgrading to a bigger node type (vertical scaling) or by adding
|
|
95
|
+
* more nodes to your Database Instance to increase your number of endpoints
|
|
96
|
+
* and distribute cache (horizontal scaling, available for clusters only).
|
|
97
|
+
* Note that scaling horizontally your Redis™ Database Instance will not renew
|
|
98
|
+
* its TLS certificate. In order to refresh the TLS certificate, you must use
|
|
99
|
+
* the Renew TLS certificate endpoint.
|
|
100
100
|
*
|
|
101
101
|
* @param request - The request {@link MigrateClusterRequest}
|
|
102
102
|
* @returns A Promise of Cluster
|
package/dist/api/secret/index.js
CHANGED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalBrowseSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
const jsonContentHeaders = {
|
|
9
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Secret Manager API.
|
|
14
|
+
*
|
|
15
|
+
* This API allows you to conveniently store, access and share sensitive data
|
|
16
|
+
* such as passwords, API keys and certificates.
|
|
17
|
+
*/
|
|
18
|
+
class API extends API$1 {
|
|
19
|
+
/** Lists the available regions of the API. */
|
|
20
|
+
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create a secret. You must specify the `region` to create a secret.
|
|
24
|
+
*
|
|
25
|
+
* @param request - The request {@link CreateSecretRequest}
|
|
26
|
+
* @returns A Promise of Secret
|
|
27
|
+
*/
|
|
28
|
+
createSecret = request => this.client.fetch({
|
|
29
|
+
body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),
|
|
30
|
+
headers: jsonContentHeaders,
|
|
31
|
+
method: 'POST',
|
|
32
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
|
|
33
|
+
}, unmarshalSecret);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get metadata using the secret's ID. Retrieve the metadata of a secret
|
|
37
|
+
* specified by the `region` and `secret_id` parameters.
|
|
38
|
+
*
|
|
39
|
+
* @param request - The request {@link GetSecretRequest}
|
|
40
|
+
* @returns A Promise of Secret
|
|
41
|
+
*/
|
|
42
|
+
getSecret = request => this.client.fetch({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
45
|
+
}, unmarshalSecret);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Update metadata of a secret. Edit a secret's metadata such as name, tag(s),
|
|
49
|
+
* description and ephemeral policy. The secret to update is specified by the
|
|
50
|
+
* `secret_id` and `region` parameters.
|
|
51
|
+
*
|
|
52
|
+
* @param request - The request {@link UpdateSecretRequest}
|
|
53
|
+
* @returns A Promise of Secret
|
|
54
|
+
*/
|
|
55
|
+
updateSecret = request => this.client.fetch({
|
|
56
|
+
body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
|
|
57
|
+
headers: jsonContentHeaders,
|
|
58
|
+
method: 'PATCH',
|
|
59
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
60
|
+
}, unmarshalSecret);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Delete a secret. Delete a given secret specified by the `region` and
|
|
64
|
+
* `secret_id` parameters.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link DeleteSecretRequest}
|
|
67
|
+
*/
|
|
68
|
+
deleteSecret = request => this.client.fetch({
|
|
69
|
+
method: 'DELETE',
|
|
70
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
71
|
+
});
|
|
72
|
+
pageOfListSecrets = (request = {}) => this.client.fetch({
|
|
73
|
+
method: 'GET',
|
|
74
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`,
|
|
75
|
+
urlParams: urlParams(['ephemeral', request.ephemeral], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
|
|
76
|
+
}, unmarshalListSecretsResponse);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* List secrets. Retrieve the list of secrets created within an Organization
|
|
80
|
+
* and/or Project. You must specify either the `organization_id` or the
|
|
81
|
+
* `project_id` and the `region`.
|
|
82
|
+
*
|
|
83
|
+
* @param request - The request {@link ListSecretsRequest}
|
|
84
|
+
* @returns A Promise of ListSecretsResponse
|
|
85
|
+
*/
|
|
86
|
+
listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Browse secrets. Retrieve the list of secrets and folders for the given
|
|
90
|
+
* prefix. You must specify either the `organization_id` or the `project_id`
|
|
91
|
+
* and the `region`.
|
|
92
|
+
*
|
|
93
|
+
* @param request - The request {@link BrowseSecretsRequest}
|
|
94
|
+
* @returns A Promise of BrowseSecretsResponse
|
|
95
|
+
*/
|
|
96
|
+
browseSecrets = request => this.client.fetch({
|
|
97
|
+
method: 'GET',
|
|
98
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,
|
|
99
|
+
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['prefix', request.prefix], ['project_id', request.projectId])
|
|
100
|
+
}, unmarshalBrowseSecretsResponse);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Enable secret protection. Enable secret protection for a given secret
|
|
104
|
+
* specified by the `secret_id` parameter. Enabling secret protection means
|
|
105
|
+
* that your secret can be read and modified, but it cannot be deleted.
|
|
106
|
+
*
|
|
107
|
+
* @param request - The request {@link ProtectSecretRequest}
|
|
108
|
+
* @returns A Promise of Secret
|
|
109
|
+
*/
|
|
110
|
+
protectSecret = request => this.client.fetch({
|
|
111
|
+
body: '{}',
|
|
112
|
+
headers: jsonContentHeaders,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/protect`
|
|
115
|
+
}, unmarshalSecret);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Disable secret protection. Disable secret protection for a given secret
|
|
119
|
+
* specified by the `secret_id` parameter. Disabling secret protection means
|
|
120
|
+
* that your secret can be read, modified and deleted.
|
|
121
|
+
*
|
|
122
|
+
* @param request - The request {@link UnprotectSecretRequest}
|
|
123
|
+
* @returns A Promise of Secret
|
|
124
|
+
*/
|
|
125
|
+
unprotectSecret = request => this.client.fetch({
|
|
126
|
+
body: '{}',
|
|
127
|
+
headers: jsonContentHeaders,
|
|
128
|
+
method: 'POST',
|
|
129
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/unprotect`
|
|
130
|
+
}, unmarshalSecret);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Allow a product to use the secret.
|
|
134
|
+
*
|
|
135
|
+
* @param request - The request {@link AddSecretOwnerRequest}
|
|
136
|
+
*/
|
|
137
|
+
addSecretOwner = request => this.client.fetch({
|
|
138
|
+
body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)),
|
|
139
|
+
headers: jsonContentHeaders,
|
|
140
|
+
method: 'POST',
|
|
141
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Create a version. Create a version of a given secret specified by the
|
|
146
|
+
* `region` and `secret_id` parameters.
|
|
147
|
+
*
|
|
148
|
+
* @param request - The request {@link CreateSecretVersionRequest}
|
|
149
|
+
* @returns A Promise of SecretVersion
|
|
150
|
+
*/
|
|
151
|
+
createSecretVersion = request => this.client.fetch({
|
|
152
|
+
body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),
|
|
153
|
+
headers: jsonContentHeaders,
|
|
154
|
+
method: 'POST',
|
|
155
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`
|
|
156
|
+
}, unmarshalSecretVersion);
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get metadata of a secret's version using the secret's ID. Retrieve the
|
|
160
|
+
* metadata of a secret's given version specified by the `region`, `secret_id`
|
|
161
|
+
* and `revision` parameters.
|
|
162
|
+
*
|
|
163
|
+
* @param request - The request {@link GetSecretVersionRequest}
|
|
164
|
+
* @returns A Promise of SecretVersion
|
|
165
|
+
*/
|
|
166
|
+
getSecretVersion = request => this.client.fetch({
|
|
167
|
+
method: 'GET',
|
|
168
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
169
|
+
}, unmarshalSecretVersion);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Update metadata of a version. Edit the metadata of a secret's given
|
|
173
|
+
* version, specified by the `region`, `secret_id` and `revision` parameters.
|
|
174
|
+
*
|
|
175
|
+
* @param request - The request {@link UpdateSecretVersionRequest}
|
|
176
|
+
* @returns A Promise of SecretVersion
|
|
177
|
+
*/
|
|
178
|
+
updateSecretVersion = request => this.client.fetch({
|
|
179
|
+
body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),
|
|
180
|
+
headers: jsonContentHeaders,
|
|
181
|
+
method: 'PATCH',
|
|
182
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
183
|
+
}, unmarshalSecretVersion);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Delete a version. Delete a secret's version and the sensitive data
|
|
187
|
+
* contained in it. Deleting a version is permanent and cannot be undone.
|
|
188
|
+
*
|
|
189
|
+
* @param request - The request {@link DeleteSecretVersionRequest}
|
|
190
|
+
*/
|
|
191
|
+
deleteSecretVersion = request => this.client.fetch({
|
|
192
|
+
method: 'DELETE',
|
|
193
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
194
|
+
});
|
|
195
|
+
pageOfListSecretVersions = request => this.client.fetch({
|
|
196
|
+
method: 'GET',
|
|
197
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,
|
|
198
|
+
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
|
|
199
|
+
}, unmarshalListSecretVersionsResponse);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* List versions of a secret using the secret's ID. Retrieve the list of a
|
|
203
|
+
* given secret's versions specified by the `secret_id` and `region`
|
|
204
|
+
* parameters.
|
|
205
|
+
*
|
|
206
|
+
* @param request - The request {@link ListSecretVersionsRequest}
|
|
207
|
+
* @returns A Promise of ListSecretVersionsResponse
|
|
208
|
+
*/
|
|
209
|
+
listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request);
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Access a secret's version using the secret's ID. Access sensitive data in a
|
|
213
|
+
* secret's version specified by the `region`, `secret_id` and `revision`
|
|
214
|
+
* parameters.
|
|
215
|
+
*
|
|
216
|
+
* @param request - The request {@link AccessSecretVersionRequest}
|
|
217
|
+
* @returns A Promise of AccessSecretVersionResponse
|
|
218
|
+
*/
|
|
219
|
+
accessSecretVersion = request => this.client.fetch({
|
|
220
|
+
method: 'GET',
|
|
221
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`
|
|
222
|
+
}, unmarshalAccessSecretVersionResponse);
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Enable a version. Make a specific version accessible. You must specify the
|
|
226
|
+
* `region`, `secret_id` and `revision` parameters.
|
|
227
|
+
*
|
|
228
|
+
* @param request - The request {@link EnableSecretVersionRequest}
|
|
229
|
+
* @returns A Promise of SecretVersion
|
|
230
|
+
*/
|
|
231
|
+
enableSecretVersion = request => this.client.fetch({
|
|
232
|
+
body: '{}',
|
|
233
|
+
headers: jsonContentHeaders,
|
|
234
|
+
method: 'POST',
|
|
235
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`
|
|
236
|
+
}, unmarshalSecretVersion);
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Disable a version. Make a specific version inaccessible. You must specify
|
|
240
|
+
* the `region`, `secret_id` and `revision` parameters.
|
|
241
|
+
*
|
|
242
|
+
* @param request - The request {@link DisableSecretVersionRequest}
|
|
243
|
+
* @returns A Promise of SecretVersion
|
|
244
|
+
*/
|
|
245
|
+
disableSecretVersion = request => this.client.fetch({
|
|
246
|
+
body: '{}',
|
|
247
|
+
headers: jsonContentHeaders,
|
|
248
|
+
method: 'POST',
|
|
249
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`
|
|
250
|
+
}, unmarshalSecretVersion);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export { API };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
3
|
+
|
|
4
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
6
|
+
const unmarshalEphemeralProperties = data => {
|
|
7
|
+
if (!isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
action: data.action,
|
|
12
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
13
|
+
expiresOnceAccessed: data.expires_once_accessed
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalSecretVersion = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
createdAt: unmarshalDate(data.created_at),
|
|
22
|
+
description: data.description,
|
|
23
|
+
ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : undefined,
|
|
24
|
+
latest: data.latest,
|
|
25
|
+
revision: data.revision,
|
|
26
|
+
secretId: data.secret_id,
|
|
27
|
+
status: data.status,
|
|
28
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const unmarshalEphemeralPolicy = data => {
|
|
32
|
+
if (!isJSONObject(data)) {
|
|
33
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
action: data.action,
|
|
37
|
+
expiresOnceAccessed: data.expires_once_accessed,
|
|
38
|
+
timeToLive: data.time_to_live
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const unmarshalSecret = data => {
|
|
42
|
+
if (!isJSONObject(data)) {
|
|
43
|
+
throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
createdAt: unmarshalDate(data.created_at),
|
|
47
|
+
description: data.description,
|
|
48
|
+
ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined,
|
|
49
|
+
id: data.id,
|
|
50
|
+
managed: data.managed,
|
|
51
|
+
name: data.name,
|
|
52
|
+
path: data.path,
|
|
53
|
+
projectId: data.project_id,
|
|
54
|
+
protected: data.protected,
|
|
55
|
+
region: data.region,
|
|
56
|
+
status: data.status,
|
|
57
|
+
tags: data.tags,
|
|
58
|
+
type: data.type,
|
|
59
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
60
|
+
versionCount: data.version_count
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const unmarshalAccessSecretVersionResponse = data => {
|
|
64
|
+
if (!isJSONObject(data)) {
|
|
65
|
+
throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
data: data.data,
|
|
69
|
+
dataCrc32: data.data_crc32,
|
|
70
|
+
revision: data.revision,
|
|
71
|
+
secretId: data.secret_id
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const unmarshalBrowseSecretsResponseItemFolderDetails = data => {
|
|
75
|
+
if (!isJSONObject(data)) {
|
|
76
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`);
|
|
77
|
+
}
|
|
78
|
+
return {};
|
|
79
|
+
};
|
|
80
|
+
const unmarshalBrowseSecretsResponseItemSecretDetails = data => {
|
|
81
|
+
if (!isJSONObject(data)) {
|
|
82
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined,
|
|
86
|
+
id: data.id,
|
|
87
|
+
protected: data.protected,
|
|
88
|
+
tags: data.tags,
|
|
89
|
+
versionCount: data.version_count
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const unmarshalBrowseSecretsResponseItem = data => {
|
|
93
|
+
if (!isJSONObject(data)) {
|
|
94
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
createdAt: unmarshalDate(data.created_at),
|
|
98
|
+
folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : undefined,
|
|
99
|
+
name: data.name,
|
|
100
|
+
secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : undefined,
|
|
101
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const unmarshalBrowseSecretsResponse = data => {
|
|
105
|
+
if (!isJSONObject(data)) {
|
|
106
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
currentPath: data.current_path,
|
|
110
|
+
items: unmarshalArrayOfObject(data.items, unmarshalBrowseSecretsResponseItem),
|
|
111
|
+
totalCount: data.total_count
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const unmarshalListSecretVersionsResponse = data => {
|
|
115
|
+
if (!isJSONObject(data)) {
|
|
116
|
+
throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
totalCount: data.total_count,
|
|
120
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const unmarshalListSecretsResponse = data => {
|
|
124
|
+
if (!isJSONObject(data)) {
|
|
125
|
+
throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
129
|
+
totalCount: data.total_count
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
const marshalAddSecretOwnerRequest = (request, defaults) => ({
|
|
133
|
+
product: request.product
|
|
134
|
+
});
|
|
135
|
+
const marshalEphemeralPolicy = (request, defaults) => ({
|
|
136
|
+
action: request.action,
|
|
137
|
+
expires_once_accessed: request.expiresOnceAccessed,
|
|
138
|
+
time_to_live: request.timeToLive
|
|
139
|
+
});
|
|
140
|
+
const marshalCreateSecretRequest = (request, defaults) => ({
|
|
141
|
+
description: request.description,
|
|
142
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
143
|
+
name: request.name,
|
|
144
|
+
path: request.path,
|
|
145
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
146
|
+
protected: request.protected,
|
|
147
|
+
tags: request.tags,
|
|
148
|
+
type: request.type
|
|
149
|
+
});
|
|
150
|
+
const marshalCreateSecretVersionRequest = (request, defaults) => ({
|
|
151
|
+
data: request.data,
|
|
152
|
+
data_crc32: request.dataCrc32,
|
|
153
|
+
description: request.description,
|
|
154
|
+
disable_previous: request.disablePrevious
|
|
155
|
+
});
|
|
156
|
+
const marshalUpdateSecretRequest = (request, defaults) => ({
|
|
157
|
+
description: request.description,
|
|
158
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
159
|
+
name: request.name,
|
|
160
|
+
path: request.path,
|
|
161
|
+
tags: request.tags
|
|
162
|
+
});
|
|
163
|
+
const marshalEphemeralProperties = (request, defaults) => ({
|
|
164
|
+
action: request.action,
|
|
165
|
+
expires_at: request.expiresAt,
|
|
166
|
+
expires_once_accessed: request.expiresOnceAccessed
|
|
167
|
+
});
|
|
168
|
+
const marshalUpdateSecretVersionRequest = (request, defaults) => ({
|
|
169
|
+
description: request.description,
|
|
170
|
+
ephemeral_properties: request.ephemeralProperties !== undefined ? marshalEphemeralProperties(request.ephemeralProperties) : undefined
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
export { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalSecretVersion };
|
|
@@ -110,6 +110,20 @@ class API extends API$1 {
|
|
|
110
110
|
method: 'POST',
|
|
111
111
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`
|
|
112
112
|
}, unmarshalGateway);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP
|
|
116
|
+
* mobility (move from NAT IP to routed IP). This is idempotent: repeated
|
|
117
|
+
* calls after the first will return no error but have no effect.
|
|
118
|
+
*
|
|
119
|
+
* @param request - The request {@link EnableIPMobilityRequest}
|
|
120
|
+
*/
|
|
121
|
+
enableIPMobility = request => this.client.fetch({
|
|
122
|
+
body: '{}',
|
|
123
|
+
headers: jsonContentHeaders,
|
|
124
|
+
method: 'POST',
|
|
125
|
+
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/enable-ip-mobility`
|
|
126
|
+
});
|
|
113
127
|
pageOfListGatewayNetworks = (request = {}) => this.client.fetch({
|
|
114
128
|
method: 'GET',
|
|
115
129
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
|
|
@@ -114,6 +114,7 @@ const unmarshalGateway = data => {
|
|
|
114
114
|
gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
|
|
115
115
|
id: data.id,
|
|
116
116
|
ip: data.ip ? unmarshalIP(data.ip) : undefined,
|
|
117
|
+
ipMobilityEnabled: data.ip_mobility_enabled,
|
|
117
118
|
isLegacy: data.is_legacy,
|
|
118
119
|
name: data.name,
|
|
119
120
|
organizationId: data.organization_id,
|