OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Lists the work requests in a compartment.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Lists the work requests in a compartment.
Lists the work requests in a compartment .
public async Task<ListWorkRequestsResponse> ListWorkRequests(ListWorkRequestsRequest request)
        {
            var uriStr = $"{GetEndPointNoneVersion("workRequests", this.Region)}?{request.GetOptionQuery()}";
            var uri = new Uri(uriStr);
            using (var webResponse = await this.RestClientAsync.Get(uri, new HttpRequestHeaderParam { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new ListWorkRequestsResponse()
                {
                    Items = JsonSerializer.Deserialize<List<WorkRequestSummary>>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    OpcNextPage = webResponse.Headers.Get("opc-next-page")
                };
            }
        }
public async Task < ListWorkRequestsResponse > ListWorkRequests ( ListWorkRequestsRequest request ) { var uriStr = $" { GetEndPointNoneVersion ( " " , this . Region ) } ? { request . GetOptionQuery ( ) } " ; var uri = new Uri ( uriStr ) ; using ( var webResponse = await this . RestClientAsync . Get ( uri , new HttpRequestHeaderParam { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new ListWorkRequestsResponse ( ) { Items = JsonSerializer . Deserialize < List < WorkRequestSummary > > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , OpcNextPage = webResponse . Headers . Get ( " " ) } ; } }
Lists the work requests in a compartment.
Lists the work requests in a compartment .
None
request
ListWorkRequestsRequest
None