@scaleway/sdk-iam 2.3.0 → 2.4.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/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1alpha1/api.gen.js +908 -1356
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +79 -77
- package/dist/v1alpha1/marshalling.gen.js +534 -817
- package/dist/v1alpha1/validation-rules.gen.js +265 -325
- package/package.json +4 -4
|
@@ -1,937 +1,654 @@
|
|
|
1
|
+
import { isJSONObject, marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
1
2
|
import randomName from "@scaleway/random-name";
|
|
2
|
-
import { resolveOneOf, marshalBlobToScwFile, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
|
|
3
3
|
const unmarshalJWT = (data) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
jti: data.jti,
|
|
16
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
17
|
-
userAgent: data.user_agent
|
|
18
|
-
};
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JWT' failed as data isn't a dictionary.`);
|
|
5
|
+
return {
|
|
6
|
+
audienceId: data.audience_id,
|
|
7
|
+
createdAt: unmarshalDate(data.created_at),
|
|
8
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
9
|
+
ip: data.ip,
|
|
10
|
+
issuerId: data.issuer_id,
|
|
11
|
+
jti: data.jti,
|
|
12
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
13
|
+
userAgent: data.user_agent
|
|
14
|
+
};
|
|
19
15
|
};
|
|
20
16
|
const unmarshalAPIKey = (data) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
secretKey: data.secret_key,
|
|
38
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
39
|
-
userId: data.user_id
|
|
40
|
-
};
|
|
17
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'APIKey' failed as data isn't a dictionary.`);
|
|
18
|
+
return {
|
|
19
|
+
accessKey: data.access_key,
|
|
20
|
+
applicationId: data.application_id,
|
|
21
|
+
createdAt: unmarshalDate(data.created_at),
|
|
22
|
+
creationIp: data.creation_ip,
|
|
23
|
+
defaultProjectId: data.default_project_id,
|
|
24
|
+
deletable: data.deletable,
|
|
25
|
+
description: data.description,
|
|
26
|
+
editable: data.editable,
|
|
27
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
28
|
+
managed: data.managed,
|
|
29
|
+
secretKey: data.secret_key,
|
|
30
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
31
|
+
userId: data.user_id
|
|
32
|
+
};
|
|
41
33
|
};
|
|
42
34
|
const unmarshalApplication = (data) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
organizationId: data.organization_id,
|
|
58
|
-
tags: data.tags,
|
|
59
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
60
|
-
};
|
|
35
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Application' failed as data isn't a dictionary.`);
|
|
36
|
+
return {
|
|
37
|
+
createdAt: unmarshalDate(data.created_at),
|
|
38
|
+
deletable: data.deletable,
|
|
39
|
+
description: data.description,
|
|
40
|
+
editable: data.editable,
|
|
41
|
+
id: data.id,
|
|
42
|
+
managed: data.managed,
|
|
43
|
+
name: data.name,
|
|
44
|
+
nbApiKeys: data.nb_api_keys,
|
|
45
|
+
organizationId: data.organization_id,
|
|
46
|
+
tags: data.tags,
|
|
47
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
48
|
+
};
|
|
61
49
|
};
|
|
62
50
|
const unmarshalGroup = (data) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
tags: data.tags,
|
|
79
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
80
|
-
userIds: data.user_ids
|
|
81
|
-
};
|
|
51
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Group' failed as data isn't a dictionary.`);
|
|
52
|
+
return {
|
|
53
|
+
applicationIds: data.application_ids,
|
|
54
|
+
createdAt: unmarshalDate(data.created_at),
|
|
55
|
+
deletable: data.deletable,
|
|
56
|
+
description: data.description,
|
|
57
|
+
editable: data.editable,
|
|
58
|
+
id: data.id,
|
|
59
|
+
managed: data.managed,
|
|
60
|
+
name: data.name,
|
|
61
|
+
organizationId: data.organization_id,
|
|
62
|
+
tags: data.tags,
|
|
63
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
64
|
+
userIds: data.user_ids
|
|
65
|
+
};
|
|
82
66
|
};
|
|
83
67
|
const unmarshalLog = (data) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
resourceId: data.resource_id,
|
|
97
|
-
resourceType: data.resource_type,
|
|
98
|
-
userAgent: data.user_agent
|
|
99
|
-
};
|
|
68
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
|
|
69
|
+
return {
|
|
70
|
+
action: data.action,
|
|
71
|
+
bearerId: data.bearer_id,
|
|
72
|
+
createdAt: unmarshalDate(data.created_at),
|
|
73
|
+
id: data.id,
|
|
74
|
+
ip: data.ip,
|
|
75
|
+
organizationId: data.organization_id,
|
|
76
|
+
resourceId: data.resource_id,
|
|
77
|
+
resourceType: data.resource_type,
|
|
78
|
+
userAgent: data.user_agent
|
|
79
|
+
};
|
|
100
80
|
};
|
|
101
81
|
const unmarshalPolicy = (data) => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
global: data.global,
|
|
135
|
-
limit: data.limit,
|
|
136
|
-
region: data.region,
|
|
137
|
-
unlimited: data.unlimited,
|
|
138
|
-
zone: data.zone
|
|
139
|
-
};
|
|
82
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Policy' failed as data isn't a dictionary.`);
|
|
83
|
+
return {
|
|
84
|
+
applicationId: data.application_id,
|
|
85
|
+
createdAt: unmarshalDate(data.created_at),
|
|
86
|
+
deletable: data.deletable,
|
|
87
|
+
description: data.description,
|
|
88
|
+
editable: data.editable,
|
|
89
|
+
groupId: data.group_id,
|
|
90
|
+
id: data.id,
|
|
91
|
+
managed: data.managed,
|
|
92
|
+
name: data.name,
|
|
93
|
+
nbPermissionSets: data.nb_permission_sets,
|
|
94
|
+
nbRules: data.nb_rules,
|
|
95
|
+
nbScopes: data.nb_scopes,
|
|
96
|
+
noPrincipal: data.no_principal,
|
|
97
|
+
organizationId: data.organization_id,
|
|
98
|
+
tags: data.tags,
|
|
99
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
100
|
+
userId: data.user_id
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
var unmarshalQuotumLimit = (data) => {
|
|
104
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'QuotumLimit' failed as data isn't a dictionary.`);
|
|
105
|
+
return {
|
|
106
|
+
global: data.global,
|
|
107
|
+
limit: data.limit,
|
|
108
|
+
region: data.region,
|
|
109
|
+
unlimited: data.unlimited,
|
|
110
|
+
zone: data.zone
|
|
111
|
+
};
|
|
140
112
|
};
|
|
141
113
|
const unmarshalQuotum = (data) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
prettyName: data.pretty_name,
|
|
154
|
-
unit: data.unit,
|
|
155
|
-
unlimited: data.unlimited
|
|
156
|
-
};
|
|
114
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`);
|
|
115
|
+
return {
|
|
116
|
+
description: data.description,
|
|
117
|
+
limit: data.limit,
|
|
118
|
+
limits: unmarshalArrayOfObject(data.limits, unmarshalQuotumLimit),
|
|
119
|
+
localityType: data.locality_type,
|
|
120
|
+
name: data.name,
|
|
121
|
+
prettyName: data.pretty_name,
|
|
122
|
+
unit: data.unit,
|
|
123
|
+
unlimited: data.unlimited
|
|
124
|
+
};
|
|
157
125
|
};
|
|
158
126
|
const unmarshalSSHKey = (data) => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
projectId: data.project_id,
|
|
172
|
-
publicKey: data.public_key,
|
|
173
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
174
|
-
};
|
|
127
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`);
|
|
128
|
+
return {
|
|
129
|
+
createdAt: unmarshalDate(data.created_at),
|
|
130
|
+
disabled: data.disabled,
|
|
131
|
+
fingerprint: data.fingerprint,
|
|
132
|
+
id: data.id,
|
|
133
|
+
name: data.name,
|
|
134
|
+
organizationId: data.organization_id,
|
|
135
|
+
projectId: data.project_id,
|
|
136
|
+
publicKey: data.public_key,
|
|
137
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
138
|
+
};
|
|
175
139
|
};
|
|
176
140
|
const unmarshalSamlCertificate = (data) => {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
id: data.id,
|
|
186
|
-
origin: data.origin,
|
|
187
|
-
type: data.type
|
|
188
|
-
};
|
|
141
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SamlCertificate' failed as data isn't a dictionary.`);
|
|
142
|
+
return {
|
|
143
|
+
content: data.content,
|
|
144
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
145
|
+
id: data.id,
|
|
146
|
+
origin: data.origin,
|
|
147
|
+
type: data.type
|
|
148
|
+
};
|
|
189
149
|
};
|
|
190
150
|
const unmarshalWebAuthnAuthenticator = (data) => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
id: data.id,
|
|
199
|
-
lastLoginAt: unmarshalDate(data.last_login_at),
|
|
200
|
-
name: data.name
|
|
201
|
-
};
|
|
151
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'WebAuthnAuthenticator' failed as data isn't a dictionary.`);
|
|
152
|
+
return {
|
|
153
|
+
createdAt: unmarshalDate(data.created_at),
|
|
154
|
+
id: data.id,
|
|
155
|
+
lastLoginAt: unmarshalDate(data.last_login_at),
|
|
156
|
+
name: data.name
|
|
157
|
+
};
|
|
202
158
|
};
|
|
203
159
|
const unmarshalUser = (data) => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
return {
|
|
238
|
-
createdAt: unmarshalDate(data.created_at),
|
|
239
|
-
expiresAt: unmarshalDate(data.expires_at),
|
|
240
|
-
id: data.id,
|
|
241
|
-
scimId: data.scim_id
|
|
242
|
-
};
|
|
160
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
|
|
161
|
+
return {
|
|
162
|
+
accountRootUserId: data.account_root_user_id,
|
|
163
|
+
createdAt: unmarshalDate(data.created_at),
|
|
164
|
+
deletable: data.deletable,
|
|
165
|
+
email: data.email,
|
|
166
|
+
firstName: data.first_name,
|
|
167
|
+
id: data.id,
|
|
168
|
+
lastLoginAt: unmarshalDate(data.last_login_at),
|
|
169
|
+
lastName: data.last_name,
|
|
170
|
+
locale: data.locale,
|
|
171
|
+
locked: data.locked,
|
|
172
|
+
mfa: data.mfa,
|
|
173
|
+
organizationId: data.organization_id,
|
|
174
|
+
phoneNumber: data.phone_number,
|
|
175
|
+
status: data.status ? data.status : void 0,
|
|
176
|
+
tags: data.tags,
|
|
177
|
+
twoFactorEnabled: data.two_factor_enabled,
|
|
178
|
+
type: data.type,
|
|
179
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
180
|
+
username: data.username
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
var unmarshalScimToken = (data) => {
|
|
184
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScimToken' failed as data isn't a dictionary.`);
|
|
185
|
+
return {
|
|
186
|
+
createdAt: unmarshalDate(data.created_at),
|
|
187
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
188
|
+
id: data.id,
|
|
189
|
+
scimId: data.scim_id
|
|
190
|
+
};
|
|
243
191
|
};
|
|
244
192
|
const unmarshalCreateScimTokenResponse = (data) => {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return {
|
|
251
|
-
bearerToken: data.bearer_token,
|
|
252
|
-
token: data.token ? unmarshalScimToken(data.token) : void 0
|
|
253
|
-
};
|
|
193
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateScimTokenResponse' failed as data isn't a dictionary.`);
|
|
194
|
+
return {
|
|
195
|
+
bearerToken: data.bearer_token,
|
|
196
|
+
token: data.token ? unmarshalScimToken(data.token) : void 0
|
|
197
|
+
};
|
|
254
198
|
};
|
|
255
199
|
const unmarshalEncodedJWT = (data) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
jwt: data.jwt ? unmarshalJWT(data.jwt) : void 0,
|
|
263
|
-
renewToken: data.renew_token,
|
|
264
|
-
token: data.token
|
|
265
|
-
};
|
|
200
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EncodedJWT' failed as data isn't a dictionary.`);
|
|
201
|
+
return {
|
|
202
|
+
jwt: data.jwt ? unmarshalJWT(data.jwt) : void 0,
|
|
203
|
+
renewToken: data.renew_token,
|
|
204
|
+
token: data.token
|
|
205
|
+
};
|
|
266
206
|
};
|
|
267
207
|
const unmarshalFinishUserWebAuthnRegistrationResponse = (data) => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
return {
|
|
296
|
-
id: data.id,
|
|
297
|
-
type: data.type,
|
|
298
|
-
username: data.username
|
|
299
|
-
};
|
|
300
|
-
};
|
|
301
|
-
const unmarshalConnection = (data) => {
|
|
302
|
-
if (!isJSONObject(data)) {
|
|
303
|
-
throw new TypeError(
|
|
304
|
-
`Unmarshalling the type 'Connection' failed as data isn't a dictionary.`
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
organization: data.organization ? unmarshalConnectionConnectedOrganization(data.organization) : void 0,
|
|
309
|
-
user: data.user ? unmarshalConnectionConnectedUser(data.user) : void 0
|
|
310
|
-
};
|
|
208
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'FinishUserWebAuthnRegistrationResponse' failed as data isn't a dictionary.`);
|
|
209
|
+
return { authenticatorId: data.authenticator_id };
|
|
210
|
+
};
|
|
211
|
+
var unmarshalConnectionConnectedOrganization = (data) => {
|
|
212
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ConnectionConnectedOrganization' failed as data isn't a dictionary.`);
|
|
213
|
+
return {
|
|
214
|
+
id: data.id,
|
|
215
|
+
locked: data.locked,
|
|
216
|
+
name: data.name
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
var unmarshalConnectionConnectedUser = (data) => {
|
|
220
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ConnectionConnectedUser' failed as data isn't a dictionary.`);
|
|
221
|
+
return {
|
|
222
|
+
id: data.id,
|
|
223
|
+
type: data.type,
|
|
224
|
+
username: data.username
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
var unmarshalConnection = (data) => {
|
|
228
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Connection' failed as data isn't a dictionary.`);
|
|
229
|
+
return {
|
|
230
|
+
organization: data.organization ? unmarshalConnectionConnectedOrganization(data.organization) : void 0,
|
|
231
|
+
user: data.user ? unmarshalConnectionConnectedUser(data.user) : void 0
|
|
232
|
+
};
|
|
311
233
|
};
|
|
312
234
|
const unmarshalGetUserConnectionsResponse = (data) => {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
`Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary.`
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
return {
|
|
319
|
-
connections: unmarshalArrayOfObject(data.connections, unmarshalConnection)
|
|
320
|
-
};
|
|
235
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary.`);
|
|
236
|
+
return { connections: unmarshalArrayOfObject(data.connections, unmarshalConnection) };
|
|
321
237
|
};
|
|
322
238
|
const unmarshalInitiateUserConnectionResponse = (data) => {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
`Unmarshalling the type 'InitiateUserConnectionResponse' failed as data isn't a dictionary.`
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
token: data.token
|
|
330
|
-
};
|
|
239
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InitiateUserConnectionResponse' failed as data isn't a dictionary.`);
|
|
240
|
+
return { token: data.token };
|
|
331
241
|
};
|
|
332
242
|
const unmarshalListAPIKeysResponse = (data) => {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
return {
|
|
339
|
-
apiKeys: unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey),
|
|
340
|
-
totalCount: data.total_count
|
|
341
|
-
};
|
|
243
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`);
|
|
244
|
+
return {
|
|
245
|
+
apiKeys: unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey),
|
|
246
|
+
totalCount: data.total_count
|
|
247
|
+
};
|
|
342
248
|
};
|
|
343
249
|
const unmarshalListApplicationsResponse = (data) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
};
|
|
357
|
-
const unmarshalGracePeriod = (data) => {
|
|
358
|
-
if (!isJSONObject(data)) {
|
|
359
|
-
throw new TypeError(
|
|
360
|
-
`Unmarshalling the type 'GracePeriod' failed as data isn't a dictionary.`
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
return {
|
|
364
|
-
createdAt: unmarshalDate(data.created_at),
|
|
365
|
-
expiresAt: unmarshalDate(data.expires_at),
|
|
366
|
-
type: data.type
|
|
367
|
-
};
|
|
250
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`);
|
|
251
|
+
return {
|
|
252
|
+
applications: unmarshalArrayOfObject(data.applications, unmarshalApplication),
|
|
253
|
+
totalCount: data.total_count
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
var unmarshalGracePeriod = (data) => {
|
|
257
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GracePeriod' failed as data isn't a dictionary.`);
|
|
258
|
+
return {
|
|
259
|
+
createdAt: unmarshalDate(data.created_at),
|
|
260
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
261
|
+
type: data.type
|
|
262
|
+
};
|
|
368
263
|
};
|
|
369
264
|
const unmarshalListGracePeriodsResponse = (data) => {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
`Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
return {
|
|
376
|
-
gracePeriods: unmarshalArrayOfObject(
|
|
377
|
-
data.grace_periods,
|
|
378
|
-
unmarshalGracePeriod
|
|
379
|
-
)
|
|
380
|
-
};
|
|
265
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`);
|
|
266
|
+
return { gracePeriods: unmarshalArrayOfObject(data.grace_periods, unmarshalGracePeriod) };
|
|
381
267
|
};
|
|
382
268
|
const unmarshalListGroupsResponse = (data) => {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return {
|
|
389
|
-
groups: unmarshalArrayOfObject(data.groups, unmarshalGroup),
|
|
390
|
-
totalCount: data.total_count
|
|
391
|
-
};
|
|
269
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`);
|
|
270
|
+
return {
|
|
271
|
+
groups: unmarshalArrayOfObject(data.groups, unmarshalGroup),
|
|
272
|
+
totalCount: data.total_count
|
|
273
|
+
};
|
|
392
274
|
};
|
|
393
275
|
const unmarshalListJWTsResponse = (data) => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
return {
|
|
400
|
-
jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT),
|
|
401
|
-
totalCount: data.total_count
|
|
402
|
-
};
|
|
276
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`);
|
|
277
|
+
return {
|
|
278
|
+
jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT),
|
|
279
|
+
totalCount: data.total_count
|
|
280
|
+
};
|
|
403
281
|
};
|
|
404
282
|
const unmarshalListLogsResponse = (data) => {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
return {
|
|
422
|
-
categories: data.categories,
|
|
423
|
-
description: data.description,
|
|
424
|
-
id: data.id,
|
|
425
|
-
name: data.name,
|
|
426
|
-
scopeType: data.scope_type
|
|
427
|
-
};
|
|
283
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
|
|
284
|
+
return {
|
|
285
|
+
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
|
|
286
|
+
totalCount: data.total_count
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
var unmarshalPermissionSet = (data) => {
|
|
290
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`);
|
|
291
|
+
return {
|
|
292
|
+
categories: data.categories,
|
|
293
|
+
description: data.description,
|
|
294
|
+
id: data.id,
|
|
295
|
+
name: data.name,
|
|
296
|
+
scopeType: data.scope_type
|
|
297
|
+
};
|
|
428
298
|
};
|
|
429
299
|
const unmarshalListPermissionSetsResponse = (data) => {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return {
|
|
436
|
-
permissionSets: unmarshalArrayOfObject(
|
|
437
|
-
data.permission_sets,
|
|
438
|
-
unmarshalPermissionSet
|
|
439
|
-
),
|
|
440
|
-
totalCount: data.total_count
|
|
441
|
-
};
|
|
300
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`);
|
|
301
|
+
return {
|
|
302
|
+
permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet),
|
|
303
|
+
totalCount: data.total_count
|
|
304
|
+
};
|
|
442
305
|
};
|
|
443
306
|
const unmarshalListPoliciesResponse = (data) => {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return {
|
|
450
|
-
policies: unmarshalArrayOfObject(data.policies, unmarshalPolicy),
|
|
451
|
-
totalCount: data.total_count
|
|
452
|
-
};
|
|
307
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`);
|
|
308
|
+
return {
|
|
309
|
+
policies: unmarshalArrayOfObject(data.policies, unmarshalPolicy),
|
|
310
|
+
totalCount: data.total_count
|
|
311
|
+
};
|
|
453
312
|
};
|
|
454
313
|
const unmarshalListQuotaResponse = (data) => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
accountRootUserId: data.account_root_user_id,
|
|
473
|
-
condition: data.condition,
|
|
474
|
-
id: data.id,
|
|
475
|
-
organizationId: data.organization_id,
|
|
476
|
-
permissionSetNames: data.permission_set_names,
|
|
477
|
-
permissionSetsScopeType: data.permission_sets_scope_type,
|
|
478
|
-
projectIds: data.project_ids
|
|
479
|
-
};
|
|
314
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`);
|
|
315
|
+
return {
|
|
316
|
+
quota: unmarshalArrayOfObject(data.quota, unmarshalQuotum),
|
|
317
|
+
totalCount: data.total_count
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
var unmarshalRule = (data) => {
|
|
321
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`);
|
|
322
|
+
return {
|
|
323
|
+
accountRootUserId: data.account_root_user_id,
|
|
324
|
+
condition: data.condition,
|
|
325
|
+
id: data.id,
|
|
326
|
+
organizationId: data.organization_id,
|
|
327
|
+
permissionSetNames: data.permission_set_names,
|
|
328
|
+
permissionSetsScopeType: data.permission_sets_scope_type,
|
|
329
|
+
projectIds: data.project_ids
|
|
330
|
+
};
|
|
480
331
|
};
|
|
481
332
|
const unmarshalListRulesResponse = (data) => {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
return {
|
|
488
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalRule),
|
|
489
|
-
totalCount: data.total_count
|
|
490
|
-
};
|
|
333
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`);
|
|
334
|
+
return {
|
|
335
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalRule),
|
|
336
|
+
totalCount: data.total_count
|
|
337
|
+
};
|
|
491
338
|
};
|
|
492
339
|
const unmarshalListSSHKeysResponse = (data) => {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return {
|
|
499
|
-
sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),
|
|
500
|
-
totalCount: data.total_count
|
|
501
|
-
};
|
|
340
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`);
|
|
341
|
+
return {
|
|
342
|
+
sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),
|
|
343
|
+
totalCount: data.total_count
|
|
344
|
+
};
|
|
502
345
|
};
|
|
503
346
|
const unmarshalListSamlCertificatesResponse = (data) => {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
`Unmarshalling the type 'ListSamlCertificatesResponse' failed as data isn't a dictionary.`
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
return {
|
|
510
|
-
certificates: unmarshalArrayOfObject(
|
|
511
|
-
data.certificates,
|
|
512
|
-
unmarshalSamlCertificate
|
|
513
|
-
)
|
|
514
|
-
};
|
|
347
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSamlCertificatesResponse' failed as data isn't a dictionary.`);
|
|
348
|
+
return { certificates: unmarshalArrayOfObject(data.certificates, unmarshalSamlCertificate) };
|
|
515
349
|
};
|
|
516
350
|
const unmarshalListScimTokensResponse = (data) => {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
return {
|
|
523
|
-
scimTokens: unmarshalArrayOfObject(data.scim_tokens, unmarshalScimToken),
|
|
524
|
-
totalCount: data.total_count
|
|
525
|
-
};
|
|
351
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListScimTokensResponse' failed as data isn't a dictionary.`);
|
|
352
|
+
return {
|
|
353
|
+
scimTokens: unmarshalArrayOfObject(data.scim_tokens, unmarshalScimToken),
|
|
354
|
+
totalCount: data.total_count
|
|
355
|
+
};
|
|
526
356
|
};
|
|
527
357
|
const unmarshalListUserWebAuthnAuthenticatorsResponse = (data) => {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
return {
|
|
534
|
-
authenticators: unmarshalArrayOfObject(
|
|
535
|
-
data.authenticators,
|
|
536
|
-
unmarshalWebAuthnAuthenticator
|
|
537
|
-
),
|
|
538
|
-
totalCount: data.total_count
|
|
539
|
-
};
|
|
358
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUserWebAuthnAuthenticatorsResponse' failed as data isn't a dictionary.`);
|
|
359
|
+
return {
|
|
360
|
+
authenticators: unmarshalArrayOfObject(data.authenticators, unmarshalWebAuthnAuthenticator),
|
|
361
|
+
totalCount: data.total_count
|
|
362
|
+
};
|
|
540
363
|
};
|
|
541
364
|
const unmarshalListUsersResponse = (data) => {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
return {
|
|
548
|
-
totalCount: data.total_count,
|
|
549
|
-
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
550
|
-
};
|
|
365
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
|
|
366
|
+
return {
|
|
367
|
+
totalCount: data.total_count,
|
|
368
|
+
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
369
|
+
};
|
|
551
370
|
};
|
|
552
371
|
const unmarshalMFAOTP = (data) => {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
`Unmarshalling the type 'MFAOTP' failed as data isn't a dictionary.`
|
|
556
|
-
);
|
|
557
|
-
}
|
|
558
|
-
return {
|
|
559
|
-
secret: data.secret
|
|
560
|
-
};
|
|
372
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'MFAOTP' failed as data isn't a dictionary.`);
|
|
373
|
+
return { secret: data.secret };
|
|
561
374
|
};
|
|
562
375
|
const unmarshalOrganization = (data) => {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
loginPasswordEnabled: data.login_password_enabled,
|
|
574
|
-
loginSamlEnabled: data.login_saml_enabled,
|
|
575
|
-
name: data.name
|
|
576
|
-
};
|
|
376
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`);
|
|
377
|
+
return {
|
|
378
|
+
alias: data.alias,
|
|
379
|
+
id: data.id,
|
|
380
|
+
loginMagicCodeEnabled: data.login_magic_code_enabled,
|
|
381
|
+
loginOauth2Enabled: data.login_oauth2_enabled,
|
|
382
|
+
loginPasswordEnabled: data.login_password_enabled,
|
|
383
|
+
loginSamlEnabled: data.login_saml_enabled,
|
|
384
|
+
name: data.name
|
|
385
|
+
};
|
|
577
386
|
};
|
|
578
387
|
const unmarshalOrganizationSecuritySettings = (data) => {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
loginAttemptsBeforeLocked: data.login_attempts_before_locked,
|
|
588
|
-
maxApiKeyExpirationDuration: data.max_api_key_expiration_duration,
|
|
589
|
-
maxLoginSessionDuration: data.max_login_session_duration
|
|
590
|
-
};
|
|
388
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OrganizationSecuritySettings' failed as data isn't a dictionary.`);
|
|
389
|
+
return {
|
|
390
|
+
enforcePasswordRenewal: data.enforce_password_renewal,
|
|
391
|
+
gracePeriodDuration: data.grace_period_duration,
|
|
392
|
+
loginAttemptsBeforeLocked: data.login_attempts_before_locked,
|
|
393
|
+
maxApiKeyExpirationDuration: data.max_api_key_expiration_duration,
|
|
394
|
+
maxLoginSessionDuration: data.max_login_session_duration
|
|
395
|
+
};
|
|
591
396
|
};
|
|
592
397
|
const unmarshalParseSamlMetadataResponse = (data) => {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
throw new TypeError(
|
|
607
|
-
`Unmarshalling the type 'SamlServiceProvider' failed as data isn't a dictionary.`
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
return {
|
|
611
|
-
assertionConsumerServiceUrl: data.assertion_consumer_service_url,
|
|
612
|
-
entityId: data.entity_id
|
|
613
|
-
};
|
|
398
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ParseSamlMetadataResponse' failed as data isn't a dictionary.`);
|
|
399
|
+
return {
|
|
400
|
+
entityId: data.entity_id,
|
|
401
|
+
signingCertificates: data.signing_certificates,
|
|
402
|
+
singleSignOnUrl: data.single_sign_on_url
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
var unmarshalSamlServiceProvider = (data) => {
|
|
406
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SamlServiceProvider' failed as data isn't a dictionary.`);
|
|
407
|
+
return {
|
|
408
|
+
assertionConsumerServiceUrl: data.assertion_consumer_service_url,
|
|
409
|
+
entityId: data.entity_id
|
|
410
|
+
};
|
|
614
411
|
};
|
|
615
412
|
const unmarshalSaml = (data) => {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
serviceProvider: data.service_provider ? unmarshalSamlServiceProvider(data.service_provider) : void 0,
|
|
625
|
-
singleSignOnUrl: data.single_sign_on_url,
|
|
626
|
-
status: data.status
|
|
627
|
-
};
|
|
413
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Saml' failed as data isn't a dictionary.`);
|
|
414
|
+
return {
|
|
415
|
+
entityId: data.entity_id,
|
|
416
|
+
id: data.id,
|
|
417
|
+
serviceProvider: data.service_provider ? unmarshalSamlServiceProvider(data.service_provider) : void 0,
|
|
418
|
+
singleSignOnUrl: data.single_sign_on_url,
|
|
419
|
+
status: data.status
|
|
420
|
+
};
|
|
628
421
|
};
|
|
629
422
|
const unmarshalScim = (data) => {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return {
|
|
636
|
-
createdAt: unmarshalDate(data.created_at),
|
|
637
|
-
id: data.id
|
|
638
|
-
};
|
|
423
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Scim' failed as data isn't a dictionary.`);
|
|
424
|
+
return {
|
|
425
|
+
createdAt: unmarshalDate(data.created_at),
|
|
426
|
+
id: data.id
|
|
427
|
+
};
|
|
639
428
|
};
|
|
640
429
|
const unmarshalSetRulesResponse = (data) => {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
`Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
|
-
return {
|
|
647
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalRule)
|
|
648
|
-
};
|
|
430
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`);
|
|
431
|
+
return { rules: unmarshalArrayOfObject(data.rules, unmarshalRule) };
|
|
649
432
|
};
|
|
650
433
|
const unmarshalStartUserWebAuthnRegistrationResponse = (data) => {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
excludeCredentials: data.exclude_credentials,
|
|
660
|
-
publicKeyAlgorithms: data.public_key_algorithms,
|
|
661
|
-
timeout: data.timeout
|
|
662
|
-
};
|
|
434
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartUserWebAuthnRegistrationResponse' failed as data isn't a dictionary.`);
|
|
435
|
+
return {
|
|
436
|
+
ceremonyId: data.ceremony_id,
|
|
437
|
+
challenge: data.challenge,
|
|
438
|
+
excludeCredentials: data.exclude_credentials,
|
|
439
|
+
publicKeyAlgorithms: data.public_key_algorithms,
|
|
440
|
+
timeout: data.timeout
|
|
441
|
+
};
|
|
663
442
|
};
|
|
664
443
|
const unmarshalValidateUserMFAOTPResponse = (data) => {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
...resolveOneOf([
|
|
676
|
-
{ param: "user_id", value: request.userId },
|
|
677
|
-
{ param: "application_id", value: request.applicationId }
|
|
678
|
-
])
|
|
679
|
-
});
|
|
444
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ValidateUserMFAOTPResponse' failed as data isn't a dictionary.`);
|
|
445
|
+
return { recoveryCodes: data.recovery_codes };
|
|
446
|
+
};
|
|
447
|
+
const marshalAddGroupMemberRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
448
|
+
param: "user_id",
|
|
449
|
+
value: request.userId
|
|
450
|
+
}, {
|
|
451
|
+
param: "application_id",
|
|
452
|
+
value: request.applicationId
|
|
453
|
+
}]) });
|
|
680
454
|
const marshalAddGroupMembersRequest = (request, defaults) => ({
|
|
681
|
-
|
|
682
|
-
|
|
455
|
+
application_ids: request.applicationIds,
|
|
456
|
+
user_ids: request.userIds
|
|
683
457
|
});
|
|
684
458
|
const marshalAddSamlCertificateRequest = (request, defaults) => ({
|
|
685
|
-
|
|
686
|
-
|
|
459
|
+
content: request.content,
|
|
460
|
+
type: request.type
|
|
687
461
|
});
|
|
688
462
|
const marshalCreateAPIKeyRequest = (request, defaults) => ({
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
463
|
+
default_project_id: request.defaultProjectId,
|
|
464
|
+
description: request.description,
|
|
465
|
+
expires_at: request.expiresAt,
|
|
466
|
+
...resolveOneOf([{
|
|
467
|
+
param: "application_id",
|
|
468
|
+
value: request.applicationId
|
|
469
|
+
}, {
|
|
470
|
+
param: "user_id",
|
|
471
|
+
value: request.userId
|
|
472
|
+
}])
|
|
696
473
|
});
|
|
697
474
|
const marshalCreateApplicationRequest = (request, defaults) => ({
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
475
|
+
description: request.description,
|
|
476
|
+
name: request.name || randomName("app"),
|
|
477
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
|
|
478
|
+
tags: request.tags
|
|
702
479
|
});
|
|
703
480
|
const marshalCreateGroupRequest = (request, defaults) => ({
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
481
|
+
description: request.description,
|
|
482
|
+
name: request.name || randomName("grp"),
|
|
483
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
|
|
484
|
+
tags: request.tags
|
|
708
485
|
});
|
|
709
486
|
const marshalCreateJWTRequest = (request, defaults) => ({
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
487
|
+
referrer: request.referrer,
|
|
488
|
+
user_id: request.userId
|
|
489
|
+
});
|
|
490
|
+
var marshalRuleSpecs = (request, defaults) => ({
|
|
491
|
+
condition: request.condition,
|
|
492
|
+
permission_set_names: request.permissionSetNames,
|
|
493
|
+
...resolveOneOf([{
|
|
494
|
+
param: "project_ids",
|
|
495
|
+
value: request.projectIds
|
|
496
|
+
}, {
|
|
497
|
+
param: "organization_id",
|
|
498
|
+
value: request.organizationId
|
|
499
|
+
}])
|
|
720
500
|
});
|
|
721
501
|
const marshalCreatePolicyRequest = (request, defaults) => ({
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
502
|
+
description: request.description,
|
|
503
|
+
name: request.name || randomName("pol"),
|
|
504
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
|
|
505
|
+
rules: request.rules !== void 0 ? request.rules.map((elt) => marshalRuleSpecs(elt, defaults)) : void 0,
|
|
506
|
+
tags: request.tags,
|
|
507
|
+
...resolveOneOf([
|
|
508
|
+
{
|
|
509
|
+
param: "user_id",
|
|
510
|
+
value: request.userId
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
param: "group_id",
|
|
514
|
+
value: request.groupId
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
param: "application_id",
|
|
518
|
+
value: request.applicationId
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
param: "no_principal",
|
|
522
|
+
value: request.noPrincipal
|
|
523
|
+
}
|
|
524
|
+
])
|
|
733
525
|
});
|
|
734
526
|
const marshalCreateSSHKeyRequest = (request, defaults) => ({
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
});
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
527
|
+
name: request.name || randomName("key"),
|
|
528
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
529
|
+
public_key: request.publicKey
|
|
530
|
+
});
|
|
531
|
+
var marshalCreateUserRequestMember = (request, defaults) => ({
|
|
532
|
+
email: request.email,
|
|
533
|
+
first_name: request.firstName,
|
|
534
|
+
last_name: request.lastName,
|
|
535
|
+
locale: request.locale,
|
|
536
|
+
password: request.password,
|
|
537
|
+
phone_number: request.phoneNumber,
|
|
538
|
+
send_password_email: request.sendPasswordEmail,
|
|
539
|
+
send_welcome_email: request.sendWelcomeEmail,
|
|
540
|
+
username: request.username
|
|
749
541
|
});
|
|
750
542
|
const marshalCreateUserRequest = (request, defaults) => ({
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
543
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
|
|
544
|
+
tags: request.tags,
|
|
545
|
+
...resolveOneOf([{
|
|
546
|
+
param: "email",
|
|
547
|
+
value: request.email
|
|
548
|
+
}, {
|
|
549
|
+
param: "member",
|
|
550
|
+
value: request.member !== void 0 ? marshalCreateUserRequestMember(request.member, defaults) : void 0
|
|
551
|
+
}])
|
|
760
552
|
});
|
|
761
553
|
const marshalFinishUserWebAuthnRegistrationRequest = (request, defaults) => ({
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
});
|
|
772
|
-
const marshalJoinUserConnectionRequest = (request, defaults) => ({
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
])
|
|
783
|
-
});
|
|
784
|
-
const marshalRemoveUserConnectionRequest = (request, defaults) => ({
|
|
785
|
-
target_user_id: request.targetUserId
|
|
786
|
-
});
|
|
554
|
+
attestation_object: request.attestationObject,
|
|
555
|
+
authenticator_data: request.authenticatorData,
|
|
556
|
+
authenticator_name: request.authenticatorName,
|
|
557
|
+
ceremony_id: request.ceremonyId,
|
|
558
|
+
client_data_json: request.clientDataJson,
|
|
559
|
+
origin: request.origin,
|
|
560
|
+
public_key: request.publicKey,
|
|
561
|
+
public_key_algorithm: request.publicKeyAlgorithm,
|
|
562
|
+
raw_id: request.rawId
|
|
563
|
+
});
|
|
564
|
+
const marshalJoinUserConnectionRequest = (request, defaults) => ({ token: request.token });
|
|
565
|
+
const marshalParseSamlMetadataRequest = async (request, defaults) => ({ file: await marshalBlobToScwFile(request.file) });
|
|
566
|
+
const marshalRemoveGroupMemberRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
567
|
+
param: "user_id",
|
|
568
|
+
value: request.userId
|
|
569
|
+
}, {
|
|
570
|
+
param: "application_id",
|
|
571
|
+
value: request.applicationId
|
|
572
|
+
}]) });
|
|
573
|
+
const marshalRemoveUserConnectionRequest = (request, defaults) => ({ target_user_id: request.targetUserId });
|
|
787
574
|
const marshalSetGroupMembersRequest = (request, defaults) => ({
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
});
|
|
791
|
-
const marshalSetOrganizationAliasRequest = (request, defaults) => ({
|
|
792
|
-
alias: request.alias
|
|
575
|
+
application_ids: request.applicationIds,
|
|
576
|
+
user_ids: request.userIds
|
|
793
577
|
});
|
|
578
|
+
const marshalSetOrganizationAliasRequest = (request, defaults) => ({ alias: request.alias });
|
|
794
579
|
const marshalSetRulesRequest = (request, defaults) => ({
|
|
795
|
-
|
|
796
|
-
|
|
580
|
+
policy_id: request.policyId,
|
|
581
|
+
rules: request.rules.map((elt) => marshalRuleSpecs(elt, defaults))
|
|
797
582
|
});
|
|
798
583
|
const marshalUpdateAPIKeyRequest = (request, defaults) => ({
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
584
|
+
default_project_id: request.defaultProjectId,
|
|
585
|
+
description: request.description,
|
|
586
|
+
expires_at: request.expiresAt
|
|
802
587
|
});
|
|
803
588
|
const marshalUpdateApplicationRequest = (request, defaults) => ({
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
589
|
+
description: request.description,
|
|
590
|
+
name: request.name,
|
|
591
|
+
tags: request.tags
|
|
807
592
|
});
|
|
808
593
|
const marshalUpdateGroupRequest = (request, defaults) => ({
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
594
|
+
description: request.description,
|
|
595
|
+
name: request.name,
|
|
596
|
+
tags: request.tags
|
|
812
597
|
});
|
|
813
598
|
const marshalUpdateOrganizationLoginMethodsRequest = (request, defaults) => ({
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
599
|
+
login_magic_code_enabled: request.loginMagicCodeEnabled,
|
|
600
|
+
login_oauth2_enabled: request.loginOauth2Enabled,
|
|
601
|
+
login_password_enabled: request.loginPasswordEnabled,
|
|
602
|
+
login_saml_enabled: request.loginSamlEnabled
|
|
818
603
|
});
|
|
819
604
|
const marshalUpdateOrganizationSecuritySettingsRequest = (request, defaults) => ({
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
605
|
+
enforce_password_renewal: request.enforcePasswordRenewal,
|
|
606
|
+
grace_period_duration: request.gracePeriodDuration,
|
|
607
|
+
login_attempts_before_locked: request.loginAttemptsBeforeLocked,
|
|
608
|
+
max_api_key_expiration_duration: request.maxApiKeyExpirationDuration,
|
|
609
|
+
max_login_session_duration: request.maxLoginSessionDuration
|
|
825
610
|
});
|
|
826
611
|
const marshalUpdatePolicyRequest = (request, defaults) => ({
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
612
|
+
description: request.description,
|
|
613
|
+
name: request.name,
|
|
614
|
+
tags: request.tags,
|
|
615
|
+
...resolveOneOf([
|
|
616
|
+
{
|
|
617
|
+
param: "user_id",
|
|
618
|
+
value: request.userId
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
param: "group_id",
|
|
622
|
+
value: request.groupId
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
param: "application_id",
|
|
626
|
+
value: request.applicationId
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
param: "no_principal",
|
|
630
|
+
value: request.noPrincipal
|
|
631
|
+
}
|
|
632
|
+
])
|
|
836
633
|
});
|
|
837
634
|
const marshalUpdateSSHKeyRequest = (request, defaults) => ({
|
|
838
|
-
|
|
839
|
-
|
|
635
|
+
disabled: request.disabled,
|
|
636
|
+
name: request.name
|
|
840
637
|
});
|
|
841
638
|
const marshalUpdateSamlRequest = (request, defaults) => ({
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
});
|
|
845
|
-
const marshalUpdateUserPasswordRequest = (request, defaults) => ({
|
|
846
|
-
password: request.password
|
|
639
|
+
entity_id: request.entityId,
|
|
640
|
+
single_sign_on_url: request.singleSignOnUrl
|
|
847
641
|
});
|
|
642
|
+
const marshalUpdateUserPasswordRequest = (request, defaults) => ({ password: request.password });
|
|
848
643
|
const marshalUpdateUserRequest = (request, defaults) => ({
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
});
|
|
856
|
-
const marshalUpdateUserUsernameRequest = (request, defaults) => ({
|
|
857
|
-
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
authenticator_name: request.authenticatorName
|
|
861
|
-
});
|
|
862
|
-
const marshalValidateUserMFAOTPRequest = (request, defaults) => ({
|
|
863
|
-
one_time_password: request.oneTimePassword
|
|
864
|
-
});
|
|
865
|
-
export {
|
|
866
|
-
marshalAddGroupMemberRequest,
|
|
867
|
-
marshalAddGroupMembersRequest,
|
|
868
|
-
marshalAddSamlCertificateRequest,
|
|
869
|
-
marshalCreateAPIKeyRequest,
|
|
870
|
-
marshalCreateApplicationRequest,
|
|
871
|
-
marshalCreateGroupRequest,
|
|
872
|
-
marshalCreateJWTRequest,
|
|
873
|
-
marshalCreatePolicyRequest,
|
|
874
|
-
marshalCreateSSHKeyRequest,
|
|
875
|
-
marshalCreateUserRequest,
|
|
876
|
-
marshalFinishUserWebAuthnRegistrationRequest,
|
|
877
|
-
marshalJoinUserConnectionRequest,
|
|
878
|
-
marshalParseSamlMetadataRequest,
|
|
879
|
-
marshalRemoveGroupMemberRequest,
|
|
880
|
-
marshalRemoveUserConnectionRequest,
|
|
881
|
-
marshalSetGroupMembersRequest,
|
|
882
|
-
marshalSetOrganizationAliasRequest,
|
|
883
|
-
marshalSetRulesRequest,
|
|
884
|
-
marshalUpdateAPIKeyRequest,
|
|
885
|
-
marshalUpdateApplicationRequest,
|
|
886
|
-
marshalUpdateGroupRequest,
|
|
887
|
-
marshalUpdateOrganizationLoginMethodsRequest,
|
|
888
|
-
marshalUpdateOrganizationSecuritySettingsRequest,
|
|
889
|
-
marshalUpdatePolicyRequest,
|
|
890
|
-
marshalUpdateSSHKeyRequest,
|
|
891
|
-
marshalUpdateSamlRequest,
|
|
892
|
-
marshalUpdateUserPasswordRequest,
|
|
893
|
-
marshalUpdateUserRequest,
|
|
894
|
-
marshalUpdateUserUsernameRequest,
|
|
895
|
-
marshalUpdateWebAuthnAuthenticatorRequest,
|
|
896
|
-
marshalValidateUserMFAOTPRequest,
|
|
897
|
-
unmarshalAPIKey,
|
|
898
|
-
unmarshalApplication,
|
|
899
|
-
unmarshalCreateScimTokenResponse,
|
|
900
|
-
unmarshalEncodedJWT,
|
|
901
|
-
unmarshalFinishUserWebAuthnRegistrationResponse,
|
|
902
|
-
unmarshalGetUserConnectionsResponse,
|
|
903
|
-
unmarshalGroup,
|
|
904
|
-
unmarshalInitiateUserConnectionResponse,
|
|
905
|
-
unmarshalJWT,
|
|
906
|
-
unmarshalListAPIKeysResponse,
|
|
907
|
-
unmarshalListApplicationsResponse,
|
|
908
|
-
unmarshalListGracePeriodsResponse,
|
|
909
|
-
unmarshalListGroupsResponse,
|
|
910
|
-
unmarshalListJWTsResponse,
|
|
911
|
-
unmarshalListLogsResponse,
|
|
912
|
-
unmarshalListPermissionSetsResponse,
|
|
913
|
-
unmarshalListPoliciesResponse,
|
|
914
|
-
unmarshalListQuotaResponse,
|
|
915
|
-
unmarshalListRulesResponse,
|
|
916
|
-
unmarshalListSSHKeysResponse,
|
|
917
|
-
unmarshalListSamlCertificatesResponse,
|
|
918
|
-
unmarshalListScimTokensResponse,
|
|
919
|
-
unmarshalListUserWebAuthnAuthenticatorsResponse,
|
|
920
|
-
unmarshalListUsersResponse,
|
|
921
|
-
unmarshalLog,
|
|
922
|
-
unmarshalMFAOTP,
|
|
923
|
-
unmarshalOrganization,
|
|
924
|
-
unmarshalOrganizationSecuritySettings,
|
|
925
|
-
unmarshalParseSamlMetadataResponse,
|
|
926
|
-
unmarshalPolicy,
|
|
927
|
-
unmarshalQuotum,
|
|
928
|
-
unmarshalSSHKey,
|
|
929
|
-
unmarshalSaml,
|
|
930
|
-
unmarshalSamlCertificate,
|
|
931
|
-
unmarshalScim,
|
|
932
|
-
unmarshalSetRulesResponse,
|
|
933
|
-
unmarshalStartUserWebAuthnRegistrationResponse,
|
|
934
|
-
unmarshalUser,
|
|
935
|
-
unmarshalValidateUserMFAOTPResponse,
|
|
936
|
-
unmarshalWebAuthnAuthenticator
|
|
937
|
-
};
|
|
644
|
+
email: request.email,
|
|
645
|
+
first_name: request.firstName,
|
|
646
|
+
last_name: request.lastName,
|
|
647
|
+
locale: request.locale,
|
|
648
|
+
phone_number: request.phoneNumber,
|
|
649
|
+
tags: request.tags
|
|
650
|
+
});
|
|
651
|
+
const marshalUpdateUserUsernameRequest = (request, defaults) => ({ username: request.username });
|
|
652
|
+
const marshalUpdateWebAuthnAuthenticatorRequest = (request, defaults) => ({ authenticator_name: request.authenticatorName });
|
|
653
|
+
const marshalValidateUserMFAOTPRequest = (request, defaults) => ({ one_time_password: request.oneTimePassword });
|
|
654
|
+
export { marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalAddSamlCertificateRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreateJWTRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalCreateUserRequest, marshalFinishUserWebAuthnRegistrationRequest, marshalJoinUserConnectionRequest, marshalParseSamlMetadataRequest, marshalRemoveGroupMemberRequest, marshalRemoveUserConnectionRequest, marshalSetGroupMembersRequest, marshalSetOrganizationAliasRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdateOrganizationLoginMethodsRequest, marshalUpdateOrganizationSecuritySettingsRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, marshalUpdateSamlRequest, marshalUpdateUserPasswordRequest, marshalUpdateUserRequest, marshalUpdateUserUsernameRequest, marshalUpdateWebAuthnAuthenticatorRequest, marshalValidateUserMFAOTPRequest, unmarshalAPIKey, unmarshalApplication, unmarshalCreateScimTokenResponse, unmarshalEncodedJWT, unmarshalFinishUserWebAuthnRegistrationResponse, unmarshalGetUserConnectionsResponse, unmarshalGroup, unmarshalInitiateUserConnectionResponse, unmarshalJWT, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGracePeriodsResponse, unmarshalListGroupsResponse, unmarshalListJWTsResponse, unmarshalListLogsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListSamlCertificatesResponse, unmarshalListScimTokensResponse, unmarshalListUserWebAuthnAuthenticatorsResponse, unmarshalListUsersResponse, unmarshalLog, unmarshalMFAOTP, unmarshalOrganization, unmarshalOrganizationSecuritySettings, unmarshalParseSamlMetadataResponse, unmarshalPolicy, unmarshalQuotum, unmarshalSSHKey, unmarshalSaml, unmarshalSamlCertificate, unmarshalScim, unmarshalSetRulesResponse, unmarshalStartUserWebAuthnRegistrationResponse, unmarshalUser, unmarshalValidateUserMFAOTPResponse, unmarshalWebAuthnAuthenticator };
|