@@ -28,6 +28,7 @@ import {
2828 marshalUpdateSSHKeyRequest ,
2929 marshalUpdateUserPasswordRequest ,
3030 marshalUpdateUserRequest ,
31+ marshalUpdateUserUsernameRequest ,
3132 unmarshalAPIKey ,
3233 unmarshalApplication ,
3334 unmarshalEncodedJWT ,
@@ -129,6 +130,7 @@ import type {
129130 UpdateSSHKeyRequest ,
130131 UpdateUserPasswordRequest ,
131132 UpdateUserRequest ,
133+ UpdateUserUsernameRequest ,
132134 User ,
133135} from './types.gen'
134136
@@ -355,6 +357,26 @@ export class API extends ParentAPI {
355357 unmarshalUser ,
356358 )
357359
360+ /**
361+ * Update an user's username. Private Beta feature.. Update an user's
362+ * username. Private Beta feature.
363+ *
364+ * @param request - The request {@link UpdateUserUsernameRequest}
365+ * @returns A Promise of User
366+ */
367+ updateUserUsername = ( request : Readonly < UpdateUserUsernameRequest > ) =>
368+ this . client . fetch < User > (
369+ {
370+ body : JSON . stringify (
371+ marshalUpdateUserUsernameRequest ( request , this . client . settings ) ,
372+ ) ,
373+ headers : jsonContentHeaders ,
374+ method : 'POST' ,
375+ path : `/iam/v1alpha1/users/${ validatePathParam ( 'userId' , request . userId ) } /update-username` ,
376+ } ,
377+ unmarshalUser ,
378+ )
379+
358380 /**
359381 * Update an user's password. Private Beta feature.. Update an user's
360382 * password. Private Beta feature.
0 commit comments