示例#1
0
 public UploadResponse(IngestionControllerResponse response)
 {
     if (response.Success)
     {
         Result = ResponseCodes.Success;
     }
     else
     {
         Result = ResponseCodes.NoResult;
         _errors.Add(new ApiError("video-upload", response.Status));
     }
 }
示例#2
0
        private async Task <IngestionControllerResponse> ProcessUploadVideoResponse(HttpResponseMessage response)
        {
            IngestionControllerResponse videoUploadResponse;

            if (response.IsSuccessStatusCode)
            {
                var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

                videoUploadResponse = JsonConvert.DeserializeObject <IngestionControllerResponse>(responseContent);
            }
            else
            {
                videoUploadResponse = new IngestionControllerResponse
                {
                    Status  = VideoUploadResponseMessage(response.StatusCode, response.ReasonPhrase),
                    Success = false
                };
            }
            videoUploadResponse.HttpStatusCode = response.StatusCode;
            return(videoUploadResponse);
        }