@scaleway/sdk-iam 2.1.1 → 2.3.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,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { AddGroupMemberRequest, AddGroupMembersRequest, AddSamlCertificateRequest, APIKey, Application, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateScimTokenRequest, CreateScimTokenResponse, CreateSSHKeyRequest, CreateUserMFAOTPRequest, CreateUserRequest, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSamlCertificateRequest, DeleteSamlRequest, DeleteScimRequest, DeleteScimTokenRequest, DeleteSSHKeyRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, EnableOrganizationSamlRequest, EnableOrganizationScimRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetOrganizationRequest, GetOrganizationSamlRequest, GetOrganizationScimRequest, GetOrganizationSecuritySettingsRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserConnectionsRequest, GetUserConnectionsResponse, GetUserRequest, Group, InitiateUserConnectionRequest, InitiateUserConnectionResponse, JoinUserConnectionRequest, JWT, ListAPIKeysRequest, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsResponse, ListGracePeriodsRequest, ListGracePeriodsResponse, ListGroupsRequest, ListGroupsResponse, ListJWTsRequest, ListJWTsResponse, ListLogsRequest, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesResponse, ListQuotaRequest, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSamlCertificatesRequest, ListSamlCertificatesResponse, ListScimTokensRequest, ListScimTokensResponse, ListSSHKeysRequest, ListSSHKeysResponse, ListUsersRequest, ListUsersResponse, LockUserRequest, Log, MFAOTP, Organization, OrganizationSecuritySettings, ParseSamlMetadataRequest, ParseSamlMetadataResponse, Policy, Quotum, RemoveGroupMemberRequest, RemoveUserConnectionRequest, Saml, SamlCertificate, Scim, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, SetRulesResponse, SSHKey, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSamlRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, UpdateUserUsernameRequest, User, ValidateUserMFAOTPRequest, ValidateUserMFAOTPResponse } from './types.gen.js';
2
+ import type { AddGroupMemberRequest, AddGroupMembersRequest, AddSamlCertificateRequest, APIKey, Application, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateScimTokenRequest, CreateScimTokenResponse, CreateSSHKeyRequest, CreateUserMFAOTPRequest, CreateUserRequest, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSamlCertificateRequest, DeleteSamlRequest, DeleteScimRequest, DeleteScimTokenRequest, DeleteSSHKeyRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, DeleteWebAuthnAuthenticatorRequest, EnableOrganizationSamlRequest, EnableOrganizationScimRequest, EncodedJWT, FinishUserWebAuthnRegistrationRequest, FinishUserWebAuthnRegistrationResponse, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetOrganizationRequest, GetOrganizationSamlRequest, GetOrganizationScimRequest, GetOrganizationSecuritySettingsRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserConnectionsRequest, GetUserConnectionsResponse, GetUserRequest, Group, InitiateUserConnectionRequest, InitiateUserConnectionResponse, JoinUserConnectionRequest, JWT, ListAPIKeysRequest, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsResponse, ListGracePeriodsRequest, ListGracePeriodsResponse, ListGroupsRequest, ListGroupsResponse, ListJWTsRequest, ListJWTsResponse, ListLogsRequest, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesResponse, ListQuotaRequest, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSamlCertificatesRequest, ListSamlCertificatesResponse, ListScimTokensRequest, ListScimTokensResponse, ListSSHKeysRequest, ListSSHKeysResponse, ListUsersRequest, ListUsersResponse, ListUserWebAuthnAuthenticatorsRequest, ListUserWebAuthnAuthenticatorsResponse, LockUserRequest, Log, MFAOTP, Organization, OrganizationSecuritySettings, ParseSamlMetadataRequest, ParseSamlMetadataResponse, Policy, Quotum, RemoveGroupMemberRequest, RemoveUserConnectionRequest, Saml, SamlCertificate, Scim, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, SetRulesResponse, SSHKey, StartUserWebAuthnRegistrationRequest, StartUserWebAuthnRegistrationResponse, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSamlRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, UpdateUserUsernameRequest, UpdateWebAuthnAuthenticatorRequest, User, ValidateUserMFAOTPRequest, ValidateUserMFAOTPResponse, WebAuthnAuthenticator } from './types.gen.js';
3
3
  /**
4
4
  * IAM API.
5
5
 
@@ -557,4 +557,42 @@ export declare class API extends ParentAPI {
557
557
  * @param request - The request {@link DeleteScimTokenRequest}
558
558
  */
559
559
  deleteScimToken: (request: Readonly<DeleteScimTokenRequest>) => Promise<void>;
560
+ /**
561
+ * Start registering a WebAuthn authenticator.
562
+ *
563
+ * @param request - The request {@link StartUserWebAuthnRegistrationRequest}
564
+ * @returns A Promise of StartUserWebAuthnRegistrationResponse
565
+ */
566
+ startUserWebAuthnRegistration: (request: Readonly<StartUserWebAuthnRegistrationRequest>) => Promise<StartUserWebAuthnRegistrationResponse>;
567
+ /**
568
+ * Complete a WebAuthen authenticator registration.
569
+ *
570
+ * @param request - The request {@link FinishUserWebAuthnRegistrationRequest}
571
+ * @returns A Promise of FinishUserWebAuthnRegistrationResponse
572
+ */
573
+ finishUserWebAuthnRegistration: (request: Readonly<FinishUserWebAuthnRegistrationRequest>) => Promise<FinishUserWebAuthnRegistrationResponse>;
574
+ protected pageOfListUserWebAuthnAuthenticators: (request: Readonly<ListUserWebAuthnAuthenticatorsRequest>) => Promise<ListUserWebAuthnAuthenticatorsResponse>;
575
+ /**
576
+ * List all of a user's WebAuthn Authenticators.
577
+ *
578
+ * @param request - The request {@link ListUserWebAuthnAuthenticatorsRequest}
579
+ * @returns A Promise of ListUserWebAuthnAuthenticatorsResponse
580
+ */
581
+ listUserWebAuthnAuthenticators: (request: Readonly<ListUserWebAuthnAuthenticatorsRequest>) => Promise<ListUserWebAuthnAuthenticatorsResponse> & {
582
+ all: () => Promise<WebAuthnAuthenticator[]>;
583
+ [Symbol.asyncIterator]: () => AsyncGenerator<WebAuthnAuthenticator[], void, void>;
584
+ };
585
+ /**
586
+ * Update a WebAuthn authenticator.
587
+ *
588
+ * @param request - The request {@link UpdateWebAuthnAuthenticatorRequest}
589
+ * @returns A Promise of WebAuthnAuthenticator
590
+ */
591
+ updateWebAuthnAuthenticator: (request: Readonly<UpdateWebAuthnAuthenticatorRequest>) => Promise<WebAuthnAuthenticator>;
592
+ /**
593
+ * Delete a WebAuthn authenticator.
594
+ *
595
+ * @param request - The request {@link DeleteWebAuthnAuthenticatorRequest}
596
+ */
597
+ deleteWebAuthnAuthenticator: (request: Readonly<DeleteWebAuthnAuthenticatorRequest>) => Promise<void>;
560
598
  }
@@ -1,5 +1,5 @@
1
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 } from "./marshalling.gen.js";
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
3
  const jsonContentHeaders = {
4
4
  "Content-Type": "application/json; charset=utf-8"
5
5
  };
@@ -14,7 +14,10 @@ class API extends API$1 {
14
14
  ["order_by", request.orderBy],
15
15
  ["organization_id", request.organizationId],
16
16
  ["page", request.page],
17
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
17
+ [
18
+ "page_size",
19
+ request.pageSize ?? this.client.settings.defaultPageSize
20
+ ],
18
21
  ["project_id", request.projectId]
19
22
  )
20
23
  },
@@ -79,12 +82,10 @@ class API extends API$1 {
79
82
  *
80
83
  * @param request - The request {@link DeleteSSHKeyRequest}
81
84
  */
82
- deleteSSHKey = (request) => this.client.fetch(
83
- {
84
- method: "DELETE",
85
- path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
86
- }
87
- );
85
+ deleteSSHKey = (request) => this.client.fetch({
86
+ method: "DELETE",
87
+ path: `/iam/v1alpha1/ssh-keys/${validatePathParam("sshKeyId", request.sshKeyId)}`
88
+ });
88
89
  pageOfListUsers = (request = {}) => this.client.fetch(
89
90
  {
90
91
  method: "GET",
@@ -92,9 +93,15 @@ class API extends API$1 {
92
93
  urlParams: urlParams(
93
94
  ["mfa", request.mfa],
94
95
  ["order_by", request.orderBy],
95
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
96
+ [
97
+ "organization_id",
98
+ request.organizationId ?? this.client.settings.defaultOrganizationId
99
+ ],
96
100
  ["page", request.page],
97
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
101
+ [
102
+ "page_size",
103
+ request.pageSize ?? this.client.settings.defaultPageSize
104
+ ],
98
105
  ["tag", request.tag],
99
106
  ["type", request.type],
100
107
  ["user_ids", request.userIds]
@@ -144,12 +151,10 @@ class API extends API$1 {
144
151
  *
145
152
  * @param request - The request {@link DeleteUserRequest}
146
153
  */
147
- deleteUser = (request) => this.client.fetch(
148
- {
149
- method: "DELETE",
150
- path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
151
- }
152
- );
154
+ deleteUser = (request) => this.client.fetch({
155
+ method: "DELETE",
156
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}`
157
+ });
153
158
  /**
154
159
  * Create a new user. Create a new user. You must define the `organization_id` in your request. If you are adding a member, enter the member's details. If you are adding a guest, you must define the `email` and not add the member attribute.
155
160
  *
@@ -238,14 +243,12 @@ class API extends API$1 {
238
243
  *
239
244
  * @param request - The request {@link DeleteUserMFAOTPRequest}
240
245
  */
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
- );
246
+ deleteUserMFAOTP = (request) => this.client.fetch({
247
+ body: "{}",
248
+ headers: jsonContentHeaders,
249
+ method: "DELETE",
250
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/mfa-otp`
251
+ });
249
252
  /**
250
253
  * Lock a member. Lock a member. A locked member cannot log in or use API keys until the locked status is removed.
251
254
  *
@@ -286,9 +289,7 @@ class API extends API$1 {
286
289
  {
287
290
  method: "GET",
288
291
  path: `/iam/v1alpha1/grace-periods`,
289
- urlParams: urlParams(
290
- ["user_id", request.userId]
291
- )
292
+ urlParams: urlParams(["user_id", request.userId])
292
293
  },
293
294
  unmarshalListGracePeriodsResponse
294
295
  );
@@ -308,26 +309,22 @@ class API extends API$1 {
308
309
  },
309
310
  unmarshalInitiateUserConnectionResponse
310
311
  );
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
- );
312
+ joinUserConnection = (request) => this.client.fetch({
313
+ body: JSON.stringify(
314
+ marshalJoinUserConnectionRequest(request, this.client.settings)
315
+ ),
316
+ headers: jsonContentHeaders,
317
+ method: "POST",
318
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/join-connection`
319
+ });
320
+ removeUserConnection = (request) => this.client.fetch({
321
+ body: JSON.stringify(
322
+ marshalRemoveUserConnectionRequest(request, this.client.settings)
323
+ ),
324
+ headers: jsonContentHeaders,
325
+ method: "POST",
326
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/remove-connection`
327
+ });
331
328
  pageOfListApplications = (request = {}) => this.client.fetch(
332
329
  {
333
330
  method: "GET",
@@ -337,9 +334,15 @@ class API extends API$1 {
337
334
  ["editable", request.editable],
338
335
  ["name", request.name],
339
336
  ["order_by", request.orderBy],
340
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
337
+ [
338
+ "organization_id",
339
+ request.organizationId ?? this.client.settings.defaultOrganizationId
340
+ ],
341
341
  ["page", request.page],
342
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
342
+ [
343
+ "page_size",
344
+ request.pageSize ?? this.client.settings.defaultPageSize
345
+ ],
343
346
  ["tag", request.tag]
344
347
  )
345
348
  },
@@ -404,12 +407,10 @@ class API extends API$1 {
404
407
  *
405
408
  * @param request - The request {@link DeleteApplicationRequest}
406
409
  */
407
- deleteApplication = (request) => this.client.fetch(
408
- {
409
- method: "DELETE",
410
- path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
411
- }
412
- );
410
+ deleteApplication = (request) => this.client.fetch({
411
+ method: "DELETE",
412
+ path: `/iam/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
413
+ });
413
414
  pageOfListGroups = (request = {}) => this.client.fetch(
414
415
  {
415
416
  method: "GET",
@@ -419,9 +420,15 @@ class API extends API$1 {
419
420
  ["group_ids", request.groupIds],
420
421
  ["name", request.name],
421
422
  ["order_by", request.orderBy],
422
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
423
+ [
424
+ "organization_id",
425
+ request.organizationId ?? this.client.settings.defaultOrganizationId
426
+ ],
423
427
  ["page", request.page],
424
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
428
+ [
429
+ "page_size",
430
+ request.pageSize ?? this.client.settings.defaultPageSize
431
+ ],
425
432
  ["tag", request.tag],
426
433
  ["user_ids", request.userIds]
427
434
  )
@@ -555,12 +562,10 @@ class API extends API$1 {
555
562
  *
556
563
  * @param request - The request {@link DeleteGroupRequest}
557
564
  */
558
- deleteGroup = (request) => this.client.fetch(
559
- {
560
- method: "DELETE",
561
- path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
562
- }
563
- );
565
+ deleteGroup = (request) => this.client.fetch({
566
+ method: "DELETE",
567
+ path: `/iam/v1alpha1/groups/${validatePathParam("groupId", request.groupId)}`
568
+ });
564
569
  pageOfListPolicies = (request = {}) => this.client.fetch(
565
570
  {
566
571
  method: "GET",
@@ -571,9 +576,15 @@ class API extends API$1 {
571
576
  ["group_ids", request.groupIds],
572
577
  ["no_principal", request.noPrincipal],
573
578
  ["order_by", request.orderBy],
574
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
579
+ [
580
+ "organization_id",
581
+ request.organizationId ?? this.client.settings.defaultOrganizationId
582
+ ],
575
583
  ["page", request.page],
576
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
584
+ [
585
+ "page_size",
586
+ request.pageSize ?? this.client.settings.defaultPageSize
587
+ ],
577
588
  ["policy_ids", request.policyIds],
578
589
  ["policy_name", request.policyName],
579
590
  ["tag", request.tag],
@@ -641,12 +652,10 @@ class API extends API$1 {
641
652
  *
642
653
  * @param request - The request {@link DeletePolicyRequest}
643
654
  */
644
- deletePolicy = (request) => this.client.fetch(
645
- {
646
- method: "DELETE",
647
- path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
648
- }
649
- );
655
+ deletePolicy = (request) => this.client.fetch({
656
+ method: "DELETE",
657
+ path: `/iam/v1alpha1/policies/${validatePathParam("policyId", request.policyId)}`
658
+ });
650
659
  /**
651
660
  * Clone a policy. Clone a policy. You must define specify the `policy_id` parameter in your request.
652
661
  *
@@ -685,7 +694,10 @@ class API extends API$1 {
685
694
  path: `/iam/v1alpha1/rules`,
686
695
  urlParams: urlParams(
687
696
  ["page", request.page],
688
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
697
+ [
698
+ "page_size",
699
+ request.pageSize ?? this.client.settings.defaultPageSize
700
+ ],
689
701
  ["policy_id", request.policyId]
690
702
  )
691
703
  },
@@ -704,9 +716,15 @@ class API extends API$1 {
704
716
  path: `/iam/v1alpha1/permission-sets`,
705
717
  urlParams: urlParams(
706
718
  ["order_by", request.orderBy],
707
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
719
+ [
720
+ "organization_id",
721
+ request.organizationId ?? this.client.settings.defaultOrganizationId
722
+ ],
708
723
  ["page", request.page],
709
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
724
+ [
725
+ "page_size",
726
+ request.pageSize ?? this.client.settings.defaultPageSize
727
+ ]
710
728
  )
711
729
  },
712
730
  unmarshalListPermissionSetsResponse
@@ -717,7 +735,11 @@ class API extends API$1 {
717
735
  * @param request - The request {@link ListPermissionSetsRequest}
718
736
  * @returns A Promise of ListPermissionSetsResponse
719
737
  */
720
- listPermissionSets = (request = {}) => enrichForPagination("permissionSets", this.pageOfListPermissionSets, request);
738
+ listPermissionSets = (request = {}) => enrichForPagination(
739
+ "permissionSets",
740
+ this.pageOfListPermissionSets,
741
+ request
742
+ );
721
743
  pageOfListAPIKeys = (request = {}) => this.client.fetch(
722
744
  {
723
745
  method: "GET",
@@ -731,19 +753,21 @@ class API extends API$1 {
731
753
  ["editable", request.editable],
732
754
  ["expired", request.expired],
733
755
  ["order_by", request.orderBy],
734
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
756
+ [
757
+ "organization_id",
758
+ request.organizationId ?? this.client.settings.defaultOrganizationId
759
+ ],
735
760
  ["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
- ]))
761
+ [
762
+ "page_size",
763
+ request.pageSize ?? this.client.settings.defaultPageSize
764
+ ],
765
+ ...Object.entries(
766
+ resolveOneOf([
767
+ { param: "application_id", value: request.applicationId },
768
+ { param: "user_id", value: request.userId }
769
+ ])
770
+ )
747
771
  )
748
772
  },
749
773
  unmarshalListAPIKeysResponse
@@ -807,21 +831,25 @@ class API extends API$1 {
807
831
  *
808
832
  * @param request - The request {@link DeleteAPIKeyRequest}
809
833
  */
810
- deleteAPIKey = (request) => this.client.fetch(
811
- {
812
- method: "DELETE",
813
- path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
814
- }
815
- );
834
+ deleteAPIKey = (request) => this.client.fetch({
835
+ method: "DELETE",
836
+ path: `/iam/v1alpha1/api-keys/${validatePathParam("accessKey", request.accessKey)}`
837
+ });
816
838
  pageOfListQuota = (request = {}) => this.client.fetch(
817
839
  {
818
840
  method: "GET",
819
841
  path: `/iam/v1alpha1/quota`,
820
842
  urlParams: urlParams(
821
843
  ["order_by", request.orderBy],
822
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
844
+ [
845
+ "organization_id",
846
+ request.organizationId ?? this.client.settings.defaultOrganizationId
847
+ ],
823
848
  ["page", request.page],
824
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
849
+ [
850
+ "page_size",
851
+ request.pageSize ?? this.client.settings.defaultPageSize
852
+ ],
825
853
  ["quotum_names", request.quotumNames]
826
854
  )
827
855
  },
@@ -844,9 +872,10 @@ class API extends API$1 {
844
872
  {
845
873
  method: "GET",
846
874
  path: `/iam/v1alpha1/quota/${validatePathParam("quotumName", request.quotumName)}`,
847
- urlParams: urlParams(
848
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId]
849
- )
875
+ urlParams: urlParams([
876
+ "organization_id",
877
+ request.organizationId ?? this.client.settings.defaultOrganizationId
878
+ ])
850
879
  },
851
880
  unmarshalQuotum
852
881
  );
@@ -859,7 +888,10 @@ class API extends API$1 {
859
888
  ["expired", request.expired],
860
889
  ["order_by", request.orderBy],
861
890
  ["page", request.page],
862
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
891
+ [
892
+ "page_size",
893
+ request.pageSize ?? this.client.settings.defaultPageSize
894
+ ]
863
895
  )
864
896
  },
865
897
  unmarshalListJWTsResponse
@@ -906,12 +938,10 @@ class API extends API$1 {
906
938
  *
907
939
  * @param request - The request {@link DeleteJWTRequest}
908
940
  */
909
- deleteJWT = (request) => this.client.fetch(
910
- {
911
- method: "DELETE",
912
- path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
913
- }
914
- );
941
+ deleteJWT = (request) => this.client.fetch({
942
+ method: "DELETE",
943
+ path: `/iam/v1alpha1/jwts/${validatePathParam("jti", request.jti)}`
944
+ });
915
945
  pageOfListLogs = (request = {}) => this.client.fetch(
916
946
  {
917
947
  method: "GET",
@@ -921,9 +951,15 @@ class API extends API$1 {
921
951
  ["created_after", request.createdAfter],
922
952
  ["created_before", request.createdBefore],
923
953
  ["order_by", request.orderBy],
924
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
954
+ [
955
+ "organization_id",
956
+ request.organizationId ?? this.client.settings.defaultOrganizationId
957
+ ],
925
958
  ["page", request.page],
926
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
959
+ [
960
+ "page_size",
961
+ request.pageSize ?? this.client.settings.defaultPageSize
962
+ ],
927
963
  ["resource_type", request.resourceType],
928
964
  ["search", request.search]
929
965
  )
@@ -972,7 +1008,10 @@ class API extends API$1 {
972
1008
  updateOrganizationSecuritySettings = (request = {}) => this.client.fetch(
973
1009
  {
974
1010
  body: JSON.stringify(
975
- marshalUpdateOrganizationSecuritySettingsRequest(request, this.client.settings)
1011
+ marshalUpdateOrganizationSecuritySettingsRequest(
1012
+ request,
1013
+ this.client.settings
1014
+ )
976
1015
  ),
977
1016
  headers: jsonContentHeaders,
978
1017
  method: "PATCH",
@@ -1019,7 +1058,10 @@ class API extends API$1 {
1019
1058
  updateOrganizationLoginMethods = (request = {}) => this.client.fetch(
1020
1059
  {
1021
1060
  body: JSON.stringify(
1022
- marshalUpdateOrganizationLoginMethodsRequest(request, this.client.settings)
1061
+ marshalUpdateOrganizationLoginMethodsRequest(
1062
+ request,
1063
+ this.client.settings
1064
+ )
1023
1065
  ),
1024
1066
  headers: jsonContentHeaders,
1025
1067
  method: "PATCH",
@@ -1077,12 +1119,10 @@ class API extends API$1 {
1077
1119
  *
1078
1120
  * @param request - The request {@link DeleteSamlRequest}
1079
1121
  */
1080
- deleteSaml = (request) => this.client.fetch(
1081
- {
1082
- method: "DELETE",
1083
- path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
1084
- }
1085
- );
1122
+ deleteSaml = (request) => this.client.fetch({
1123
+ method: "DELETE",
1124
+ path: `/iam/v1alpha1/saml/${validatePathParam("samlId", request.samlId)}`
1125
+ });
1086
1126
  /**
1087
1127
  * Parse SAML xml metadata file.
1088
1128
  *
@@ -1135,12 +1175,10 @@ class API extends API$1 {
1135
1175
  *
1136
1176
  * @param request - The request {@link DeleteSamlCertificateRequest}
1137
1177
  */
1138
- deleteSamlCertificate = (request) => this.client.fetch(
1139
- {
1140
- method: "DELETE",
1141
- path: `/iam/v1alpha1/saml-certificates/${validatePathParam("certificateId", request.certificateId)}`
1142
- }
1143
- );
1178
+ deleteSamlCertificate = (request) => this.client.fetch({
1179
+ method: "DELETE",
1180
+ path: `/iam/v1alpha1/saml-certificates/${validatePathParam("certificateId", request.certificateId)}`
1181
+ });
1144
1182
  /**
1145
1183
  * Get SCIM configuration of an Organization.
1146
1184
  *
@@ -1174,12 +1212,10 @@ class API extends API$1 {
1174
1212
  *
1175
1213
  * @param request - The request {@link DeleteScimRequest}
1176
1214
  */
1177
- deleteScim = (request) => this.client.fetch(
1178
- {
1179
- method: "DELETE",
1180
- path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}`
1181
- }
1182
- );
1215
+ deleteScim = (request) => this.client.fetch({
1216
+ method: "DELETE",
1217
+ path: `/iam/v1alpha1/scim/${validatePathParam("scimId", request.scimId)}`
1218
+ });
1183
1219
  pageOfListScimTokens = (request) => this.client.fetch(
1184
1220
  {
1185
1221
  method: "GET",
@@ -1187,7 +1223,10 @@ class API extends API$1 {
1187
1223
  urlParams: urlParams(
1188
1224
  ["order_by", request.orderBy],
1189
1225
  ["page", request.page],
1190
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
1226
+ [
1227
+ "page_size",
1228
+ request.pageSize ?? this.client.settings.defaultPageSize
1229
+ ]
1191
1230
  )
1192
1231
  },
1193
1232
  unmarshalListScimTokensResponse
@@ -1217,12 +1256,101 @@ class API extends API$1 {
1217
1256
  *
1218
1257
  * @param request - The request {@link DeleteScimTokenRequest}
1219
1258
  */
1220
- deleteScimToken = (request) => this.client.fetch(
1259
+ deleteScimToken = (request) => this.client.fetch({
1260
+ method: "DELETE",
1261
+ path: `/iam/v1alpha1/scim-tokens/${validatePathParam("tokenId", request.tokenId)}`
1262
+ });
1263
+ /**
1264
+ * Start registering a WebAuthn authenticator.
1265
+ *
1266
+ * @param request - The request {@link StartUserWebAuthnRegistrationRequest}
1267
+ * @returns A Promise of StartUserWebAuthnRegistrationResponse
1268
+ */
1269
+ startUserWebAuthnRegistration = (request) => this.client.fetch(
1221
1270
  {
1222
- method: "DELETE",
1223
- path: `/iam/v1alpha1/scim-tokens/${validatePathParam("tokenId", request.tokenId)}`
1224
- }
1271
+ method: "POST",
1272
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/start-webauthn-registration`,
1273
+ urlParams: urlParams(["origin", request.origin])
1274
+ },
1275
+ unmarshalStartUserWebAuthnRegistrationResponse
1225
1276
  );
1277
+ /**
1278
+ * Complete a WebAuthen authenticator registration.
1279
+ *
1280
+ * @param request - The request {@link FinishUserWebAuthnRegistrationRequest}
1281
+ * @returns A Promise of FinishUserWebAuthnRegistrationResponse
1282
+ */
1283
+ finishUserWebAuthnRegistration = (request) => this.client.fetch(
1284
+ {
1285
+ body: JSON.stringify(
1286
+ marshalFinishUserWebAuthnRegistrationRequest(
1287
+ request,
1288
+ this.client.settings
1289
+ )
1290
+ ),
1291
+ headers: jsonContentHeaders,
1292
+ method: "POST",
1293
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/finish-webauthn-registration`
1294
+ },
1295
+ unmarshalFinishUserWebAuthnRegistrationResponse
1296
+ );
1297
+ pageOfListUserWebAuthnAuthenticators = (request) => this.client.fetch(
1298
+ {
1299
+ method: "GET",
1300
+ path: `/iam/v1alpha1/users/${validatePathParam("userId", request.userId)}/webauthn-authenticators`,
1301
+ urlParams: urlParams(
1302
+ ["order_by", request.orderBy],
1303
+ ["page", request.page],
1304
+ [
1305
+ "page_size",
1306
+ request.pageSize ?? this.client.settings.defaultPageSize
1307
+ ]
1308
+ )
1309
+ },
1310
+ unmarshalListUserWebAuthnAuthenticatorsResponse
1311
+ );
1312
+ /**
1313
+ * List all of a user's WebAuthn Authenticators.
1314
+ *
1315
+ * @param request - The request {@link ListUserWebAuthnAuthenticatorsRequest}
1316
+ * @returns A Promise of ListUserWebAuthnAuthenticatorsResponse
1317
+ */
1318
+ listUserWebAuthnAuthenticators = (request) => enrichForPagination(
1319
+ "authenticators",
1320
+ this.pageOfListUserWebAuthnAuthenticators,
1321
+ request
1322
+ );
1323
+ /**
1324
+ * Update a WebAuthn authenticator.
1325
+ *
1326
+ * @param request - The request {@link UpdateWebAuthnAuthenticatorRequest}
1327
+ * @returns A Promise of WebAuthnAuthenticator
1328
+ */
1329
+ updateWebAuthnAuthenticator = (request) => this.client.fetch(
1330
+ {
1331
+ body: JSON.stringify(
1332
+ marshalUpdateWebAuthnAuthenticatorRequest(
1333
+ request,
1334
+ this.client.settings
1335
+ )
1336
+ ),
1337
+ headers: jsonContentHeaders,
1338
+ method: "PATCH",
1339
+ path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
1340
+ },
1341
+ unmarshalWebAuthnAuthenticator
1342
+ );
1343
+ /**
1344
+ * Delete a WebAuthn authenticator.
1345
+ *
1346
+ * @param request - The request {@link DeleteWebAuthnAuthenticatorRequest}
1347
+ */
1348
+ deleteWebAuthnAuthenticator = (request) => this.client.fetch({
1349
+ body: "{}",
1350
+ headers: jsonContentHeaders,
1351
+ method: "DELETE",
1352
+ path: `/iam/v1alpha1/webauthn-authenticator/${validatePathParam("authenticatorId", request.authenticatorId)}`
1353
+ });
1226
1354
  }
1227
1355
  export {
1228
1356
  API