# Path: eldonationtracker/utils/extralife_io.py
# def validate_url(url: str):
# def get_json(url: str, order_by_donations: bool = False, order_by_amount: bool = False) -> dict:
# def get_donations(donations_or_donors: list, api_url: str, is_donation=True, largest_first=False) -> list:
# def get_badges(api_url: str) -> list[Badge]:
#     def __init__(self):
#     def load_json(self) -> dict:  # pragma: no cover
#     def get_github_config(self):  # pragma: no cover
#     def get_tracker_assets(self, asset: str):  # pragma: no cover
#     def update_fields(self):
#     def write_config(self, config: dict, default: bool):  # pragma: no cover
#     def get_version(self):
#     def reload_json(self):
#     def get_cli_values(self) -> Tuple[Any, Any, Any, Any, Any]:
#     def get_text_folder_only(self) -> str:
#     def get_gui_values(self) -> Tuple[Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any]:
#     def get_font_info(self):
#     def get_tracker_background_color(self):
#     def get_if_in_team(self) -> bool:
#     def get_version_mismatch(self) -> bool:
#     def get_tracker_image(self) -> str:
#     def get_tracker_sound(self) -> str:
#     def __str__(self):
# def single_format(donor, message: bool, currency_symbol: str) -> str:
# def multiple_format(donors, message: bool, horizontal: bool,
#                     currency_symbol: str, how_many: int) -> str:
# def format_information_for_output(donation_list: list, currency_symbol: str, donors_to_display: str, team: bool,
#                                   donation=True) -> dict:
# def output_badge_data(badge_list: list[Badge], text_folder: str, team=False) -> None:  # pragma: no cover
# def read_in_total_raised(text_folder: str) -> str:
# def write_text_files(dictionary: dict, text_folder: str):
# def write_html_files(data: str, filename: str, text_folder: str):
# class ParticipantConf:


import logging
import eldonationtracker.utils.extralife_io
from rich import print
from rich.logging import RichHandler
from typing import Tuple, List
from donordrivepython.api.team import Team as DonorDriveTeam
from eldonationtracker.utils import extralife_io as extralife_io
class Team(DonorDriveTeam):
    """Hold Team API Data."""

    def __init__(self, team_id: str, output_folder: str, currency_symbol: str, donors_to_display: str,
                 base_api_url: str):
        DonorDriveTeam.__init__(self, team_id, output_folder, currency_symbol, donors_to_display, base_api_url)

    def write_text_files(self, dictionary: dict) -> None:  # pragma: no cover
        """Write info to text files.

        :param dictionary: The dictionary containing the values to write out to text files.
        """
        extralife_io.write_text_files(dictionary, self.output_folder)

    def team_run(self) -> None:
        """A public method to update and output team and team participant info."""
        logging.debug("I am in team_run")
        number_of_donations = self.num_donations
        self.team_api_info()
        if self.num_donations > number_of_donations:
            self.participant_run()
            self.donation_run()

    def team_api_info(self) -> None:
        """Get team info from API."""
        self._team_goal, self._team_captain, self._total_raised, self._num_donations,\
            self._team_avatar_image = self._get_team_json()
        self._update_team_dictionary()
        self._update_badges()
        self.write_text_files(self._team_info)

# Path: eldonationtracker/utils/extralife_io.py
# def validate_url(url: str):
# def get_json(url: str, order_by_donations: bool = False, order_by_amount: bool = False) -> dict:
# def get_donations(donations_or_donors: list, api_url: str, is_donation=True, largest_first=False) -> list:
# def get_badges(api_url: str) -> list[Badge]:
#     def __init__(self):
#     def load_json(self) -> dict:  # pragma: no cover
#     def get_github_config(self):  # pragma: no cover
#     def get_tracker_assets(self, asset: str):  # pragma: no cover
#     def update_fields(self):
#     def write_config(self, config: dict, default: bool):  # pragma: no cover
#     def get_version(self):
#     def reload_json(self):
#     def get_cli_values(self) -> Tuple[Any, Any, Any, Any, Any]:
#     def get_text_folder_only(self) -> str:
#     def get_gui_values(self) -> Tuple[Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any]:
#     def get_font_info(self):
#     def get_tracker_background_color(self):
#     def get_if_in_team(self) -> bool:
#     def get_version_mismatch(self) -> bool:
#     def get_tracker_image(self) -> str:
#     def get_tracker_sound(self) -> str:
#     def __str__(self):
# def single_format(donor, message: bool, currency_symbol: str) -> str:
# def multiple_format(donors, message: bool, horizontal: bool,
#                     currency_symbol: str, how_many: int) -> str:
# def format_information_for_output(donation_list: list, currency_symbol: str, donors_to_display: str, team: bool,
#                                   donation=True) -> dict:
# def output_badge_data(badge_list: list[Badge], text_folder: str, team=False) -> None:  # pragma: no cover
# def read_in_total_raised(text_folder: str) -> str:
# def write_text_files(dictionary: dict, text_folder: str):
# def write_html_files(data: str, filename: str, text_folder: str):
# class ParticipantConf:


# Path: eldonationtracker/api/team.py
import logging
import eldonationtracker.utils.extralife_io
from rich import print
from rich.logging import RichHandler
from typing import Tuple, List
from donordrivepython.api.team import Team as DonorDriveTeam
from eldonationtracker.utils import extralife_io as extralife_io

class Team(DonorDriveTeam):
    """Hold Team API Data."""

    def __init__(self, team_id: str, output_folder: str, currency_symbol: str, donors_to_display: str,
                 base_api_url: str):
        DonorDriveTeam.__init__(self, team_id, output_folder, currency_symbol, donors_to_display, base_api_url)

    def write_text_files(self, dictionary: dict) -> None:  # pragma: no cover
        """Write info to text files.

        :param dictionary: The dictionary containing the values to write out to text files.
        """
        extralife_io.write_text_files(dictionary, self.output_folder)

    def team_run(self) -> None:
        """A public method to update and output team and team participant info."""
        logging.debug("I am in team_run")
        number_of_donations = self.num_donations
        self.team_api_info()
        if self.num_donations > number_of_donations:
            self.participant_run()
            self.donation_run()

    def team_api_info(self) -> None:
        """Get team info from API."""
        self._team_goal, self._team_captain, self._total_raised, self._num_donations,\
            self._team_avatar_image = self._get_team_json()
        self._update_team_dictionary()
        self._update_badges()
        self.write_text_files(self._team_info)

        extralife_io.output_badge_data(self.badges, self.output_folder, team=True)