OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Gets the specified compartment's information.
/// </summary>
/// <param name="getRequest"></param>
/// <returns></returns>
Gets the specified compartment's information.
Gets the specified compartment ' s information .
public GetCompartmentResponse GetCompartment(GetCompartmentRequest getRequest)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.Compartment, this.Region)}/{getRequest.CompartmentId}");
            using (var webResponse = this.RestClient.Get(uri))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new GetCompartmentResponse()
                {
                    Compartment = JsonSerializer.Deserialize<Compartment>(response),
                    ETag = webResponse.Headers.Get("ETag"),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id")
                };
            }
        }
public GetCompartmentResponse GetCompartment ( GetCompartmentRequest getRequest ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . Compartment , this . Region ) } / { getRequest . CompartmentId } " ) ; using ( var webResponse = this . RestClient . Get ( uri ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new GetCompartmentResponse ( ) { Compartment = JsonSerializer . Deserialize < Compartment > ( response ) , ETag = webResponse . Headers . Get ( " " ) , OpcRequestId = webResponse . Headers . Get ( " " ) } ; } }
Gets the specified compartment's information.
Gets the specified compartment ' s information .
None
getRequest
GetCompartmentRequest
None