OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Updates the specified compartment's description or name. You can't update the root compartment.
/// </summary>
/// <param name="updateRequest"></param>
/// <returns></returns>
Updates the specified compartment's description or name. You can't update the root compartment.
Updates the specified compartment ' s description or name . You can ' t update the root compartment .
public UpdateCompartmentResponse UpdateCompartment(UpdateCompartmentRequest updateRequest)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.Compartment, this.Region)}/{updateRequest.CompartmentId}");
            using (var webResponse = this.RestClient.Put(uri, updateRequest.UpdateCompartmentDetails, new HttpRequestHeaderParam() { IfMatch = updateRequest.IfMatch }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new UpdateCompartmentResponse()
                {
                    Compartment = JsonSerializer.Deserialize<Compartment>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    ETag = webResponse.Headers.Get("etag")
                };
            }
        }
public UpdateCompartmentResponse UpdateCompartment ( UpdateCompartmentRequest updateRequest ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . Compartment , this . Region ) } / { updateRequest . CompartmentId } " ) ; using ( var webResponse = this . RestClient . Put ( uri , updateRequest . UpdateCompartmentDetails , new HttpRequestHeaderParam ( ) { IfMatch = updateRequest . IfMatch } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new UpdateCompartmentResponse ( ) { Compartment = JsonSerializer . Deserialize < Compartment > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , ETag = webResponse . Headers . Get ( " " ) } ; } }
Updates the specified compartment's description or name.
Updates the specified compartment ' s description or name .
None
updateRequest
UpdateCompartmentRequest
None