OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Updates the state of the specified user.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Updates the state of the specified user.
Updates the state of the specified user .
public UpdateUserStateResponse UpdateUserState(UpdateUserStateRequest request)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.Users, this.Region)}/{request.UserId}/state/");
            using (var webResponse = this.RestClient.Put(uri, request.UpdateStateDetails, new HttpRequestHeaderParam() { IfMatch = request.IfMatch }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new UpdateUserStateResponse()
                {
                    User = JsonSerializer.Deserialize<UserDetails>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    ETag = webResponse.Headers.Get("ETag")
                };
            }
        }
public UpdateUserStateResponse UpdateUserState ( UpdateUserStateRequest request ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . Users , this . Region ) } / { request . UserId } /state/ " ) ; using ( var webResponse = this . RestClient . Put ( uri , request . UpdateStateDetails , new HttpRequestHeaderParam ( ) { IfMatch = request . IfMatch } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new UpdateUserStateResponse ( ) { User = JsonSerializer . Deserialize < UserDetails > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , ETag = webResponse . Headers . Get ( " " ) } ; } }
Updates the state of the specified user.
Updates the state of the specified user .
None
request
UpdateUserStateRequest
None