def replace_raw_file_with_completed(self, file_name, data):
        """Delete raw file and write data in new checkpoint file.

        Args:
            file_name (str): The name of the file.
            data (any): The data to be written to the checkpoint file.
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            new_file_name = file_name.replace("raw", "completed")
            applogger.info(
                "{}: (method = {}) : {} : {} has been successfully parsed data storing in new file name = {}".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.PARSE_RAW_JSON_DATA_FUNCTION_NAME,
                    file_name,
                    new_file_name,
                )
            )
            state_manager_obj = StateManager(consts.CONN_STRING, new_file_name, consts.FILE_SHARE_NAME_DATA)
            state_manager_obj.post(data)
            self.utils_obj.delete_files_from_azure_storage([file_name], self.parent_dir)
            self.delete_file_count += 1
            applogger.info(
                "{}: (method = {}) : {} : Deleting {} file as data parsing is completed.".format(
                    consts.LOGS_STARTS_WITH, __method_name, consts.PARSE_RAW_JSON_DATA_FUNCTION_NAME, file_name
                )
            )
            applogger.info(
                "{}: (method = {}) : {} : Total files deleted till now = {}".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.PARSE_RAW_JSON_DATA_FUNCTION_NAME,
                    self.delete_file_count,
                )
            )
        except Exception as error:
            applogger.error(
                consts.LOG_FORMAT.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.PARSE_RAW_JSON_DATA_FUNCTION_NAME,
                    "Error while writing to checkpoint file : {}".format(error),
                )
            )
            raise InfobloxException()
Delete raw file and write data in new checkpoint file.

        Args:
            file_name (str): The name of the file.
            data (any): The data to be written to the checkpoint file.
        
Solutions/Infoblox/Data Connectors/InfobloxCloudDataConnector/InfobloxParseRawIndicators/parse_json_files.py