diff --git a/packages/clients/src/api/iam/v1alpha1/api.gen.ts b/packages/clients/src/api/iam/v1alpha1/api.gen.ts index 0b7018b31..0532fddcb 100644 --- a/packages/clients/src/api/iam/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/api.gen.ts @@ -104,6 +104,7 @@ import type { ListSSHKeysResponse, ListUsersRequest, ListUsersResponse, + LockUserRequest, Log, Policy, Quotum, @@ -112,6 +113,7 @@ import type { SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, + UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, @@ -358,6 +360,41 @@ export class API extends ParentAPI { unmarshalUser, ) + /** + * Lock a user. Lock a user. Note that a locked user cannot log in or use API + * keys until the locked status is removed. + * + * @param request - The request {@link LockUserRequest} + * @returns A Promise of User + */ + lockUser = (request: Readonly) => + this.client.fetch( + { + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/lock`, + }, + unmarshalUser, + ) + + /** + * Unlock a user. + * + * @param request - The request {@link UnlockUserRequest} + * @returns A Promise of User + */ + unlockUser = (request: Readonly) => + this.client.fetch( + { + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/unlock`, + }, + unmarshalUser, + ) + protected pageOfListApplications = ( request: Readonly = {}, ) => diff --git a/packages/clients/src/api/iam/v1alpha1/index.gen.ts b/packages/clients/src/api/iam/v1alpha1/index.gen.ts index f7145a67b..98597f4e7 100644 --- a/packages/clients/src/api/iam/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/index.gen.ts @@ -67,6 +67,7 @@ export type { ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, + LockUserRequest, Log, LogAction, LogResourceType, @@ -81,6 +82,7 @@ export type { SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, + UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, diff --git a/packages/clients/src/api/iam/v1alpha1/types.gen.ts b/packages/clients/src/api/iam/v1alpha1/types.gen.ts index 90be242bd..d54393f37 100644 --- a/packages/clients/src/api/iam/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/types.gen.ts @@ -954,6 +954,10 @@ export interface ListUsersResponse { totalCount: number } +export type LockUserRequest = { + userId: string +} + export type RemoveGroupMemberRequest = { /** ID of the group. */ groupId: string @@ -989,6 +993,10 @@ export interface SetRulesResponse { rules: Rule[] } +export type UnlockUserRequest = { + userId: string +} + export type UpdateAPIKeyRequest = { /** Access key to update. */ accessKey: string