OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Deletes the specified compartment. The compartment must be empty.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Deletes the specified compartment. The compartment must be empty.
Deletes the specified compartment . The compartment must be empty .
public DeleteCompartmentResponse DeleteCompartment(DeleteCompartmentRequest request)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.Compartment, this.Region)}/{request.CompartmentId}");
            using (var webResponse = this.RestClient.Delete(uri, new HttpRequestHeaderParam() { IfMatch = request.IfMatch }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new DeleteCompartmentResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcWorkRequestId = webResponse.Headers.Get("opc-work-request-id")
                };
            }
        }
public DeleteCompartmentResponse DeleteCompartment ( DeleteCompartmentRequest request ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . Compartment , this . Region ) } / { request . CompartmentId } " ) ; using ( var webResponse = this . RestClient . Delete ( uri , new HttpRequestHeaderParam ( ) { IfMatch = request . IfMatch } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new DeleteCompartmentResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcWorkRequestId = webResponse . Headers . Get ( " " ) } ; } }
Deletes the specified compartment.
Deletes the specified compartment .
None
request
DeleteCompartmentRequest
None