<commit_before>using System;
using System.Collections.Generic;
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using StockportContentApi.Model;

namespace StockportContentApi.Http
{
    public class HttpResponse
    {
        public readonly HttpStatusCode StatusCode;
        private readonly object _content;
        public readonly string Error;

        private HttpResponse(HttpStatusCode statusCode, object content, string error)
        {
            StatusCode = statusCode;
            _content = content;
            Error = error;
        }

        public static HttpResponse Successful(object content)
        {
            return new HttpResponse(HttpStatusCode.OK, content, string.Empty);
        }

        public static HttpResponse Failure(HttpStatusCode statusCode, string error)
        {
            return new HttpResponse(statusCode, null, error);
        }
        
        public IActionResult CreateResult()
        {
            switch (StatusCode)
            {
                case HttpStatusCode.OK:
                    return new ObjectResult(_content);
                case HttpStatusCode.BadRequest:
                    return new BadRequestObjectResult(Error);
                case HttpStatusCode.NotFound:
                    return new NotFoundObjectResult(Error);
                case HttpStatusCode.InternalServerError:
                    return new StatusCodeResult((int) HttpStatusCode.InternalServerError);
                case HttpStatusCode.BadGateway:
                    return new StatusCodeResult((int)HttpStatusCode.BadGateway);
                default:
                    return new EmptyResult();
            }
        }

        internal static HttpResponse Failure(HttpStatusCode notFound)
        {
            throw new NotImplementedException();
        }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }

        public T Get<T>()
        {
            return (T) _content;<commit_msg>David/Lydia - Removing accidental method<commit_after>using System;
using System.Collections.Generic;
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using StockportContentApi.Model;

namespace StockportContentApi.Http
{
    public class HttpResponse
    {
        public readonly HttpStatusCode StatusCode;
        private readonly object _content;
        public readonly string Error;

        private HttpResponse(HttpStatusCode statusCode, object content, string error)
        {
            StatusCode = statusCode;
            _content = content;
            Error = error;
        }

        public static HttpResponse Successful(object content)
        {
            return new HttpResponse(HttpStatusCode.OK, content, string.Empty);
        }

        public static HttpResponse Failure(HttpStatusCode statusCode, string error)
        {
            return new HttpResponse(statusCode, null, error);
        }
        
        public IActionResult CreateResult()
        {
            switch (StatusCode)
            {
                case HttpStatusCode.OK:
                    return new ObjectResult(_content);
                case HttpStatusCode.BadRequest:
                    return new BadRequestObjectResult(Error);
                case HttpStatusCode.NotFound:
                    return new NotFoundObjectResult(Error);
                case HttpStatusCode.InternalServerError:
                    return new StatusCodeResult((int) HttpStatusCode.InternalServerError);
                case HttpStatusCode.BadGateway:
                    return new StatusCodeResult((int)HttpStatusCode.BadGateway);
                default:
                    return new EmptyResult();
            }
        }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }

        public T Get<T>()
        {
            return (T) _content;
{'fraction_non_alphanumeric': 0.059863601919676684, 'fraction_numerical': 0.0, 'mean_word_length': 1.861271676300578, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6977266', 'n_tokens_mistral': 883, 'n_tokens_neox': 876, 'n_words': 232}