(
    parsed_document: str,
    model_id: str,
    section_name: str,
    model_info: ModelInfo,
    code_formatter: CodeFormatter,
)
return model_file_contents
:param parsed_document: OpenApi parsed document
    :param model_id: instance or shared
    :param section_name: init or instances
    :param model_info: Information to build the model file
    :param code_formatter:
:param parsed_document: OpenApi parsed document
    :param model_id: instance or shared
    :param section_name: init or instances
    :param model_info: Information to build the model file
    :param code_formatter:
: param parsed_document : OpenApi parsed document : param model_id : instance or shared : param section_name : init or instances : param model_info : Information to build the model file : param code_formatter :
def build_model_file(
    parsed_document: str,
    model_id: str,
    section_name: str,
    model_info: ModelInfo,
    code_formatter: CodeFormatter,
):
    """
    :param parsed_document: OpenApi parsed document
    :param model_id: instance or shared
    :param section_name: init or instances
    :param model_info: Information to build the model file
    :param code_formatter:
    """
    # Whether or not there are options with default values
    options_with_defaults = len(model_info.defaults_file_lines) > 0
    model_file_lines = parsed_document.splitlines()
    _add_imports(model_file_lines, options_with_defaults, len(model_info.deprecation_data))

    if model_id in model_info.deprecation_data:
        model_file_lines += _define_deprecation_functions(model_id, section_name)

    model_file_lines += _define_validator_functions(model_id, model_info.validator_data)

    model_file_lines.append('')
    model_file_contents = '\n'.join(model_file_lines)
    if any(len(line) > 120 for line in model_file_lines):
        model_file_contents = code_formatter.apply_black(model_file_contents)
    return model_file_contents
def build_model_file ( parsed_document : str , model_id : str , section_name : str , model_info : ModelInfo , code_formatter : CodeFormatter , ) : # Whether or not there are options with default values options_with_defaults = len ( model_info . defaults_file_lines ) > 0 model_file_lines = parsed_document . splitlines ( ) _add_imports ( model_file_lines , options_with_defaults , len ( model_info . deprecation_data ) ) if model_id in model_info . deprecation_data : model_file_lines += _define_deprecation_functions ( model_id , section_name ) model_file_lines += _define_validator_functions ( model_id , model_info . validator_data ) model_file_lines . append ( '' ) model_file_contents = '\n' . join ( model_file_lines ) if any ( len ( line ) > 120 for line in model_file_lines ) : model_file_contents = code_formatter . apply_black ( model_file_contents ) return model_file_contents