public UploadResponse(IngestionControllerResponse response) { if (response.Success) { Result = ResponseCodes.Success; } else { Result = ResponseCodes.NoResult; _errors.Add(new ApiError("video-upload", response.Status)); } }
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); }