@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.
@@ -1,1357 +1,909 @@
1
- import { API as API$1, urlParams, enrichForPagination, validatePathParam, resolveOneOf } from "@scaleway/sdk-client";
2
- import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, marshalUpdateUserRequest, marshalCreateUserRequest, marshalUpdateUserUsernameRequest, marshalUpdateUserPasswordRequest, unmarshalMFAOTP, marshalValidateUserMFAOTPRequest, unmarshalValidateUserMFAOTPResponse, unmarshalListGracePeriodsResponse, unmarshalGetUserConnectionsResponse, unmarshalInitiateUserConnectionResponse, marshalJoinUserConnectionRequest, marshalRemoveUserConnectionRequest, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, marshalCreateJWTRequest, unmarshalEncodedJWT, unmarshalJWT, unmarshalListLogsResponse, unmarshalLog, unmarshalOrganizationSecuritySettings, marshalUpdateOrganizationSecuritySettingsRequest, marshalSetOrganizationAliasRequest, unmarshalOrganization, marshalUpdateOrganizationLoginMethodsRequest, unmarshalSaml, marshalUpdateSamlRequest, marshalParseSamlMetadataRequest, unmarshalParseSamlMetadataResponse, unmarshalListSamlCertificatesResponse, marshalAddSamlCertificateRequest, unmarshalSamlCertificate, unmarshalScim, unmarshalListScimTokensResponse, unmarshalCreateScimTokenResponse, unmarshalStartUserWebAuthnRegistrationResponse, marshalFinishUserWebAuthnRegistrationRequest, unmarshalFinishUserWebAuthnRegistrationResponse, unmarshalListUserWebAuthnAuthenticatorsResponse, marshalUpdateWebAuthnAuthenticatorRequest, unmarshalWebAuthnAuthenticator } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class API extends API$1 {
7
- pageOfListSSHKeys = (request = {}) => this.client.fetch(
8
- {
9
- method: "GET",
10
- path: `/iam/v1alpha1/ssh-keys`,
11
- urlParams: urlParams(
12
- ["disabled", request.disabled],
13
- ["name", request.name],
14
- ["order_by", request.orderBy],
15
- ["organization_id", request.organizationId],
16
- ["page", request.page],
17
- [
18
- "page_size",
19
- request.pageSize ?? this.client.settings.defaultPageSize
20
- ],
21
- ["project_id", request.projectId]
22
- )
23
- },
24
- unmarshalListSSHKeysResponse
25
- );
26
- /**
27
- * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `organization_id`, `name`, `project_id` and `disabled`.
28
- *
29
- * @param request - The request {@link ListSSHKeysRequest}
30
- * @returns A Promise of ListSSHKeysResponse
31
- */
32
- listSSHKeys = (request = {}) => enrichForPagination("sshKeys", this.pageOfListSSHKeys, request);
33
- /**
34
- * Create an SSH key. Add a new SSH key to a Scaleway Project. You must specify the `name`, `public_key` and `project_id`.
35
- *
36
- * @param request - The request {@link CreateSSHKeyRequest}
37
- * @returns A Promise of SSHKey
38
- */
39
- createSSHKey = (request) => this.client.fetch(
40
- {
41
- body: JSON.stringify(
42
- marshalCreateSSHKeyRequest(request, this.client.settings)
43
- ),
44
- headers: jsonContentHeaders,
45
- method: "POST",
46
- path: `/iam/v1alpha1/ssh-keys`
47
- },
48
- unmarshalSSHKey
49
- );
50
- /**
51
- * Get an SSH key. Retrieve information about a given SSH key, specified by the `ssh_key_id` parameter. The SSH key's full details, including `id`, `name`, `public_key`, and `project_id` are returned in the response.
52
- *
53
- * @param request - The request {@link GetSSHKeyRequest}
54
- * @returns A Promise of SSHKey
55
- */
56
- getSSHKey = (request) => this.client.fetch(
57
- {
58
- method: "GET",
59
- path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
60
- },
61
- unmarshalSSHKey
62
- );
63
- /**
64
- * Update an SSH key. Update the parameters of an SSH key, including `name` and `disable`.
65
- *
66
- * @param request - The request {@link UpdateSSHKeyRequest}
67
- * @returns A Promise of SSHKey
68
- */
69
- updateSSHKey = (request) => this.client.fetch(
70
- {
71
- body: JSON.stringify(
72
- marshalUpdateSSHKeyRequest(request, this.client.settings)
73
- ),
74
- headers: jsonContentHeaders,
75
- method: "PATCH",
76
- path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
77
- },
78
- unmarshalSSHKey
79
- );
80
- /**
81
- * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`. Deleting an SSH is permanent, and cannot be undone. Note that you might need to update any configurations that used the SSH key.
82
- *
83
- * @param request - The request {@link DeleteSSHKeyRequest}
84
- */
85
- deleteSSHKey = (request) => this.client.fetch({
86
- method: "DELETE",
87
- path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
88
- });
89
- pageOfListUsers = (request = {}) => this.client.fetch(
90
- {
91
- method: "GET",
92
- path: `/iam/v1alpha1/users`,
93
- urlParams: urlParams(
94
- ["mfa", request.mfa],
95
- ["order_by", request.orderBy],
96
- [
97
- "organization_id",
98
- request.organizationId ?? this.client.settings.defaultOrganizationId
99
- ],
100
- ["page", request.page],
101
- [
102
- "page_size",
103
- request.pageSize ?? this.client.settings.defaultPageSize
104
- ],
105
- ["tag", request.tag],
106
- ["type", request.type],
107
- ["user_ids", request.userIds]
108
- )
109
- },
110
- unmarshalListUsersResponse
111
- );
112
- /**
113
- * List users of an Organization. List the users of an Organization. By default, the users listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `user_ids`.
114
- *
115
- * @param request - The request {@link ListUsersRequest}
116
- * @returns A Promise of ListUsersResponse
117
- */
118
- listUsers = (request = {}) => enrichForPagination("users", this.pageOfListUsers, request);
119
- /**
120
- * Get a given user. Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `mfa` are returned in the response.
121
- *
122
- * @param request - The request {@link GetUserRequest}
123
- * @returns A Promise of User
124
- */
125
- getUser = (request) => this.client.fetch(
126
- {
127
- method: "GET",
128
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
129
- },
130
- unmarshalUser
131
- );
132
- /**
133
- * Update a user. Update the parameters of a user, including `tags`.
134
- *
135
- * @param request - The request {@link UpdateUserRequest}
136
- * @returns A Promise of User
137
- */
138
- updateUser = (request) => this.client.fetch(
139
- {
140
- body: JSON.stringify(
141
- marshalUpdateUserRequest(request, this.client.settings)
142
- ),
143
- headers: jsonContentHeaders,
144
- method: "PATCH",
145
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
146
- },
147
- unmarshalUser
148
- );
149
- /**
150
- * Delete a guest user from an Organization. Remove a user from an Organization in which they are a guest. You must define the `user_id` in your request. Note that removing a user from an Organization automatically deletes their API keys, and any policies directly attached to them become orphaned.
151
- *
152
- * @param request - The request {@link DeleteUserRequest}
153
- */
154
- deleteUser = (request) => this.client.fetch({
155
- method: "DELETE",
156
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
157
- });
158
- /**
159
- * Create a new user. Create a new user. You must define the `organization_id` in your request. If you are adding a member, enter the member's details. If you are adding a guest, you must define the `email` and not add the member attribute.
160
- *
161
- * @param request - The request {@link CreateUserRequest}
162
- * @returns A Promise of User
163
- */
164
- createUser = (request = {}) => this.client.fetch(
165
- {
166
- body: JSON.stringify(
167
- marshalCreateUserRequest(request, this.client.settings)
168
- ),
169
- headers: jsonContentHeaders,
170
- method: "POST",
171
- path: `/iam/v1alpha1/users`
172
- },
173
- unmarshalUser
174
- );
175
- /**
176
- * Update an user's username.. Update an user's username.
177
- *
178
- * @param request - The request {@link UpdateUserUsernameRequest}
179
- * @returns A Promise of User
180
- */
181
- updateUserUsername = (request) => this.client.fetch(
182
- {
183
- body: JSON.stringify(
184
- marshalUpdateUserUsernameRequest(request, this.client.settings)
185
- ),
186
- headers: jsonContentHeaders,
187
- method: "POST",
188
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/update-username`
189
- },
190
- unmarshalUser
191
- );
192
- /**
193
- * Update an user's password.. Update an user's password.
194
- *
195
- * @param request - The request {@link UpdateUserPasswordRequest}
196
- * @returns A Promise of User
197
- */
198
- updateUserPassword = (request) => this.client.fetch(
199
- {
200
- body: JSON.stringify(
201
- marshalUpdateUserPasswordRequest(request, this.client.settings)
202
- ),
203
- headers: jsonContentHeaders,
204
- method: "POST",
205
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/update-password`
206
- },
207
- unmarshalUser
208
- );
209
- /**
210
- * Create a MFA OTP.. Create a MFA OTP.
211
- *
212
- * @param request - The request {@link CreateUserMFAOTPRequest}
213
- * @returns A Promise of MFAOTP
214
- */
215
- createUserMFAOTP = (request) => this.client.fetch(
216
- {
217
- body: "{}",
218
- headers: jsonContentHeaders,
219
- method: "POST",
220
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/mfa-otp`
221
- },
222
- unmarshalMFAOTP
223
- );
224
- /**
225
- * Validate a MFA OTP.. Validate a MFA OTP.
226
- *
227
- * @param request - The request {@link ValidateUserMFAOTPRequest}
228
- * @returns A Promise of ValidateUserMFAOTPResponse
229
- */
230
- validateUserMFAOTP = (request) => this.client.fetch(
231
- {
232
- body: JSON.stringify(
233
- marshalValidateUserMFAOTPRequest(request, this.client.settings)
234
- ),
235
- headers: jsonContentHeaders,
236
- method: "POST",
237
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/validate-mfa-otp`
238
- },
239
- unmarshalValidateUserMFAOTPResponse
240
- );
241
- /**
242
- * Delete a MFA OTP.. Delete a MFA OTP.
243
- *
244
- * @param request - The request {@link DeleteUserMFAOTPRequest}
245
- */
246
- deleteUserMFAOTP = (request) => this.client.fetch({
247
- body: "{}",
248
- headers: jsonContentHeaders,
249
- method: "DELETE",
250
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/mfa-otp`
251
- });
252
- /**
253
- * Lock a member. Lock a member. A locked member cannot log in or use API keys until the locked status is removed.
254
- *
255
- * @param request - The request {@link LockUserRequest}
256
- * @returns A Promise of User
257
- */
258
- lockUser = (request) => this.client.fetch(
259
- {
260
- body: "{}",
261
- headers: jsonContentHeaders,
262
- method: "POST",
263
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/lock`
264
- },
265
- unmarshalUser
266
- );
267
- /**
268
- * Unlock a member.
269
- *
270
- * @param request - The request {@link UnlockUserRequest}
271
- * @returns A Promise of User
272
- */
273
- unlockUser = (request) => this.client.fetch(
274
- {
275
- body: "{}",
276
- headers: jsonContentHeaders,
277
- method: "POST",
278
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/unlock`
279
- },
280
- unmarshalUser
281
- );
282
- /**
283
- * List grace periods of a member. List the grace periods of a member.
284
- *
285
- * @param request - The request {@link ListGracePeriodsRequest}
286
- * @returns A Promise of ListGracePeriodsResponse
287
- */
288
- listGracePeriods = (request = {}) => this.client.fetch(
289
- {
290
- method: "GET",
291
- path: `/iam/v1alpha1/grace-periods`,
292
- urlParams: urlParams(["user_id", request.userId])
293
- },
294
- unmarshalListGracePeriodsResponse
295
- );
296
- getUserConnections = (request) => this.client.fetch(
297
- {
298
- method: "GET",
299
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/connections`
300
- },
301
- unmarshalGetUserConnectionsResponse
302
- );
303
- initiateUserConnection = (request) => this.client.fetch(
304
- {
305
- body: "{}",
306
- headers: jsonContentHeaders,
307
- method: "POST",
308
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/initiate-connection`
309
- },
310
- unmarshalInitiateUserConnectionResponse
311
- );
312
- joinUserConnection = (request) => this.client.fetch({
313
- body: JSON.stringify(
314
- marshalJoinUserConnectionRequest(request, this.client.settings)
315
- ),
316
- headers: jsonContentHeaders,
317
- method: "POST",
318
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/join-connection`
319
- });
320
- removeUserConnection = (request) => this.client.fetch({
321
- body: JSON.stringify(
322
- marshalRemoveUserConnectionRequest(request, this.client.settings)
323
- ),
324
- headers: jsonContentHeaders,
325
- method: "POST",
326
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/remove-connection`
327
- });
328
- pageOfListApplications = (request = {}) => this.client.fetch(
329
- {
330
- method: "GET",
331
- path: `/iam/v1alpha1/applications`,
332
- urlParams: urlParams(
333
- ["application_ids", request.applicationIds],
334
- ["editable", request.editable],
335
- ["name", request.name],
336
- ["order_by", request.orderBy],
337
- [
338
- "organization_id",
339
- request.organizationId ?? this.client.settings.defaultOrganizationId
340
- ],
341
- ["page", request.page],
342
- [
343
- "page_size",
344
- request.pageSize ?? this.client.settings.defaultPageSize
345
- ],
346
- ["tag", request.tag]
347
- )
348
- },
349
- unmarshalListApplicationsResponse
350
- );
351
- /**
352
- * List applications of an Organization. List the applications of an Organization. By default, the applications listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `application_ids`.
353
- *
354
- * @param request - The request {@link ListApplicationsRequest}
355
- * @returns A Promise of ListApplicationsResponse
356
- */
357
- listApplications = (request = {}) => enrichForPagination("applications", this.pageOfListApplications, request);
358
- /**
359
- * Create a new application. Create a new application. You must define the `name` parameter in the request.
360
- *
361
- * @param request - The request {@link CreateApplicationRequest}
362
- * @returns A Promise of Application
363
- */
364
- createApplication = (request) => this.client.fetch(
365
- {
366
- body: JSON.stringify(
367
- marshalCreateApplicationRequest(request, this.client.settings)
368
- ),
369
- headers: jsonContentHeaders,
370
- method: "POST",
371
- path: `/iam/v1alpha1/applications`
372
- },
373
- unmarshalApplication
374
- );
375
- /**
376
- * Get a given application. Retrieve information about an application, specified by the `application_id` parameter. The application's full details, including `id`, `email`, `organization_id`, `status` and `two_factor_enabled` are returned in the response.
377
- *
378
- * @param request - The request {@link GetApplicationRequest}
379
- * @returns A Promise of Application
380
- */
381
- getApplication = (request) => this.client.fetch(
382
- {
383
- method: "GET",
384
- path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
385
- },
386
- unmarshalApplication
387
- );
388
- /**
389
- * Update an application. Update the parameters of an application, including `name` and `description`.
390
- *
391
- * @param request - The request {@link UpdateApplicationRequest}
392
- * @returns A Promise of Application
393
- */
394
- updateApplication = (request) => this.client.fetch(
395
- {
396
- body: JSON.stringify(
397
- marshalUpdateApplicationRequest(request, this.client.settings)
398
- ),
399
- headers: jsonContentHeaders,
400
- method: "PATCH",
401
- path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
402
- },
403
- unmarshalApplication
404
- );
405
- /**
406
- * Delete an application. Delete an application. Note that this action is irreversible and will automatically delete the application's API keys. Policies attached to users and applications via this group will no longer apply.
407
- *
408
- * @param request - The request {@link DeleteApplicationRequest}
409
- */
410
- deleteApplication = (request) => this.client.fetch({
411
- method: "DELETE",
412
- path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
413
- });
414
- pageOfListGroups = (request = {}) => this.client.fetch(
415
- {
416
- method: "GET",
417
- path: `/iam/v1alpha1/groups`,
418
- urlParams: urlParams(
419
- ["application_ids", request.applicationIds],
420
- ["group_ids", request.groupIds],
421
- ["name", request.name],
422
- ["order_by", request.orderBy],
423
- [
424
- "organization_id",
425
- request.organizationId ?? this.client.settings.defaultOrganizationId
426
- ],
427
- ["page", request.page],
428
- [
429
- "page_size",
430
- request.pageSize ?? this.client.settings.defaultPageSize
431
- ],
432
- ["tag", request.tag],
433
- ["user_ids", request.userIds]
434
- )
435
- },
436
- unmarshalListGroupsResponse
437
- );
438
- /**
439
- * List groups. List groups. By default, the groups listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters to filter your query. Use `user_ids` or `application_ids` to list all groups certain users or applications belong to.
440
- *
441
- * @param request - The request {@link ListGroupsRequest}
442
- * @returns A Promise of ListGroupsResponse
443
- */
444
- listGroups = (request = {}) => enrichForPagination("groups", this.pageOfListGroups, request);
445
- /**
446
- * Create a group. Create a new group. You must define the `name` and `organization_id` parameters in the request.
447
- *
448
- * @param request - The request {@link CreateGroupRequest}
449
- * @returns A Promise of Group
450
- */
451
- createGroup = (request) => this.client.fetch(
452
- {
453
- body: JSON.stringify(
454
- marshalCreateGroupRequest(request, this.client.settings)
455
- ),
456
- headers: jsonContentHeaders,
457
- method: "POST",
458
- path: `/iam/v1alpha1/groups`
459
- },
460
- unmarshalGroup
461
- );
462
- /**
463
- * Get a group. Retrieve information about a given group, specified by the `group_id` parameter. The group's full details, including `user_ids` and `application_ids` are returned in the response.
464
- *
465
- * @param request - The request {@link GetGroupRequest}
466
- * @returns A Promise of Group
467
- */
468
- getGroup = (request) => this.client.fetch(
469
- {
470
- method: "GET",
471
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
472
- },
473
- unmarshalGroup
474
- );
475
- /**
476
- * Update a group. Update the parameters of group, including `name` and `description`.
477
- *
478
- * @param request - The request {@link UpdateGroupRequest}
479
- * @returns A Promise of Group
480
- */
481
- updateGroup = (request) => this.client.fetch(
482
- {
483
- body: JSON.stringify(
484
- marshalUpdateGroupRequest(request, this.client.settings)
485
- ),
486
- headers: jsonContentHeaders,
487
- method: "PATCH",
488
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
489
- },
490
- unmarshalGroup
491
- );
492
- /**
493
- * Overwrite users and applications of a group. Overwrite users and applications configuration in a group. Any information that you add using this command will overwrite the previous configuration.
494
- *
495
- * @param request - The request {@link SetGroupMembersRequest}
496
- * @returns A Promise of Group
497
- */
498
- setGroupMembers = (request) => this.client.fetch(
499
- {
500
- body: JSON.stringify(
501
- marshalSetGroupMembersRequest(request, this.client.settings)
502
- ),
503
- headers: jsonContentHeaders,
504
- method: "PUT",
505
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/members`
506
- },
507
- unmarshalGroup
508
- );
509
- /**
510
- * Add a user or an application to a group. Add a user or an application to a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only add one of each per request.
511
- *
512
- * @param request - The request {@link AddGroupMemberRequest}
513
- * @returns A Promise of Group
514
- */
515
- addGroupMember = (request) => this.client.fetch(
516
- {
517
- body: JSON.stringify(
518
- marshalAddGroupMemberRequest(request, this.client.settings)
519
- ),
520
- headers: jsonContentHeaders,
521
- method: "POST",
522
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/add-member`
523
- },
524
- unmarshalGroup
525
- );
526
- /**
527
- * Add multiple users and applications to a group. Add multiple users and applications to a group in a single call. You can specify an array of `user_id`s and `application_id`s. Note that any existing users and applications in the group will remain. To add new users/applications and delete pre-existing ones, use the [Overwrite users and applications of a group](#path-groups-overwrite-users-and-applications-of-a-group) method.
528
- *
529
- * @param request - The request {@link AddGroupMembersRequest}
530
- * @returns A Promise of Group
531
- */
532
- addGroupMembers = (request) => this.client.fetch(
533
- {
534
- body: JSON.stringify(
535
- marshalAddGroupMembersRequest(request, this.client.settings)
536
- ),
537
- headers: jsonContentHeaders,
538
- method: "POST",
539
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/add-members`
540
- },
541
- unmarshalGroup
542
- );
543
- /**
544
- * Remove a user or an application from a group. Remove a user or an application from a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only remove one of each per request. Removing a user from a group means that any permissions given to them via the group (i.e. from an attached policy) will no longer apply. Be sure you want to remove these permissions from the user before proceeding.
545
- *
546
- * @param request - The request {@link RemoveGroupMemberRequest}
547
- * @returns A Promise of Group
548
- */
549
- removeGroupMember = (request) => this.client.fetch(
550
- {
551
- body: JSON.stringify(
552
- marshalRemoveGroupMemberRequest(request, this.client.settings)
553
- ),
554
- headers: jsonContentHeaders,
555
- method: "POST",
556
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/remove-member`
557
- },
558
- unmarshalGroup
559
- );
560
- /**
561
- * Delete a group. Delete a group. Note that this action is irreversible and could delete permissions for group members. Policies attached to users and applications via this group will no longer apply.
562
- *
563
- * @param request - The request {@link DeleteGroupRequest}
564
- */
565
- deleteGroup = (request) => this.client.fetch({
566
- method: "DELETE",
567
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
568
- });
569
- pageOfListPolicies = (request = {}) => this.client.fetch(
570
- {
571
- method: "GET",
572
- path: `/iam/v1alpha1/policies`,
573
- urlParams: urlParams(
574
- ["application_ids", request.applicationIds],
575
- ["editable", request.editable],
576
- ["group_ids", request.groupIds],
577
- ["no_principal", request.noPrincipal],
578
- ["order_by", request.orderBy],
579
- [
580
- "organization_id",
581
- request.organizationId ?? this.client.settings.defaultOrganizationId
582
- ],
583
- ["page", request.page],
584
- [
585
- "page_size",
586
- request.pageSize ?? this.client.settings.defaultPageSize
587
- ],
588
- ["policy_ids", request.policyIds],
589
- ["policy_name", request.policyName],
590
- ["tag", request.tag],
591
- ["user_ids", request.userIds]
592
- )
593
- },
594
- unmarshalListPoliciesResponse
595
- );
596
- /**
597
- * List policies of an Organization. List the policies of an Organization. By default, the policies listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters to filter your query, such as `user_ids`, `groups_ids`, `application_ids`, and `policy_name`.
598
- *
599
- * @param request - The request {@link ListPoliciesRequest}
600
- * @returns A Promise of ListPoliciesResponse
601
- */
602
- listPolicies = (request = {}) => enrichForPagination("policies", this.pageOfListPolicies, request);
603
- /**
604
- * Create a new policy. Create a new application. You must define the `name` parameter in the request. You can specify parameters such as `user_id`, `groups_id`, `application_id`, `no_principal`, `rules` and its child attributes.
605
- *
606
- * @param request - The request {@link CreatePolicyRequest}
607
- * @returns A Promise of Policy
608
- */
609
- createPolicy = (request) => this.client.fetch(
610
- {
611
- body: JSON.stringify(
612
- marshalCreatePolicyRequest(request, this.client.settings)
613
- ),
614
- headers: jsonContentHeaders,
615
- method: "POST",
616
- path: `/iam/v1alpha1/policies`
617
- },
618
- unmarshalPolicy
619
- );
620
- /**
621
- * Get an existing policy. Retrieve information about a policy, specified by the `policy_id` parameter. The policy's full details, including `id`, `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets` are returned in the response.
622
- *
623
- * @param request - The request {@link GetPolicyRequest}
624
- * @returns A Promise of Policy
625
- */
626
- getPolicy = (request) => this.client.fetch(
627
- {
628
- method: "GET",
629
- path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
630
- },
631
- unmarshalPolicy
632
- );
633
- /**
634
- * Update an existing policy. Update the parameters of a policy, including `name`, `description`, `user_id`, `group_id`, `application_id` and `no_principal`.
635
- *
636
- * @param request - The request {@link UpdatePolicyRequest}
637
- * @returns A Promise of Policy
638
- */
639
- updatePolicy = (request) => this.client.fetch(
640
- {
641
- body: JSON.stringify(
642
- marshalUpdatePolicyRequest(request, this.client.settings)
643
- ),
644
- headers: jsonContentHeaders,
645
- method: "PATCH",
646
- path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
647
- },
648
- unmarshalPolicy
649
- );
650
- /**
651
- * Delete a policy. Delete a policy. You must define specify the `policy_id` parameter in your request. Note that when deleting a policy, all permissions it gives to its principal (user, group or application) will be revoked.
652
- *
653
- * @param request - The request {@link DeletePolicyRequest}
654
- */
655
- deletePolicy = (request) => this.client.fetch({
656
- method: "DELETE",
657
- path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
658
- });
659
- /**
660
- * Clone a policy. Clone a policy. You must define specify the `policy_id` parameter in your request.
661
- *
662
- * @param request - The request {@link ClonePolicyRequest}
663
- * @returns A Promise of Policy
664
- */
665
- clonePolicy = (request) => this.client.fetch(
666
- {
667
- body: "{}",
668
- headers: jsonContentHeaders,
669
- method: "POST",
670
- path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}/clone`
671
- },
672
- unmarshalPolicy
673
- );
674
- /**
675
- * Set rules of a given policy. Overwrite the rules of a given policy. Any information that you add using this command will overwrite the previous configuration. If you include some of the rules you already had in your previous configuration in your new one, but you change their order, the new order of display will apply. While policy rules are ordered, they have no impact on the access logic of IAM because rules are allow-only.
676
- *
677
- * @param request - The request {@link SetRulesRequest}
678
- * @returns A Promise of SetRulesResponse
679
- */
680
- setRules = (request) => this.client.fetch(
681
- {
682
- body: JSON.stringify(
683
- marshalSetRulesRequest(request, this.client.settings)
684
- ),
685
- headers: jsonContentHeaders,
686
- method: "PUT",
687
- path: `/iam/v1alpha1/rules`
688
- },
689
- unmarshalSetRulesResponse
690
- );
691
- pageOfListRules = (request) => this.client.fetch(
692
- {
693
- method: "GET",
694
- path: `/iam/v1alpha1/rules`,
695
- urlParams: urlParams(
696
- ["page", request.page],
697
- [
698
- "page_size",
699
- request.pageSize ?? this.client.settings.defaultPageSize
700
- ],
701
- ["policy_id", request.policyId]
702
- )
703
- },
704
- unmarshalListRulesResponse
705
- );
706
- /**
707
- * List rules of a given policy. List the rules of a given policy. By default, the rules listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `policy_id` in the query path of your request.
708
- *
709
- * @param request - The request {@link ListRulesRequest}
710
- * @returns A Promise of ListRulesResponse
711
- */
712
- listRules = (request) => enrichForPagination("rules", this.pageOfListRules, request);
713
- pageOfListPermissionSets = (request = {}) => this.client.fetch(
714
- {
715
- method: "GET",
716
- path: `/iam/v1alpha1/permission-sets`,
717
- urlParams: urlParams(
718
- ["order_by", request.orderBy],
719
- [
720
- "organization_id",
721
- request.organizationId ?? this.client.settings.defaultOrganizationId
722
- ],
723
- ["page", request.page],
724
- [
725
- "page_size",
726
- request.pageSize ?? this.client.settings.defaultPageSize
727
- ]
728
- )
729
- },
730
- unmarshalListPermissionSetsResponse
731
- );
732
- /**
733
- * List permission sets. List permission sets available for given Organization. You must define the `organization_id` in the query path of your request.
734
- *
735
- * @param request - The request {@link ListPermissionSetsRequest}
736
- * @returns A Promise of ListPermissionSetsResponse
737
- */
738
- listPermissionSets = (request = {}) => enrichForPagination(
739
- "permissionSets",
740
- this.pageOfListPermissionSets,
741
- request
742
- );
743
- pageOfListAPIKeys = (request = {}) => this.client.fetch(
744
- {
745
- method: "GET",
746
- path: `/iam/v1alpha1/api-keys`,
747
- urlParams: urlParams(
748
- ["access_key", request.accessKey],
749
- ["access_keys", request.accessKeys],
750
- ["bearer_id", request.bearerId],
751
- ["bearer_type", request.bearerType],
752
- ["description", request.description],
753
- ["editable", request.editable],
754
- ["expired", request.expired],
755
- ["order_by", request.orderBy],
756
- [
757
- "organization_id",
758
- request.organizationId ?? this.client.settings.defaultOrganizationId
759
- ],
760
- ["page", request.page],
761
- [
762
- "page_size",
763
- request.pageSize ?? this.client.settings.defaultPageSize
764
- ],
765
- ...Object.entries(
766
- resolveOneOf([
767
- { param: "application_id", value: request.applicationId },
768
- { param: "user_id", value: request.userId }
769
- ])
770
- )
771
- )
772
- },
773
- unmarshalListAPIKeysResponse
774
- );
775
- /**
776
- * List API keys. List API keys. By default, the API keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `editable`, `expired`, `access_key` and `bearer_id`.
777
- *
778
- * @param request - The request {@link ListAPIKeysRequest}
779
- * @returns A Promise of ListAPIKeysResponse
780
- */
781
- listAPIKeys = (request = {}) => enrichForPagination("apiKeys", this.pageOfListAPIKeys, request);
782
- /**
783
- * Create an API key. Create an API key. You must specify the `application_id` or the `user_id` and the description. You can also specify the `default_project_id`, which is the Project ID of your preferred Project, to use with Object Storage. The `access_key` and `secret_key` values are returned in the response. Note that the secret key is only shown once. Make sure that you copy and store both keys somewhere safe.
784
- *
785
- * @param request - The request {@link CreateAPIKeyRequest}
786
- * @returns A Promise of APIKey
787
- */
788
- createAPIKey = (request) => this.client.fetch(
789
- {
790
- body: JSON.stringify(
791
- marshalCreateAPIKeyRequest(request, this.client.settings)
792
- ),
793
- headers: jsonContentHeaders,
794
- method: "POST",
795
- path: `/iam/v1alpha1/api-keys`
796
- },
797
- unmarshalAPIKey
798
- );
799
- /**
800
- * Get an API key. Retrieve information about an API key, specified by the `access_key` parameter. The API key's details, including either the `user_id` or `application_id` of its bearer are returned in the response. Note that the string value for the `secret_key` is nullable, and therefore is not displayed in the response. The `secret_key` value is only displayed upon API key creation.
801
- *
802
- * @param request - The request {@link GetAPIKeyRequest}
803
- * @returns A Promise of APIKey
804
- */
805
- getAPIKey = (request) => this.client.fetch(
806
- {
807
- method: "GET",
808
- path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
809
- },
810
- unmarshalAPIKey
811
- );
812
- /**
813
- * Update an API key. Update the parameters of an API key, including `default_project_id` and `description`.
814
- *
815
- * @param request - The request {@link UpdateAPIKeyRequest}
816
- * @returns A Promise of APIKey
817
- */
818
- updateAPIKey = (request) => this.client.fetch(
819
- {
820
- body: JSON.stringify(
821
- marshalUpdateAPIKeyRequest(request, this.client.settings)
822
- ),
823
- headers: jsonContentHeaders,
824
- method: "PATCH",
825
- path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
826
- },
827
- unmarshalAPIKey
828
- );
829
- /**
830
- * Delete an API key. Delete an API key. Note that this action is irreversible and cannot be undone. Make sure you update any configurations using the API keys you delete.
831
- *
832
- * @param request - The request {@link DeleteAPIKeyRequest}
833
- */
834
- deleteAPIKey = (request) => this.client.fetch({
835
- method: "DELETE",
836
- path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
837
- });
838
- pageOfListQuota = (request = {}) => this.client.fetch(
839
- {
840
- method: "GET",
841
- path: `/iam/v1alpha1/quota`,
842
- urlParams: urlParams(
843
- ["order_by", request.orderBy],
844
- [
845
- "organization_id",
846
- request.organizationId ?? this.client.settings.defaultOrganizationId
847
- ],
848
- ["page", request.page],
849
- [
850
- "page_size",
851
- request.pageSize ?? this.client.settings.defaultPageSize
852
- ],
853
- ["quotum_names", request.quotumNames]
854
- )
855
- },
856
- unmarshalListQuotaResponse
857
- );
858
- /**
859
- * List all quotas in the Organization. List all product and features quota for an Organization, with their associated limits. By default, the quota listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request.
860
- *
861
- * @param request - The request {@link ListQuotaRequest}
862
- * @returns A Promise of ListQuotaResponse
863
- */
864
- listQuota = (request = {}) => enrichForPagination("quota", this.pageOfListQuota, request);
865
- /**
866
- * Get a quota in the Organization. Retrieve information about a resource quota, specified by the `quotum_name` parameter. The quota's `limit`, or whether it is unlimited, is returned in the response.
867
- *
868
- * @param request - The request {@link GetQuotumRequest}
869
- * @returns A Promise of Quotum
870
- */
871
- getQuotum = (request) => this.client.fetch(
872
- {
873
- method: "GET",
874
- path: `/iam/v1alpha1/quota/${validatePathParam("quotumName", request.quotumName)}`,
875
- urlParams: urlParams([
876
- "organization_id",
877
- request.organizationId ?? this.client.settings.defaultOrganizationId
878
- ])
879
- },
880
- unmarshalQuotum
881
- );
882
- pageOfListJWTs = (request) => this.client.fetch(
883
- {
884
- method: "GET",
885
- path: `/iam/v1alpha1/jwts`,
886
- urlParams: urlParams(
887
- ["audience_id", request.audienceId],
888
- ["expired", request.expired],
889
- ["order_by", request.orderBy],
890
- ["page", request.page],
891
- [
892
- "page_size",
893
- request.pageSize ?? this.client.settings.defaultPageSize
894
- ]
895
- )
896
- },
897
- unmarshalListJWTsResponse
898
- );
899
- /**
900
- * List JWTs.
901
- *
902
- * @param request - The request {@link ListJWTsRequest}
903
- * @returns A Promise of ListJWTsResponse
904
- */
905
- listJWTs = (request) => enrichForPagination("jwts", this.pageOfListJWTs, request);
906
- /**
907
- * Create a JWT.
908
- *
909
- * @param request - The request {@link CreateJWTRequest}
910
- * @returns A Promise of EncodedJWT
911
- */
912
- createJWT = (request) => this.client.fetch(
913
- {
914
- body: JSON.stringify(
915
- marshalCreateJWTRequest(request, this.client.settings)
916
- ),
917
- headers: jsonContentHeaders,
918
- method: "POST",
919
- path: `/iam/v1alpha1/jwts`
920
- },
921
- unmarshalEncodedJWT
922
- );
923
- /**
924
- * Get a JWT.
925
- *
926
- * @param request - The request {@link GetJWTRequest}
927
- * @returns A Promise of JWT
928
- */
929
- getJWT = (request) => this.client.fetch(
930
- {
931
- method: "GET",
932
- path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
933
- },
934
- unmarshalJWT
935
- );
936
- /**
937
- * Delete a JWT.
938
- *
939
- * @param request - The request {@link DeleteJWTRequest}
940
- */
941
- deleteJWT = (request) => this.client.fetch({
942
- method: "DELETE",
943
- path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
944
- });
945
- pageOfListLogs = (request = {}) => this.client.fetch(
946
- {
947
- method: "GET",
948
- path: `/iam/v1alpha1/logs`,
949
- urlParams: urlParams(
950
- ["action", request.action],
951
- ["created_after", request.createdAfter],
952
- ["created_before", request.createdBefore],
953
- ["order_by", request.orderBy],
954
- [
955
- "organization_id",
956
- request.organizationId ?? this.client.settings.defaultOrganizationId
957
- ],
958
- ["page", request.page],
959
- [
960
- "page_size",
961
- request.pageSize ?? this.client.settings.defaultPageSize
962
- ],
963
- ["resource_type", request.resourceType],
964
- ["search", request.search]
965
- )
966
- },
967
- unmarshalListLogsResponse
968
- );
969
- /**
970
- * List logs. List logs available for given Organization. You must define the `organization_id` in the query path of your request.
971
- *
972
- * @param request - The request {@link ListLogsRequest}
973
- * @returns A Promise of ListLogsResponse
974
- */
975
- listLogs = (request = {}) => enrichForPagination("logs", this.pageOfListLogs, request);
976
- /**
977
- * Get a log. Retrieve information about a log, specified by the `log_id` parameter. The log's full details, including `id`, `ip`, `user_agent`, `action`, `bearer_id`, `resource_type` and `resource_id` are returned in the response.
978
- *
979
- * @param request - The request {@link GetLogRequest}
980
- * @returns A Promise of Log
981
- */
982
- getLog = (request) => this.client.fetch(
983
- {
984
- method: "GET",
985
- path: `/iam/v1alpha1/logs/${validatePathParam("logId", request.logId)}`
986
- },
987
- unmarshalLog
988
- );
989
- /**
990
- * Get security settings of an Organization. Retrieve information about the security settings of an Organization, specified by the `organization_id` parameter.
991
- *
992
- * @param request - The request {@link GetOrganizationSecuritySettingsRequest}
993
- * @returns A Promise of OrganizationSecuritySettings
994
- */
995
- getOrganizationSecuritySettings = (request = {}) => this.client.fetch(
996
- {
997
- method: "GET",
998
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`
999
- },
1000
- unmarshalOrganizationSecuritySettings
1001
- );
1002
- /**
1003
- * Update the security settings of an Organization.
1004
- *
1005
- * @param request - The request {@link UpdateOrganizationSecuritySettingsRequest}
1006
- * @returns A Promise of OrganizationSecuritySettings
1007
- */
1008
- updateOrganizationSecuritySettings = (request = {}) => this.client.fetch(
1009
- {
1010
- body: JSON.stringify(
1011
- marshalUpdateOrganizationSecuritySettingsRequest(
1012
- request,
1013
- this.client.settings
1014
- )
1015
- ),
1016
- headers: jsonContentHeaders,
1017
- method: "PATCH",
1018
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`
1019
- },
1020
- unmarshalOrganizationSecuritySettings
1021
- );
1022
- /**
1023
- * Set your Organization's alias.. This will fail if an alias has already been defined. Please contact support if you need to change your Organization's alias.
1024
- *
1025
- * @param request - The request {@link SetOrganizationAliasRequest}
1026
- * @returns A Promise of Organization
1027
- */
1028
- setOrganizationAlias = (request) => this.client.fetch(
1029
- {
1030
- body: JSON.stringify(
1031
- marshalSetOrganizationAliasRequest(request, this.client.settings)
1032
- ),
1033
- headers: jsonContentHeaders,
1034
- method: "PUT",
1035
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/alias`
1036
- },
1037
- unmarshalOrganization
1038
- );
1039
- /**
1040
- * Get your Organization's IAM information.
1041
- *
1042
- * @param request - The request {@link GetOrganizationRequest}
1043
- * @returns A Promise of Organization
1044
- */
1045
- getOrganization = (request = {}) => this.client.fetch(
1046
- {
1047
- method: "GET",
1048
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}`
1049
- },
1050
- unmarshalOrganization
1051
- );
1052
- /**
1053
- * Set your Organization's allowed login methods.. Set your Organization's allowed login methods.
1054
- *
1055
- * @param request - The request {@link UpdateOrganizationLoginMethodsRequest}
1056
- * @returns A Promise of Organization
1057
- */
1058
- updateOrganizationLoginMethods = (request = {}) => this.client.fetch(
1059
- {
1060
- body: JSON.stringify(
1061
- marshalUpdateOrganizationLoginMethodsRequest(
1062
- request,
1063
- this.client.settings
1064
- )
1065
- ),
1066
- headers: jsonContentHeaders,
1067
- method: "PATCH",
1068
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/login-methods`
1069
- },
1070
- unmarshalOrganization
1071
- );
1072
- /**
1073
- * Get SAML Identity Provider configuration of an Organization.
1074
- *
1075
- * @param request - The request {@link GetOrganizationSamlRequest}
1076
- * @returns A Promise of Saml
1077
- */
1078
- getOrganizationSaml = (request = {}) => this.client.fetch(
1079
- {
1080
- method: "GET",
1081
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`
1082
- },
1083
- unmarshalSaml
1084
- );
1085
- /**
1086
- * Enable SAML Identity Provider for an Organization.
1087
- *
1088
- * @param request - The request {@link EnableOrganizationSamlRequest}
1089
- * @returns A Promise of Saml
1090
- */
1091
- enableOrganizationSaml = (request = {}) => this.client.fetch(
1092
- {
1093
- body: "{}",
1094
- headers: jsonContentHeaders,
1095
- method: "POST",
1096
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`
1097
- },
1098
- unmarshalSaml
1099
- );
1100
- /**
1101
- * Update SAML Identity Provider configuration.
1102
- *
1103
- * @param request - The request {@link UpdateSamlRequest}
1104
- * @returns A Promise of Saml
1105
- */
1106
- updateSaml = (request) => this.client.fetch(
1107
- {
1108
- body: JSON.stringify(
1109
- marshalUpdateSamlRequest(request, this.client.settings)
1110
- ),
1111
- headers: jsonContentHeaders,
1112
- method: "PATCH",
1113
- path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
1114
- },
1115
- unmarshalSaml
1116
- );
1117
- /**
1118
- * Disable SAML Identity Provider for an Organization.
1119
- *
1120
- * @param request - The request {@link DeleteSamlRequest}
1121
- */
1122
- deleteSaml = (request) => this.client.fetch({
1123
- method: "DELETE",
1124
- path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
1125
- });
1126
- /**
1127
- * Parse SAML xml metadata file.
1128
- *
1129
- * @param request - The request {@link ParseSamlMetadataRequest}
1130
- * @returns A Promise of ParseSamlMetadataResponse
1131
- */
1132
- parseSamlMetadata = async (request) => this.client.fetch(
1133
- {
1134
- body: JSON.stringify(
1135
- await marshalParseSamlMetadataRequest(request, this.client.settings)
1136
- ),
1137
- headers: jsonContentHeaders,
1138
- method: "POST",
1139
- path: `/iam/v1alpha1/parse-saml-metadata`
1140
- },
1141
- unmarshalParseSamlMetadataResponse
1142
- );
1143
- /**
1144
- * List SAML certificates.
1145
- *
1146
- * @param request - The request {@link ListSamlCertificatesRequest}
1147
- * @returns A Promise of ListSamlCertificatesResponse
1148
- */
1149
- listSamlCertificates = (request) => this.client.fetch(
1150
- {
1151
- method: "GET",
1152
- path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}/certificates`
1153
- },
1154
- unmarshalListSamlCertificatesResponse
1155
- );
1156
- /**
1157
- * Add a SAML certificate.
1158
- *
1159
- * @param request - The request {@link AddSamlCertificateRequest}
1160
- * @returns A Promise of SamlCertificate
1161
- */
1162
- addSamlCertificate = (request) => this.client.fetch(
1163
- {
1164
- body: JSON.stringify(
1165
- marshalAddSamlCertificateRequest(request, this.client.settings)
1166
- ),
1167
- headers: jsonContentHeaders,
1168
- method: "POST",
1169
- path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}/certificates`
1170
- },
1171
- unmarshalSamlCertificate
1172
- );
1173
- /**
1174
- * Delete a SAML certificate.
1175
- *
1176
- * @param request - The request {@link DeleteSamlCertificateRequest}
1177
- */
1178
- deleteSamlCertificate = (request) => this.client.fetch({
1179
- method: "DELETE",
1180
- path: `/iam/v1alpha1/saml-certificates/${validatePathParam("certificateId", request.certificateId)}`
1181
- });
1182
- /**
1183
- * Get SCIM configuration of an Organization.
1184
- *
1185
- * @param request - The request {@link GetOrganizationScimRequest}
1186
- * @returns A Promise of Scim
1187
- */
1188
- getOrganizationScim = (request = {}) => this.client.fetch(
1189
- {
1190
- method: "GET",
1191
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`
1192
- },
1193
- unmarshalScim
1194
- );
1195
- /**
1196
- * Enable SCIM for an Organization.
1197
- *
1198
- * @param request - The request {@link EnableOrganizationScimRequest}
1199
- * @returns A Promise of Scim
1200
- */
1201
- enableOrganizationScim = (request = {}) => this.client.fetch(
1202
- {
1203
- body: "{}",
1204
- headers: jsonContentHeaders,
1205
- method: "POST",
1206
- path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`
1207
- },
1208
- unmarshalScim
1209
- );
1210
- /**
1211
- * Disable SCIM for an Organization.
1212
- *
1213
- * @param request - The request {@link DeleteScimRequest}
1214
- */
1215
- deleteScim = (request) => this.client.fetch({
1216
- method: "DELETE",
1217
- path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}`
1218
- });
1219
- pageOfListScimTokens = (request) => this.client.fetch(
1220
- {
1221
- method: "GET",
1222
- path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}/tokens`,
1223
- urlParams: urlParams(
1224
- ["order_by", request.orderBy],
1225
- ["page", request.page],
1226
- [
1227
- "page_size",
1228
- request.pageSize ?? this.client.settings.defaultPageSize
1229
- ]
1230
- )
1231
- },
1232
- unmarshalListScimTokensResponse
1233
- );
1234
- /**
1235
- * List SCIM tokens.
1236
- *
1237
- * @param request - The request {@link ListScimTokensRequest}
1238
- * @returns A Promise of ListScimTokensResponse
1239
- */
1240
- listScimTokens = (request) => enrichForPagination("scimTokens", this.pageOfListScimTokens, request);
1241
- /**
1242
- * Create a SCIM token.
1243
- *
1244
- * @param request - The request {@link CreateScimTokenRequest}
1245
- * @returns A Promise of CreateScimTokenResponse
1246
- */
1247
- createScimToken = (request) => this.client.fetch(
1248
- {
1249
- method: "POST",
1250
- path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}/tokens`
1251
- },
1252
- unmarshalCreateScimTokenResponse
1253
- );
1254
- /**
1255
- * Delete a SCIM token.
1256
- *
1257
- * @param request - The request {@link DeleteScimTokenRequest}
1258
- */
1259
- deleteScimToken = (request) => this.client.fetch({
1260
- method: "DELETE",
1261
- path: `/iam/v1alpha1/scim-tokens/${validatePathParam("tokenId", request.tokenId)}`
1262
- });
1263
- /**
1264
- * Start registering a WebAuthn authenticator.
1265
- *
1266
- * @param request - The request {@link StartUserWebAuthnRegistrationRequest}
1267
- * @returns A Promise of StartUserWebAuthnRegistrationResponse
1268
- */
1269
- startUserWebAuthnRegistration = (request) => this.client.fetch(
1270
- {
1271
- method: "POST",
1272
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/start-webauthn-registration`,
1273
- urlParams: urlParams(["origin", request.origin])
1274
- },
1275
- unmarshalStartUserWebAuthnRegistrationResponse
1276
- );
1277
- /**
1278
- * Complete a WebAuthen authenticator registration.
1279
- *
1280
- * @param request - The request {@link FinishUserWebAuthnRegistrationRequest}
1281
- * @returns A Promise of FinishUserWebAuthnRegistrationResponse
1282
- */
1283
- finishUserWebAuthnRegistration = (request) => this.client.fetch(
1284
- {
1285
- body: JSON.stringify(
1286
- marshalFinishUserWebAuthnRegistrationRequest(
1287
- request,
1288
- this.client.settings
1289
- )
1290
- ),
1291
- headers: jsonContentHeaders,
1292
- method: "POST",
1293
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/finish-webauthn-registration`
1294
- },
1295
- unmarshalFinishUserWebAuthnRegistrationResponse
1296
- );
1297
- pageOfListUserWebAuthnAuthenticators = (request) => this.client.fetch(
1298
- {
1299
- method: "GET",
1300
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/webauthn-authenticators`,
1301
- urlParams: urlParams(
1302
- ["order_by", request.orderBy],
1303
- ["page", request.page],
1304
- [
1305
- "page_size",
1306
- request.pageSize ?? this.client.settings.defaultPageSize
1307
- ]
1308
- )
1309
- },
1310
- unmarshalListUserWebAuthnAuthenticatorsResponse
1311
- );
1312
- /**
1313
- * List all of a user's WebAuthn Authenticators.
1314
- *
1315
- * @param request - The request {@link ListUserWebAuthnAuthenticatorsRequest}
1316
- * @returns A Promise of ListUserWebAuthnAuthenticatorsResponse
1317
- */
1318
- listUserWebAuthnAuthenticators = (request) => enrichForPagination(
1319
- "authenticators",
1320
- this.pageOfListUserWebAuthnAuthenticators,
1321
- request
1322
- );
1323
- /**
1324
- * Update a WebAuthn authenticator.
1325
- *
1326
- * @param request - The request {@link UpdateWebAuthnAuthenticatorRequest}
1327
- * @returns A Promise of WebAuthnAuthenticator
1328
- */
1329
- updateWebAuthnAuthenticator = (request) => this.client.fetch(
1330
- {
1331
- body: JSON.stringify(
1332
- marshalUpdateWebAuthnAuthenticatorRequest(
1333
- request,
1334
- this.client.settings
1335
- )
1336
- ),
1337
- headers: jsonContentHeaders,
1338
- method: "PATCH",
1339
- path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
1340
- },
1341
- unmarshalWebAuthnAuthenticator
1342
- );
1343
- /**
1344
- * Delete a WebAuthn authenticator.
1345
- *
1346
- * @param request - The request {@link DeleteWebAuthnAuthenticatorRequest}
1347
- */
1348
- deleteWebAuthnAuthenticator = (request) => this.client.fetch({
1349
- body: "{}",
1350
- headers: jsonContentHeaders,
1351
- method: "DELETE",
1352
- path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
1353
- });
1354
- }
1355
- export {
1356
- API
1
+ import { 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 } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, resolveOneOf, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * IAM API.
6
+
7
+ This API allows you to manage Identity and Access Management (IAM) across your Scaleway Organizations, Projects and resources.
8
+ */
9
+ var API$1 = class extends API {
10
+ pageOfListSSHKeys = (request = {}) => this.client.fetch({
11
+ method: "GET",
12
+ path: `/iam/v1alpha1/ssh-keys`,
13
+ urlParams: urlParams(["disabled", request.disabled], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
14
+ }, unmarshalListSSHKeysResponse);
15
+ /**
16
+ * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `organization_id`, `name`, `project_id` and `disabled`.
17
+ *
18
+ * @param request - The request {@link ListSSHKeysRequest}
19
+ * @returns A Promise of ListSSHKeysResponse
20
+ */
21
+ listSSHKeys = (request = {}) => enrichForPagination("sshKeys", this.pageOfListSSHKeys, request);
22
+ /**
23
+ * Create an SSH key. Add a new SSH key to a Scaleway Project. You must specify the `name`, `public_key` and `project_id`.
24
+ *
25
+ * @param request - The request {@link CreateSSHKeyRequest}
26
+ * @returns A Promise of SSHKey
27
+ */
28
+ createSSHKey = (request) => this.client.fetch({
29
+ body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),
30
+ headers: jsonContentHeaders,
31
+ method: "POST",
32
+ path: `/iam/v1alpha1/ssh-keys`
33
+ }, unmarshalSSHKey);
34
+ /**
35
+ * Get an SSH key. Retrieve information about a given SSH key, specified by the `ssh_key_id` parameter. The SSH key's full details, including `id`, `name`, `public_key`, and `project_id` are returned in the response.
36
+ *
37
+ * @param request - The request {@link GetSSHKeyRequest}
38
+ * @returns A Promise of SSHKey
39
+ */
40
+ getSSHKey = (request) => this.client.fetch({
41
+ method: "GET",
42
+ path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
43
+ }, unmarshalSSHKey);
44
+ /**
45
+ * Update an SSH key. Update the parameters of an SSH key, including `name` and `disable`.
46
+ *
47
+ * @param request - The request {@link UpdateSSHKeyRequest}
48
+ * @returns A Promise of SSHKey
49
+ */
50
+ updateSSHKey = (request) => this.client.fetch({
51
+ body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),
52
+ headers: jsonContentHeaders,
53
+ method: "PATCH",
54
+ path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
55
+ }, unmarshalSSHKey);
56
+ /**
57
+ * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`. Deleting an SSH is permanent, and cannot be undone. Note that you might need to update any configurations that used the SSH key.
58
+ *
59
+ * @param request - The request {@link DeleteSSHKeyRequest}
60
+ */
61
+ deleteSSHKey = (request) => this.client.fetch({
62
+ method: "DELETE",
63
+ path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
64
+ });
65
+ pageOfListUsers = (request = {}) => this.client.fetch({
66
+ method: "GET",
67
+ path: `/iam/v1alpha1/users`,
68
+ urlParams: urlParams(["mfa", request.mfa], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tag", request.tag], ["type", request.type], ["user_ids", request.userIds])
69
+ }, unmarshalListUsersResponse);
70
+ /**
71
+ * List users of an Organization. List the users of an Organization. By default, the users listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `user_ids`.
72
+ *
73
+ * @param request - The request {@link ListUsersRequest}
74
+ * @returns A Promise of ListUsersResponse
75
+ */
76
+ listUsers = (request = {}) => enrichForPagination("users", this.pageOfListUsers, request);
77
+ /**
78
+ * Get a given user. Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `mfa` are returned in the response.
79
+ *
80
+ * @param request - The request {@link GetUserRequest}
81
+ * @returns A Promise of User
82
+ */
83
+ getUser = (request) => this.client.fetch({
84
+ method: "GET",
85
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
86
+ }, unmarshalUser);
87
+ /**
88
+ * Update a user. Update the parameters of a user, including `tags`.
89
+ *
90
+ * @param request - The request {@link UpdateUserRequest}
91
+ * @returns A Promise of User
92
+ */
93
+ updateUser = (request) => this.client.fetch({
94
+ body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),
95
+ headers: jsonContentHeaders,
96
+ method: "PATCH",
97
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
98
+ }, unmarshalUser);
99
+ /**
100
+ * Delete a guest user from an Organization. Remove a user from an Organization in which they are a guest. You must define the `user_id` in your request. Note that removing a user from an Organization automatically deletes their API keys, and any policies directly attached to them become orphaned.
101
+ *
102
+ * @param request - The request {@link DeleteUserRequest}
103
+ */
104
+ deleteUser = (request) => this.client.fetch({
105
+ method: "DELETE",
106
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
107
+ });
108
+ /**
109
+ * Create a new user. Create a new user. You must define the `organization_id` in your request. If you are adding a member, enter the member's details. If you are adding a guest, you must define the `email` and not add the member attribute.
110
+ *
111
+ * @param request - The request {@link CreateUserRequest}
112
+ * @returns A Promise of User
113
+ */
114
+ createUser = (request = {}) => this.client.fetch({
115
+ body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),
116
+ headers: jsonContentHeaders,
117
+ method: "POST",
118
+ path: `/iam/v1alpha1/users`
119
+ }, unmarshalUser);
120
+ /**
121
+ * Update an user's username.. Update an user's username.
122
+ *
123
+ * @param request - The request {@link UpdateUserUsernameRequest}
124
+ * @returns A Promise of User
125
+ */
126
+ updateUserUsername = (request) => this.client.fetch({
127
+ body: JSON.stringify(marshalUpdateUserUsernameRequest(request, this.client.settings)),
128
+ headers: jsonContentHeaders,
129
+ method: "POST",
130
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/update-username`
131
+ }, unmarshalUser);
132
+ /**
133
+ * Update an user's password.. Update an user's password.
134
+ *
135
+ * @param request - The request {@link UpdateUserPasswordRequest}
136
+ * @returns A Promise of User
137
+ */
138
+ updateUserPassword = (request) => this.client.fetch({
139
+ body: JSON.stringify(marshalUpdateUserPasswordRequest(request, this.client.settings)),
140
+ headers: jsonContentHeaders,
141
+ method: "POST",
142
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/update-password`
143
+ }, unmarshalUser);
144
+ /**
145
+ * Create a MFA OTP.. Create a MFA OTP.
146
+ *
147
+ * @param request - The request {@link CreateUserMFAOTPRequest}
148
+ * @returns A Promise of MFAOTP
149
+ */
150
+ createUserMFAOTP = (request) => this.client.fetch({
151
+ body: "{}",
152
+ headers: jsonContentHeaders,
153
+ method: "POST",
154
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/mfa-otp`
155
+ }, unmarshalMFAOTP);
156
+ /**
157
+ * Validate a MFA OTP.. Validate a MFA OTP.
158
+ *
159
+ * @param request - The request {@link ValidateUserMFAOTPRequest}
160
+ * @returns A Promise of ValidateUserMFAOTPResponse
161
+ */
162
+ validateUserMFAOTP = (request) => this.client.fetch({
163
+ body: JSON.stringify(marshalValidateUserMFAOTPRequest(request, this.client.settings)),
164
+ headers: jsonContentHeaders,
165
+ method: "POST",
166
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/validate-mfa-otp`
167
+ }, unmarshalValidateUserMFAOTPResponse);
168
+ /**
169
+ * Delete a MFA OTP.. Delete a MFA OTP.
170
+ *
171
+ * @param request - The request {@link DeleteUserMFAOTPRequest}
172
+ */
173
+ deleteUserMFAOTP = (request) => this.client.fetch({
174
+ body: "{}",
175
+ headers: jsonContentHeaders,
176
+ method: "DELETE",
177
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/mfa-otp`
178
+ });
179
+ /**
180
+ * Lock a member. Lock a member. A locked member cannot log in or use API keys until the locked status is removed.
181
+ *
182
+ * @param request - The request {@link LockUserRequest}
183
+ * @returns A Promise of User
184
+ */
185
+ lockUser = (request) => this.client.fetch({
186
+ body: "{}",
187
+ headers: jsonContentHeaders,
188
+ method: "POST",
189
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/lock`
190
+ }, unmarshalUser);
191
+ /**
192
+ * Unlock a member.
193
+ *
194
+ * @param request - The request {@link UnlockUserRequest}
195
+ * @returns A Promise of User
196
+ */
197
+ unlockUser = (request) => this.client.fetch({
198
+ body: "{}",
199
+ headers: jsonContentHeaders,
200
+ method: "POST",
201
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/unlock`
202
+ }, unmarshalUser);
203
+ /**
204
+ * List grace periods of a member. List the grace periods of a member.
205
+ *
206
+ * @param request - The request {@link ListGracePeriodsRequest}
207
+ * @returns A Promise of ListGracePeriodsResponse
208
+ */
209
+ listGracePeriods = (request = {}) => this.client.fetch({
210
+ method: "GET",
211
+ path: `/iam/v1alpha1/grace-periods`,
212
+ urlParams: urlParams(["user_id", request.userId])
213
+ }, unmarshalListGracePeriodsResponse);
214
+ getUserConnections = (request) => this.client.fetch({
215
+ method: "GET",
216
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/connections`
217
+ }, unmarshalGetUserConnectionsResponse);
218
+ initiateUserConnection = (request) => this.client.fetch({
219
+ body: "{}",
220
+ headers: jsonContentHeaders,
221
+ method: "POST",
222
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/initiate-connection`
223
+ }, unmarshalInitiateUserConnectionResponse);
224
+ joinUserConnection = (request) => this.client.fetch({
225
+ body: JSON.stringify(marshalJoinUserConnectionRequest(request, this.client.settings)),
226
+ headers: jsonContentHeaders,
227
+ method: "POST",
228
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/join-connection`
229
+ });
230
+ removeUserConnection = (request) => this.client.fetch({
231
+ body: JSON.stringify(marshalRemoveUserConnectionRequest(request, this.client.settings)),
232
+ headers: jsonContentHeaders,
233
+ method: "POST",
234
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/remove-connection`
235
+ });
236
+ pageOfListApplications = (request = {}) => this.client.fetch({
237
+ method: "GET",
238
+ path: `/iam/v1alpha1/applications`,
239
+ urlParams: urlParams(["application_ids", request.applicationIds], ["editable", request.editable], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tag", request.tag])
240
+ }, unmarshalListApplicationsResponse);
241
+ /**
242
+ * List applications of an Organization. List the applications of an Organization. By default, the applications listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `application_ids`.
243
+ *
244
+ * @param request - The request {@link ListApplicationsRequest}
245
+ * @returns A Promise of ListApplicationsResponse
246
+ */
247
+ listApplications = (request = {}) => enrichForPagination("applications", this.pageOfListApplications, request);
248
+ /**
249
+ * Create a new application. Create a new application. You must define the `name` parameter in the request.
250
+ *
251
+ * @param request - The request {@link CreateApplicationRequest}
252
+ * @returns A Promise of Application
253
+ */
254
+ createApplication = (request) => this.client.fetch({
255
+ body: JSON.stringify(marshalCreateApplicationRequest(request, this.client.settings)),
256
+ headers: jsonContentHeaders,
257
+ method: "POST",
258
+ path: `/iam/v1alpha1/applications`
259
+ }, unmarshalApplication);
260
+ /**
261
+ * Get a given application. Retrieve information about an application, specified by the `application_id` parameter. The application's full details, including `id`, `email`, `organization_id`, `status` and `two_factor_enabled` are returned in the response.
262
+ *
263
+ * @param request - The request {@link GetApplicationRequest}
264
+ * @returns A Promise of Application
265
+ */
266
+ getApplication = (request) => this.client.fetch({
267
+ method: "GET",
268
+ path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
269
+ }, unmarshalApplication);
270
+ /**
271
+ * Update an application. Update the parameters of an application, including `name` and `description`.
272
+ *
273
+ * @param request - The request {@link UpdateApplicationRequest}
274
+ * @returns A Promise of Application
275
+ */
276
+ updateApplication = (request) => this.client.fetch({
277
+ body: JSON.stringify(marshalUpdateApplicationRequest(request, this.client.settings)),
278
+ headers: jsonContentHeaders,
279
+ method: "PATCH",
280
+ path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
281
+ }, unmarshalApplication);
282
+ /**
283
+ * Delete an application. Delete an application. Note that this action is irreversible and will automatically delete the application's API keys. Policies attached to users and applications via this group will no longer apply.
284
+ *
285
+ * @param request - The request {@link DeleteApplicationRequest}
286
+ */
287
+ deleteApplication = (request) => this.client.fetch({
288
+ method: "DELETE",
289
+ path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
290
+ });
291
+ pageOfListGroups = (request = {}) => this.client.fetch({
292
+ method: "GET",
293
+ path: `/iam/v1alpha1/groups`,
294
+ urlParams: urlParams(["application_ids", request.applicationIds], ["group_ids", request.groupIds], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tag", request.tag], ["user_ids", request.userIds])
295
+ }, unmarshalListGroupsResponse);
296
+ /**
297
+ * List groups. List groups. By default, the groups listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters to filter your query. Use `user_ids` or `application_ids` to list all groups certain users or applications belong to.
298
+ *
299
+ * @param request - The request {@link ListGroupsRequest}
300
+ * @returns A Promise of ListGroupsResponse
301
+ */
302
+ listGroups = (request = {}) => enrichForPagination("groups", this.pageOfListGroups, request);
303
+ /**
304
+ * Create a group. Create a new group. You must define the `name` and `organization_id` parameters in the request.
305
+ *
306
+ * @param request - The request {@link CreateGroupRequest}
307
+ * @returns A Promise of Group
308
+ */
309
+ createGroup = (request) => this.client.fetch({
310
+ body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)),
311
+ headers: jsonContentHeaders,
312
+ method: "POST",
313
+ path: `/iam/v1alpha1/groups`
314
+ }, unmarshalGroup);
315
+ /**
316
+ * Get a group. Retrieve information about a given group, specified by the `group_id` parameter. The group's full details, including `user_ids` and `application_ids` are returned in the response.
317
+ *
318
+ * @param request - The request {@link GetGroupRequest}
319
+ * @returns A Promise of Group
320
+ */
321
+ getGroup = (request) => this.client.fetch({
322
+ method: "GET",
323
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
324
+ }, unmarshalGroup);
325
+ /**
326
+ * Update a group. Update the parameters of group, including `name` and `description`.
327
+ *
328
+ * @param request - The request {@link UpdateGroupRequest}
329
+ * @returns A Promise of Group
330
+ */
331
+ updateGroup = (request) => this.client.fetch({
332
+ body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)),
333
+ headers: jsonContentHeaders,
334
+ method: "PATCH",
335
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
336
+ }, unmarshalGroup);
337
+ /**
338
+ * Overwrite users and applications of a group. Overwrite users and applications configuration in a group. Any information that you add using this command will overwrite the previous configuration.
339
+ *
340
+ * @param request - The request {@link SetGroupMembersRequest}
341
+ * @returns A Promise of Group
342
+ */
343
+ setGroupMembers = (request) => this.client.fetch({
344
+ body: JSON.stringify(marshalSetGroupMembersRequest(request, this.client.settings)),
345
+ headers: jsonContentHeaders,
346
+ method: "PUT",
347
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/members`
348
+ }, unmarshalGroup);
349
+ /**
350
+ * Add a user or an application to a group. Add a user or an application to a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only add one of each per request.
351
+ *
352
+ * @param request - The request {@link AddGroupMemberRequest}
353
+ * @returns A Promise of Group
354
+ */
355
+ addGroupMember = (request) => this.client.fetch({
356
+ body: JSON.stringify(marshalAddGroupMemberRequest(request, this.client.settings)),
357
+ headers: jsonContentHeaders,
358
+ method: "POST",
359
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/add-member`
360
+ }, unmarshalGroup);
361
+ /**
362
+ * Add multiple users and applications to a group. Add multiple users and applications to a group in a single call. You can specify an array of `user_id`s and `application_id`s. Note that any existing users and applications in the group will remain. To add new users/applications and delete pre-existing ones, use the [Overwrite users and applications of a group](#path-groups-overwrite-users-and-applications-of-a-group) method.
363
+ *
364
+ * @param request - The request {@link AddGroupMembersRequest}
365
+ * @returns A Promise of Group
366
+ */
367
+ addGroupMembers = (request) => this.client.fetch({
368
+ body: JSON.stringify(marshalAddGroupMembersRequest(request, this.client.settings)),
369
+ headers: jsonContentHeaders,
370
+ method: "POST",
371
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/add-members`
372
+ }, unmarshalGroup);
373
+ /**
374
+ * Remove a user or an application from a group. Remove a user or an application from a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only remove one of each per request. Removing a user from a group means that any permissions given to them via the group (i.e. from an attached policy) will no longer apply. Be sure you want to remove these permissions from the user before proceeding.
375
+ *
376
+ * @param request - The request {@link RemoveGroupMemberRequest}
377
+ * @returns A Promise of Group
378
+ */
379
+ removeGroupMember = (request) => this.client.fetch({
380
+ body: JSON.stringify(marshalRemoveGroupMemberRequest(request, this.client.settings)),
381
+ headers: jsonContentHeaders,
382
+ method: "POST",
383
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}/remove-member`
384
+ }, unmarshalGroup);
385
+ /**
386
+ * Delete a group. Delete a group. Note that this action is irreversible and could delete permissions for group members. Policies attached to users and applications via this group will no longer apply.
387
+ *
388
+ * @param request - The request {@link DeleteGroupRequest}
389
+ */
390
+ deleteGroup = (request) => this.client.fetch({
391
+ method: "DELETE",
392
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
393
+ });
394
+ pageOfListPolicies = (request = {}) => this.client.fetch({
395
+ method: "GET",
396
+ path: `/iam/v1alpha1/policies`,
397
+ urlParams: urlParams(["application_ids", request.applicationIds], ["editable", request.editable], ["group_ids", request.groupIds], ["no_principal", request.noPrincipal], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["policy_ids", request.policyIds], ["policy_name", request.policyName], ["tag", request.tag], ["user_ids", request.userIds])
398
+ }, unmarshalListPoliciesResponse);
399
+ /**
400
+ * List policies of an Organization. List the policies of an Organization. By default, the policies listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters to filter your query, such as `user_ids`, `groups_ids`, `application_ids`, and `policy_name`.
401
+ *
402
+ * @param request - The request {@link ListPoliciesRequest}
403
+ * @returns A Promise of ListPoliciesResponse
404
+ */
405
+ listPolicies = (request = {}) => enrichForPagination("policies", this.pageOfListPolicies, request);
406
+ /**
407
+ * Create a new policy. Create a new application. You must define the `name` parameter in the request. You can specify parameters such as `user_id`, `groups_id`, `application_id`, `no_principal`, `rules` and its child attributes.
408
+ *
409
+ * @param request - The request {@link CreatePolicyRequest}
410
+ * @returns A Promise of Policy
411
+ */
412
+ createPolicy = (request) => this.client.fetch({
413
+ body: JSON.stringify(marshalCreatePolicyRequest(request, this.client.settings)),
414
+ headers: jsonContentHeaders,
415
+ method: "POST",
416
+ path: `/iam/v1alpha1/policies`
417
+ }, unmarshalPolicy);
418
+ /**
419
+ * Get an existing policy. Retrieve information about a policy, specified by the `policy_id` parameter. The policy's full details, including `id`, `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets` are returned in the response.
420
+ *
421
+ * @param request - The request {@link GetPolicyRequest}
422
+ * @returns A Promise of Policy
423
+ */
424
+ getPolicy = (request) => this.client.fetch({
425
+ method: "GET",
426
+ path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
427
+ }, unmarshalPolicy);
428
+ /**
429
+ * Update an existing policy. Update the parameters of a policy, including `name`, `description`, `user_id`, `group_id`, `application_id` and `no_principal`.
430
+ *
431
+ * @param request - The request {@link UpdatePolicyRequest}
432
+ * @returns A Promise of Policy
433
+ */
434
+ updatePolicy = (request) => this.client.fetch({
435
+ body: JSON.stringify(marshalUpdatePolicyRequest(request, this.client.settings)),
436
+ headers: jsonContentHeaders,
437
+ method: "PATCH",
438
+ path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
439
+ }, unmarshalPolicy);
440
+ /**
441
+ * Delete a policy. Delete a policy. You must define specify the `policy_id` parameter in your request. Note that when deleting a policy, all permissions it gives to its principal (user, group or application) will be revoked.
442
+ *
443
+ * @param request - The request {@link DeletePolicyRequest}
444
+ */
445
+ deletePolicy = (request) => this.client.fetch({
446
+ method: "DELETE",
447
+ path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
448
+ });
449
+ /**
450
+ * Clone a policy. Clone a policy. You must define specify the `policy_id` parameter in your request.
451
+ *
452
+ * @param request - The request {@link ClonePolicyRequest}
453
+ * @returns A Promise of Policy
454
+ */
455
+ clonePolicy = (request) => this.client.fetch({
456
+ body: "{}",
457
+ headers: jsonContentHeaders,
458
+ method: "POST",
459
+ path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}/clone`
460
+ }, unmarshalPolicy);
461
+ /**
462
+ * Set rules of a given policy. Overwrite the rules of a given policy. Any information that you add using this command will overwrite the previous configuration. If you include some of the rules you already had in your previous configuration in your new one, but you change their order, the new order of display will apply. While policy rules are ordered, they have no impact on the access logic of IAM because rules are allow-only.
463
+ *
464
+ * @param request - The request {@link SetRulesRequest}
465
+ * @returns A Promise of SetRulesResponse
466
+ */
467
+ setRules = (request) => this.client.fetch({
468
+ body: JSON.stringify(marshalSetRulesRequest(request, this.client.settings)),
469
+ headers: jsonContentHeaders,
470
+ method: "PUT",
471
+ path: `/iam/v1alpha1/rules`
472
+ }, unmarshalSetRulesResponse);
473
+ pageOfListRules = (request) => this.client.fetch({
474
+ method: "GET",
475
+ path: `/iam/v1alpha1/rules`,
476
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["policy_id", request.policyId])
477
+ }, unmarshalListRulesResponse);
478
+ /**
479
+ * List rules of a given policy. List the rules of a given policy. By default, the rules listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `policy_id` in the query path of your request.
480
+ *
481
+ * @param request - The request {@link ListRulesRequest}
482
+ * @returns A Promise of ListRulesResponse
483
+ */
484
+ listRules = (request) => enrichForPagination("rules", this.pageOfListRules, request);
485
+ pageOfListPermissionSets = (request = {}) => this.client.fetch({
486
+ method: "GET",
487
+ path: `/iam/v1alpha1/permission-sets`,
488
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
489
+ }, unmarshalListPermissionSetsResponse);
490
+ /**
491
+ * List permission sets. List permission sets available for given Organization. You must define the `organization_id` in the query path of your request.
492
+ *
493
+ * @param request - The request {@link ListPermissionSetsRequest}
494
+ * @returns A Promise of ListPermissionSetsResponse
495
+ */
496
+ listPermissionSets = (request = {}) => enrichForPagination("permissionSets", this.pageOfListPermissionSets, request);
497
+ pageOfListAPIKeys = (request = {}) => this.client.fetch({
498
+ method: "GET",
499
+ path: `/iam/v1alpha1/api-keys`,
500
+ urlParams: urlParams(["access_key", request.accessKey], ["access_keys", request.accessKeys], ["bearer_id", request.bearerId], ["bearer_type", request.bearerType], ["description", request.description], ["editable", request.editable], ["expired", request.expired], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
501
+ param: "application_id",
502
+ value: request.applicationId
503
+ }, {
504
+ param: "user_id",
505
+ value: request.userId
506
+ }])))
507
+ }, unmarshalListAPIKeysResponse);
508
+ /**
509
+ * List API keys. List API keys. By default, the API keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `editable`, `expired`, `access_key` and `bearer_id`.
510
+ *
511
+ * @param request - The request {@link ListAPIKeysRequest}
512
+ * @returns A Promise of ListAPIKeysResponse
513
+ */
514
+ listAPIKeys = (request = {}) => enrichForPagination("apiKeys", this.pageOfListAPIKeys, request);
515
+ /**
516
+ * Create an API key. Create an API key. You must specify the `application_id` or the `user_id` and the description. You can also specify the `default_project_id`, which is the Project ID of your preferred Project, to use with Object Storage. The `access_key` and `secret_key` values are returned in the response. Note that the secret key is only shown once. Make sure that you copy and store both keys somewhere safe.
517
+ *
518
+ * @param request - The request {@link CreateAPIKeyRequest}
519
+ * @returns A Promise of APIKey
520
+ */
521
+ createAPIKey = (request) => this.client.fetch({
522
+ body: JSON.stringify(marshalCreateAPIKeyRequest(request, this.client.settings)),
523
+ headers: jsonContentHeaders,
524
+ method: "POST",
525
+ path: `/iam/v1alpha1/api-keys`
526
+ }, unmarshalAPIKey);
527
+ /**
528
+ * Get an API key. Retrieve information about an API key, specified by the `access_key` parameter. The API key's details, including either the `user_id` or `application_id` of its bearer are returned in the response. Note that the string value for the `secret_key` is nullable, and therefore is not displayed in the response. The `secret_key` value is only displayed upon API key creation.
529
+ *
530
+ * @param request - The request {@link GetAPIKeyRequest}
531
+ * @returns A Promise of APIKey
532
+ */
533
+ getAPIKey = (request) => this.client.fetch({
534
+ method: "GET",
535
+ path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
536
+ }, unmarshalAPIKey);
537
+ /**
538
+ * Update an API key. Update the parameters of an API key, including `default_project_id` and `description`.
539
+ *
540
+ * @param request - The request {@link UpdateAPIKeyRequest}
541
+ * @returns A Promise of APIKey
542
+ */
543
+ updateAPIKey = (request) => this.client.fetch({
544
+ body: JSON.stringify(marshalUpdateAPIKeyRequest(request, this.client.settings)),
545
+ headers: jsonContentHeaders,
546
+ method: "PATCH",
547
+ path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
548
+ }, unmarshalAPIKey);
549
+ /**
550
+ * Delete an API key. Delete an API key. Note that this action is irreversible and cannot be undone. Make sure you update any configurations using the API keys you delete.
551
+ *
552
+ * @param request - The request {@link DeleteAPIKeyRequest}
553
+ */
554
+ deleteAPIKey = (request) => this.client.fetch({
555
+ method: "DELETE",
556
+ path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
557
+ });
558
+ pageOfListQuota = (request = {}) => this.client.fetch({
559
+ method: "GET",
560
+ path: `/iam/v1alpha1/quota`,
561
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["quotum_names", request.quotumNames])
562
+ }, unmarshalListQuotaResponse);
563
+ /**
564
+ * List all quotas in the Organization. List all product and features quota for an Organization, with their associated limits. By default, the quota listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request.
565
+ *
566
+ * @param request - The request {@link ListQuotaRequest}
567
+ * @returns A Promise of ListQuotaResponse
568
+ */
569
+ listQuota = (request = {}) => enrichForPagination("quota", this.pageOfListQuota, request);
570
+ /**
571
+ * Get a quota in the Organization. Retrieve information about a resource quota, specified by the `quotum_name` parameter. The quota's `limit`, or whether it is unlimited, is returned in the response.
572
+ *
573
+ * @param request - The request {@link GetQuotumRequest}
574
+ * @returns A Promise of Quotum
575
+ */
576
+ getQuotum = (request) => this.client.fetch({
577
+ method: "GET",
578
+ path: `/iam/v1alpha1/quota/${validatePathParam("quotumName", request.quotumName)}`,
579
+ urlParams: urlParams(["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId])
580
+ }, unmarshalQuotum);
581
+ pageOfListJWTs = (request) => this.client.fetch({
582
+ method: "GET",
583
+ path: `/iam/v1alpha1/jwts`,
584
+ urlParams: urlParams(["audience_id", request.audienceId], ["expired", request.expired], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
585
+ }, unmarshalListJWTsResponse);
586
+ /**
587
+ * List JWTs.
588
+ *
589
+ * @param request - The request {@link ListJWTsRequest}
590
+ * @returns A Promise of ListJWTsResponse
591
+ */
592
+ listJWTs = (request) => enrichForPagination("jwts", this.pageOfListJWTs, request);
593
+ /**
594
+ * Create a JWT.
595
+ *
596
+ * @param request - The request {@link CreateJWTRequest}
597
+ * @returns A Promise of EncodedJWT
598
+ */
599
+ createJWT = (request) => this.client.fetch({
600
+ body: JSON.stringify(marshalCreateJWTRequest(request, this.client.settings)),
601
+ headers: jsonContentHeaders,
602
+ method: "POST",
603
+ path: `/iam/v1alpha1/jwts`
604
+ }, unmarshalEncodedJWT);
605
+ /**
606
+ * Get a JWT.
607
+ *
608
+ * @param request - The request {@link GetJWTRequest}
609
+ * @returns A Promise of JWT
610
+ */
611
+ getJWT = (request) => this.client.fetch({
612
+ method: "GET",
613
+ path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
614
+ }, unmarshalJWT);
615
+ /**
616
+ * Delete a JWT.
617
+ *
618
+ * @param request - The request {@link DeleteJWTRequest}
619
+ */
620
+ deleteJWT = (request) => this.client.fetch({
621
+ method: "DELETE",
622
+ path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
623
+ });
624
+ pageOfListLogs = (request = {}) => this.client.fetch({
625
+ method: "GET",
626
+ path: `/iam/v1alpha1/logs`,
627
+ urlParams: urlParams(["action", request.action], ["created_after", request.createdAfter], ["created_before", request.createdBefore], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["resource_type", request.resourceType], ["search", request.search])
628
+ }, unmarshalListLogsResponse);
629
+ /**
630
+ * List logs. List logs available for given Organization. You must define the `organization_id` in the query path of your request.
631
+ *
632
+ * @param request - The request {@link ListLogsRequest}
633
+ * @returns A Promise of ListLogsResponse
634
+ */
635
+ listLogs = (request = {}) => enrichForPagination("logs", this.pageOfListLogs, request);
636
+ /**
637
+ * Get a log. Retrieve information about a log, specified by the `log_id` parameter. The log's full details, including `id`, `ip`, `user_agent`, `action`, `bearer_id`, `resource_type` and `resource_id` are returned in the response.
638
+ *
639
+ * @param request - The request {@link GetLogRequest}
640
+ * @returns A Promise of Log
641
+ */
642
+ getLog = (request) => this.client.fetch({
643
+ method: "GET",
644
+ path: `/iam/v1alpha1/logs/${validatePathParam("logId", request.logId)}`
645
+ }, unmarshalLog);
646
+ /**
647
+ * Get security settings of an Organization. Retrieve information about the security settings of an Organization, specified by the `organization_id` parameter.
648
+ *
649
+ * @param request - The request {@link GetOrganizationSecuritySettingsRequest}
650
+ * @returns A Promise of OrganizationSecuritySettings
651
+ */
652
+ getOrganizationSecuritySettings = (request = {}) => this.client.fetch({
653
+ method: "GET",
654
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`
655
+ }, unmarshalOrganizationSecuritySettings);
656
+ /**
657
+ * Update the security settings of an Organization.
658
+ *
659
+ * @param request - The request {@link UpdateOrganizationSecuritySettingsRequest}
660
+ * @returns A Promise of OrganizationSecuritySettings
661
+ */
662
+ updateOrganizationSecuritySettings = (request = {}) => this.client.fetch({
663
+ body: JSON.stringify(marshalUpdateOrganizationSecuritySettingsRequest(request, this.client.settings)),
664
+ headers: jsonContentHeaders,
665
+ method: "PATCH",
666
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`
667
+ }, unmarshalOrganizationSecuritySettings);
668
+ /**
669
+ * Set your Organization's alias.. This will fail if an alias has already been defined. Please contact support if you need to change your Organization's alias.
670
+ *
671
+ * @param request - The request {@link SetOrganizationAliasRequest}
672
+ * @returns A Promise of Organization
673
+ */
674
+ setOrganizationAlias = (request) => this.client.fetch({
675
+ body: JSON.stringify(marshalSetOrganizationAliasRequest(request, this.client.settings)),
676
+ headers: jsonContentHeaders,
677
+ method: "PUT",
678
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/alias`
679
+ }, unmarshalOrganization);
680
+ /**
681
+ * Get your Organization's IAM information.
682
+ *
683
+ * @param request - The request {@link GetOrganizationRequest}
684
+ * @returns A Promise of Organization
685
+ */
686
+ getOrganization = (request = {}) => this.client.fetch({
687
+ method: "GET",
688
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}`
689
+ }, unmarshalOrganization);
690
+ /**
691
+ * Set your Organization's allowed login methods.. Set your Organization's allowed login methods.
692
+ *
693
+ * @param request - The request {@link UpdateOrganizationLoginMethodsRequest}
694
+ * @returns A Promise of Organization
695
+ */
696
+ updateOrganizationLoginMethods = (request = {}) => this.client.fetch({
697
+ body: JSON.stringify(marshalUpdateOrganizationLoginMethodsRequest(request, this.client.settings)),
698
+ headers: jsonContentHeaders,
699
+ method: "PATCH",
700
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/login-methods`
701
+ }, unmarshalOrganization);
702
+ /**
703
+ * Get SAML Identity Provider configuration of an Organization.
704
+ *
705
+ * @param request - The request {@link GetOrganizationSamlRequest}
706
+ * @returns A Promise of Saml
707
+ */
708
+ getOrganizationSaml = (request = {}) => this.client.fetch({
709
+ method: "GET",
710
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`
711
+ }, unmarshalSaml);
712
+ /**
713
+ * Enable SAML Identity Provider for an Organization.
714
+ *
715
+ * @param request - The request {@link EnableOrganizationSamlRequest}
716
+ * @returns A Promise of Saml
717
+ */
718
+ enableOrganizationSaml = (request = {}) => this.client.fetch({
719
+ body: "{}",
720
+ headers: jsonContentHeaders,
721
+ method: "POST",
722
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`
723
+ }, unmarshalSaml);
724
+ /**
725
+ * Update SAML Identity Provider configuration.
726
+ *
727
+ * @param request - The request {@link UpdateSamlRequest}
728
+ * @returns A Promise of Saml
729
+ */
730
+ updateSaml = (request) => this.client.fetch({
731
+ body: JSON.stringify(marshalUpdateSamlRequest(request, this.client.settings)),
732
+ headers: jsonContentHeaders,
733
+ method: "PATCH",
734
+ path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
735
+ }, unmarshalSaml);
736
+ /**
737
+ * Disable SAML Identity Provider for an Organization.
738
+ *
739
+ * @param request - The request {@link DeleteSamlRequest}
740
+ */
741
+ deleteSaml = (request) => this.client.fetch({
742
+ method: "DELETE",
743
+ path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
744
+ });
745
+ /**
746
+ * Parse SAML xml metadata file.
747
+ *
748
+ * @param request - The request {@link ParseSamlMetadataRequest}
749
+ * @returns A Promise of ParseSamlMetadataResponse
750
+ */
751
+ parseSamlMetadata = async (request) => this.client.fetch({
752
+ body: JSON.stringify(await marshalParseSamlMetadataRequest(request, this.client.settings)),
753
+ headers: jsonContentHeaders,
754
+ method: "POST",
755
+ path: `/iam/v1alpha1/parse-saml-metadata`
756
+ }, unmarshalParseSamlMetadataResponse);
757
+ /**
758
+ * List SAML certificates.
759
+ *
760
+ * @param request - The request {@link ListSamlCertificatesRequest}
761
+ * @returns A Promise of ListSamlCertificatesResponse
762
+ */
763
+ listSamlCertificates = (request) => this.client.fetch({
764
+ method: "GET",
765
+ path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}/certificates`
766
+ }, unmarshalListSamlCertificatesResponse);
767
+ /**
768
+ * Add a SAML certificate.
769
+ *
770
+ * @param request - The request {@link AddSamlCertificateRequest}
771
+ * @returns A Promise of SamlCertificate
772
+ */
773
+ addSamlCertificate = (request) => this.client.fetch({
774
+ body: JSON.stringify(marshalAddSamlCertificateRequest(request, this.client.settings)),
775
+ headers: jsonContentHeaders,
776
+ method: "POST",
777
+ path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}/certificates`
778
+ }, unmarshalSamlCertificate);
779
+ /**
780
+ * Delete a SAML certificate.
781
+ *
782
+ * @param request - The request {@link DeleteSamlCertificateRequest}
783
+ */
784
+ deleteSamlCertificate = (request) => this.client.fetch({
785
+ method: "DELETE",
786
+ path: `/iam/v1alpha1/saml-certificates/${validatePathParam("certificateId", request.certificateId)}`
787
+ });
788
+ /**
789
+ * Get SCIM configuration of an Organization.
790
+ *
791
+ * @param request - The request {@link GetOrganizationScimRequest}
792
+ * @returns A Promise of Scim
793
+ */
794
+ getOrganizationScim = (request = {}) => this.client.fetch({
795
+ method: "GET",
796
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`
797
+ }, unmarshalScim);
798
+ /**
799
+ * Enable SCIM for an Organization.
800
+ *
801
+ * @param request - The request {@link EnableOrganizationScimRequest}
802
+ * @returns A Promise of Scim
803
+ */
804
+ enableOrganizationScim = (request = {}) => this.client.fetch({
805
+ body: "{}",
806
+ headers: jsonContentHeaders,
807
+ method: "POST",
808
+ path: `/iam/v1alpha1/organizations/${validatePathParam("organizationId", request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`
809
+ }, unmarshalScim);
810
+ /**
811
+ * Disable SCIM for an Organization.
812
+ *
813
+ * @param request - The request {@link DeleteScimRequest}
814
+ */
815
+ deleteScim = (request) => this.client.fetch({
816
+ method: "DELETE",
817
+ path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}`
818
+ });
819
+ pageOfListScimTokens = (request) => this.client.fetch({
820
+ method: "GET",
821
+ path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}/tokens`,
822
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
823
+ }, unmarshalListScimTokensResponse);
824
+ /**
825
+ * List SCIM tokens.
826
+ *
827
+ * @param request - The request {@link ListScimTokensRequest}
828
+ * @returns A Promise of ListScimTokensResponse
829
+ */
830
+ listScimTokens = (request) => enrichForPagination("scimTokens", this.pageOfListScimTokens, request);
831
+ /**
832
+ * Create a SCIM token.
833
+ *
834
+ * @param request - The request {@link CreateScimTokenRequest}
835
+ * @returns A Promise of CreateScimTokenResponse
836
+ */
837
+ createScimToken = (request) => this.client.fetch({
838
+ method: "POST",
839
+ path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}/tokens`
840
+ }, unmarshalCreateScimTokenResponse);
841
+ /**
842
+ * Delete a SCIM token.
843
+ *
844
+ * @param request - The request {@link DeleteScimTokenRequest}
845
+ */
846
+ deleteScimToken = (request) => this.client.fetch({
847
+ method: "DELETE",
848
+ path: `/iam/v1alpha1/scim-tokens/${validatePathParam("tokenId", request.tokenId)}`
849
+ });
850
+ /**
851
+ * Start registering a WebAuthn authenticator.
852
+ *
853
+ * @param request - The request {@link StartUserWebAuthnRegistrationRequest}
854
+ * @returns A Promise of StartUserWebAuthnRegistrationResponse
855
+ */
856
+ startUserWebAuthnRegistration = (request) => this.client.fetch({
857
+ method: "POST",
858
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/start-webauthn-registration`,
859
+ urlParams: urlParams(["origin", request.origin])
860
+ }, unmarshalStartUserWebAuthnRegistrationResponse);
861
+ /**
862
+ * Complete a WebAuthen authenticator registration.
863
+ *
864
+ * @param request - The request {@link FinishUserWebAuthnRegistrationRequest}
865
+ * @returns A Promise of FinishUserWebAuthnRegistrationResponse
866
+ */
867
+ finishUserWebAuthnRegistration = (request) => this.client.fetch({
868
+ body: JSON.stringify(marshalFinishUserWebAuthnRegistrationRequest(request, this.client.settings)),
869
+ headers: jsonContentHeaders,
870
+ method: "POST",
871
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/finish-webauthn-registration`
872
+ }, unmarshalFinishUserWebAuthnRegistrationResponse);
873
+ pageOfListUserWebAuthnAuthenticators = (request) => this.client.fetch({
874
+ method: "GET",
875
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/webauthn-authenticators`,
876
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
877
+ }, unmarshalListUserWebAuthnAuthenticatorsResponse);
878
+ /**
879
+ * List all of a user's WebAuthn Authenticators.
880
+ *
881
+ * @param request - The request {@link ListUserWebAuthnAuthenticatorsRequest}
882
+ * @returns A Promise of ListUserWebAuthnAuthenticatorsResponse
883
+ */
884
+ listUserWebAuthnAuthenticators = (request) => enrichForPagination("authenticators", this.pageOfListUserWebAuthnAuthenticators, request);
885
+ /**
886
+ * Update a WebAuthn authenticator.
887
+ *
888
+ * @param request - The request {@link UpdateWebAuthnAuthenticatorRequest}
889
+ * @returns A Promise of WebAuthnAuthenticator
890
+ */
891
+ updateWebAuthnAuthenticator = (request) => this.client.fetch({
892
+ body: JSON.stringify(marshalUpdateWebAuthnAuthenticatorRequest(request, this.client.settings)),
893
+ headers: jsonContentHeaders,
894
+ method: "PATCH",
895
+ path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
896
+ }, unmarshalWebAuthnAuthenticator);
897
+ /**
898
+ * Delete a WebAuthn authenticator.
899
+ *
900
+ * @param request - The request {@link DeleteWebAuthnAuthenticatorRequest}
901
+ */
902
+ deleteWebAuthnAuthenticator = (request) => this.client.fetch({
903
+ body: "{}",
904
+ headers: jsonContentHeaders,
905
+ method: "DELETE",
906
+ path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
907
+ });
1357
908
  };
909
+ export { API$1 as API };