OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Gets the status of the work request for the given ID.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Gets the status of the work request for the given ID.
Gets the status of the work request for the given ID .
public async Task<GetWorkRequestResponse> GetWorkRequest(GetWorkRequestRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion("workRequests", this.Region)}/{request.WorkRequestId}");
            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 GetWorkRequestResponse()
                {
                    WorkRequest = JsonSerializer.Deserialize<WorkRequestDetails>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    RetryAfter = webResponse.Headers.Get("retry-after")
                };
            }
        }
public async Task < GetWorkRequestResponse > GetWorkRequest ( GetWorkRequestRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( " " , this . Region ) } / { request . WorkRequestId } " ) ; 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 GetWorkRequestResponse ( ) { WorkRequest = JsonSerializer . Deserialize < WorkRequestDetails > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , RetryAfter = webResponse . Headers . Get ( " " ) } ; } }
Gets the status of the work request for the given ID.
Gets the status of the work request for the given ID .
None
request
GetWorkRequestRequest
None