from model.cli.command.OutputModel import AbstractOutput
from model.http.info.content.ResponseModel import ResponseContent


class HttpOutput(AbstractOutput[ResponseContent]):
    def __init__(self, output: ResponseContent):
        super().__init__(output)

    def wrap_output(self) -> str:
        output: str = f"Status Code: {self.get_output().get_status_code()} - {self.get_output().get_status_code().name}\n"
        output += f"Headers:\n[ {self.get_output().get_headers()}]\n"
        output += f"Body:\n{self.get_output().get_body().get_content()}\n"
        return output
