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