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