class CurrentSeasonOnly(BaseQueryParameter, Enum):
    yes = 1
    no = 0

    @staticmethod
    def get_query_parameter_name():
        return "isOnlyCurrentSeason" class DateRange:
    def __init__(self, start=date.today(), end=date.today()):
        assert start <= end

        self.start = start
        self.end = end

    def is_date_in_range(self, value):
        assert isinstance(value, date)

        return self.start <= value <= self.end class League(BaseQueryParameter, Enum):
    nba = "00"
    aba = "01"

    @staticmethod
    def get_query_parameter_name():
        return "LeagueId" class Season(BaseQueryParameter, Enum):
    season_2016 = "2016-17"
    season_2015 = "2015-16"
    season_2014 = "2014-15"
    season_2013 = "2013-14"
    season_2012 = "2012-13"
    season_2011 = "2011-12"
    season_2010 = "2010-11"
    season_2009 = "2009-10"
    season_2008 = "2008-09"
    season_2007 = "2007-08"
    season_2006 = "2006-07"
    season_2005 = "2005-06"
    season_2004 = "2004-05"
    season_2003 = "2003-04"
    season_2002 = "2002-03"
    season_2001 = "2001-02"
    season_2000 = "2000-01"
    season_1999 = "1999-00"
    season_1998 = "1998-99"
    season_1997 = "1997-98"
    season_1996 = "1996-97"
    season_1995 = "1995-96"
    season_1994 = "1994-95"
    season_1993 = "1993-94"
    season_1992 = "1992-93"
    season_1991 = "1991-92"
    season_1990 = "1990-91"

    @staticmethod
    def get_query_parameter_name():
        return "Season"

    @staticmethod
    def get_season_by_name(name):
        season = season_name_map.get(name)

        if season is None:
            raise ValueError("Unknown season name: %s", name)

        return season

    @staticmethod
    def get_season_by_start_year(year):
        season = start_year_to_season_map.get(year)

        if season is None:
            raise ValueError("Unknown season start year: %s", year)

        return season

    @staticmethod
    def get_season_by_end_year(year):
        season = season_end_year_map.get(year)

        if season is None:
            raise ValueError("Unknown season end year: %s", year)

        return season

    @staticmethod
    def get_season_by_start_and_end_year(start_year, end_year):
        start_year_season = Season.get_season_by_start_year(year=start_year)
        end_year_season = Season.get_season_by_end_year(year=end_year)

        if start_year_season is not end_year_season:
            raise ValueError("Cannot find season with start year: %s and end year: %s", start_year, end_year)

        return start_year_season

    @staticmethod
    def get_start_year_by_season(season):
        assert isinstance(season, Season)

        start_year = season_to_start_year_map.get(season)

        if start_year is None:
            raise ValueError("Cannot find start year for season: %s", season)

        return start_year class SeasonType(BaseQueryParameter, Enum):
    regular_season = "Regular Season"
    pre_season = "Pre Season"
    playoffs = "Playoffs"
    all_star = "All-Star"

    @staticmethod
    def get_query_parameter_name():
        return "SeasonType"

    @staticmethod
    def get_season_type(season_type_name):
        season_type = season_type_name_map.get(season_type_name)

        if season_type is None:
            raise ValueError("Unknown season type name: %s", season_type_name)

        return season_type class CalendarDeserializer:
    internal_field_name = "_internal"
    start_date_field_name = "startDate"
    end_date_field_name = "endDate"
    start_date_current_season_field_name = "startDateCurrentSeason"
    fields_to_ignore = { internal_field_name, start_date_field_name, end_date_field_name, start_date_current_season_field_name }
    date_format = "%Y%m%d"

    def __init__(self):
        pass

    # TODO: @jbradley add pub date time to returned object
    @staticmethod
    def deserialize(calendar_json, date_range=DateRange(), ignore_dates_without_games=True):
        calendar_values = {}
        for key, value in calendar_json.items():
            if ((value != 0 and ignore_dates_without_games is True) or ignore_dates_without_games is False) \
                    and key not in CalendarDeserializer.fields_to_ignore:
                date_value = datetime.strptime(key, CalendarDeserializer.date_format).date()
                if date_range.is_date_in_range(value=date_value):
                    calendar_values[date_value] = value
        return calendar_values class CommonAllPlayersDeserializer:
    name_index = 2
    team_id_index = 7
    id_index = 0
    result_sets_field_name = 'resultSets'
    row_set_field_name = 'rowSet'
    results_index = 0

    def __init__(self):
        pass

    @staticmethod
    def deserialize(data):
        return [CommonAllPlayersDeserializer.deserialize_result(result=result)
                for result in CommonAllPlayersDeserializer.parse_results(data=data)]

    @staticmethod
    def deserialize_result(result):
        return CommonAllPlayer(name=result[CommonAllPlayersDeserializer.name_index],
                               team=Team.get_team_by_id(team_id=result[CommonAllPlayersDeserializer.team_id_index]),
                               id=result[CommonAllPlayersDeserializer.id_index])

    @staticmethod
    def parse_results(data):
        if CommonAllPlayersDeserializer.result_sets_field_name not in data:
            raise ValueError('Unable to identify results for %s', data)

        result_sets = data[CommonAllPlayersDeserializer.result_sets_field_name]

        if len(result_sets) < 1:
            raise ValueError('Unable to identify results for %s', data)

        if CommonAllPlayersDeserializer.row_set_field_name not in result_sets[CommonAllPlayersDeserializer.results_index]:
            raise ValueError('Unable to identify results for %s', data)

        return result_sets[CommonAllPlayersDeserializer.results_index][CommonAllPlayersDeserializer.row_set_field_name] class CommonPlayerInfoDeserializer:
    game_date_format = "%Y-%m-%dT%H:%M:%S"
    unknown_value = ""

    results_set_field_name = 'resultSets'
    row_set_field_name = 'rowSet'

    result_set_index = 0
    row_set_index = 0
    nba_id_index = 0
    name_index = 3
    birth_date_index = 6
    height_index = 10
    weight_index = 11
    jersey_number_index = 13
    position_name_index = 14
    team_id_index = 16

    def __init__(self):
        pass

    @staticmethod
    def parse_result(data):
        if CommonPlayerInfoDeserializer.results_set_field_name not in data:
            raise ValueError('Unable to parse results from %s', data)

        results_set = data[CommonPlayerInfoDeserializer.results_set_field_name]

        if len(results_set) < 1:
            raise ValueError('Unable to parse results from %s', data)

        result_set = results_set[CommonPlayerInfoDeserializer.result_set_index]

        if CommonPlayerInfoDeserializer.row_set_field_name not in result_set:
            raise ValueError('Unable to parse results from %s', data)

        row_set = result_set[CommonPlayerInfoDeserializer.row_set_field_name]

        if len(row_set) < 1:
            raise ValueError('Unable to parse row set from %s', data)

        return row_set[CommonPlayerInfoDeserializer.row_set_index]

    @staticmethod
    def deserialize(data):
        result = CommonPlayerInfoDeserializer.parse_result(data=data)

        weight = result[CommonPlayerInfoDeserializer.weight_index]
        if weight is not None:
            weight = int(weight)

        height_value = result[CommonPlayerInfoDeserializer.height_index]
        if height_value is not None:
            height = CommonPlayerInfoDeserializer.parse_height(height_value=height_value)
        else:
            height = None

        jersey_number = result[CommonPlayerInfoDeserializer.jersey_number_index]
        if jersey_number is not None:
            jersey_number = int(jersey_number)

        id = int(result[CommonPlayerInfoDeserializer.nba_id_index])
        name = result[CommonPlayerInfoDeserializer.name_index]
        team = Team.get_team_by_id(team_id=int(result[CommonPlayerInfoDeserializer.team_id_index]))
        birth_date = CommonPlayerInfoDeserializer.parse_date(result[CommonPlayerInfoDeserializer.birth_date_index])
        position = Position.get_position_from_name(name=str(result[CommonPlayerInfoDeserializer.position_name_index]))

        return DetailedPlayer(id=id, name=name, team=team, birth_date=birth_date, height=height, weight=weight,
                              jersey=jersey_number, position=position)

    @staticmethod
    def parse_height(height_value):
        height_components = height_value.split("-")

        assert len(height_components) == 2

        inches = 0
        inches += int(height_components[0]) * 12
        inches += int(height_components[1])

        return inches

    @staticmethod
    def parse_date(date_string):
        return datetime.strptime(date_string, CommonPlayerInfoDeserializer.game_date_format).date() class ScoreboardDeserializer:

    datetime_format = '%Y-%m-%dT%H:%M:%S.%fZ'
    date_format = '%Y-%m-%d'
    start_time_time_zone = pytz.utc

    games_field_name = 'games'
    season_year_field_name = 'seasonYear'
    game_id_field_name = 'gameId'
    start_time_field_name = 'startTimeUTC'
    visiting_team_field_name = 'vTeam'
    home_team_field_name = 'hTeam'
    team_id_field_name = 'teamId'

    def __init__(self):
        pass

    @staticmethod
    def deserialize(data):
        if ScoreboardDeserializer.games_field_name not in data:
            raise ValueError('Unable to parse games field for %s', data)

        return [ScoreboardDeserializer.parse_game(data=game)
                for game in data[ScoreboardDeserializer.games_field_name]]

    @staticmethod
    def parse_game(data):
        if ScoreboardDeserializer.game_id_field_name not in data:
            raise ValueError('Unable to parse game id field for %s', data)

        if ScoreboardDeserializer.season_year_field_name not in data:
            raise ValueError('Unable to parse season year field for %s', data)

        if ScoreboardDeserializer.start_time_field_name not in data:
            raise ValueError('Unable to parse start time field for %s', data)

        game_id = data[ScoreboardDeserializer.game_id_field_name]
        season = Season.get_season_by_start_year(year=int(data[ScoreboardDeserializer.season_year_field_name]))
        start_time_value = data[ScoreboardDeserializer.start_time_field_name]

        # If start time is not a datetime then use date formatting
        try:
            start_time = datetime.strptime(start_time_value, ScoreboardDeserializer.datetime_format)
        except ValueError:
            start_time = datetime.strptime(start_time_value, ScoreboardDeserializer.date_format)

        start_time = start_time.replace(tzinfo=ScoreboardDeserializer.start_time_time_zone)

        match_up = ScoreboardDeserializer.parse_match_up(data=data)

        return ScoreboardGame(id=game_id, season=season, start_time=start_time, match_up=match_up)

    @staticmethod
    def parse_match_up(data):
        if ScoreboardDeserializer.home_team_field_name not in data:
            raise ValueError('Unable to parse home team field for %s', data)

        if ScoreboardDeserializer.visiting_team_field_name not in data:
            raise ValueError('Unable to parse visiting team field for %s', data)

        home_team = ScoreboardDeserializer.parse_team(data=data[ScoreboardDeserializer.home_team_field_name])
        away_team = ScoreboardDeserializer.parse_team(data=data[ScoreboardDeserializer.visiting_team_field_name])

        return MatchUp(home_team=home_team, away_team=away_team)

    @staticmethod
    def parse_team(data):
        if ScoreboardDeserializer.team_id_field_name not in data:
            raise ValueError('Unable to parse team id for %s', data)

        return Team.get_team_by_id(team_id=int(data[ScoreboardDeserializer.team_id_field_name])) class SeasonPlayersDeserializer:
    # I don't know if there's a non-standard league
    league_field_name = 'league'
    standard_field_name = 'standard'
    first_name_field_name = 'firstName'
    last_name_field_name = 'lastName'
    player_id_field_name = 'personId'
    team_id_field_name = 'teamId'
    jersey_field_name = 'jersey'
    team_seasons_field_name = 'teams'
    team_seasons_team_id_field_name = 'teamId'
    team_season_season_start_year_field_name = 'seasonStart'
    team_season_season_end_year_field_name = 'seasonEnd'

    def __init__(self):
        pass

    @staticmethod
    def deserialize(data):
        if SeasonPlayersDeserializer.league_field_name not in data:
            raise ValueError('Unable to deserialize league field for %s', data)

        league = data[SeasonPlayersDeserializer.league_field_name]

        if SeasonPlayersDeserializer.standard_field_name not in league:
            raise ValueError('Unable to deserialize standard field for %s', data)

        players = league[SeasonPlayersDeserializer.standard_field_name]

        return [SeasonPlayersDeserializer.parse_player(data=player)
                for player in players]

    @staticmethod
    def parse_player(data):
        if SeasonPlayersDeserializer.player_id_field_name not in data:
            raise ValueError('Unable to parse id field for %s', data)

        if SeasonPlayersDeserializer.first_name_field_name not in data:
            raise ValueError('Unable to parse first name field for %s', data)

        if SeasonPlayersDeserializer.last_name_field_name not in data:
            raise ValueError('Unable to parse last name field for %s', data)

        if SeasonPlayersDeserializer.jersey_field_name not in data:
            raise ValueError('Unable to parse jersey value field for %s', data)

        player_id = data[SeasonPlayersDeserializer.player_id_field_name]
        first_name = data[SeasonPlayersDeserializer.first_name_field_name]
        last_name = data[SeasonPlayersDeserializer.last_name_field_name]
        jersey_value = data[SeasonPlayersDeserializer.jersey_field_name]
        jersey = int(jersey_value) if jersey_value.isdigit() else None
        name = '{0} {1}'.format(first_name, last_name)
        team_seasons = SeasonPlayersDeserializer.parse_team_seasons(data=data)

        return SeasonPlayer(id=player_id, name=name, jersey=jersey, team_seasons=team_seasons)

    @staticmethod
    def parse_team_seasons(data):
        if SeasonPlayersDeserializer.team_seasons_field_name not in data:
            raise ValueError('Unable to parse team seasons field for %s', data)

        team_seasons = data[SeasonPlayersDeserializer.team_seasons_field_name]

        return [SeasonPlayersDeserializer.parse_team_season(data=team_season)
                for team_season in team_seasons]

    @staticmethod
    def parse_team_season(data):
        return TeamSeasonRange(team=SeasonPlayersDeserializer.parse_team(data=data),
                               season_range=SeasonPlayersDeserializer.parse_season_range(data=data))

    @staticmethod
    def parse_team(data):
        if SeasonPlayersDeserializer.team_seasons_team_id_field_name not in data:
            raise ValueError('Unable to parse team id for %s', data)

        team_id = int(data[SeasonPlayersDeserializer.team_seasons_team_id_field_name])
        return Team.get_team_by_id(team_id=team_id)

    @staticmethod
    def parse_season_range(data):
        if SeasonPlayersDeserializer.team_season_season_start_year_field_name not in data:
            raise ValueError('Unable to parse season start for %s', data)

        if SeasonPlayersDeserializer.team_season_season_end_year_field_name not in data:
            raise ValueError('Unable to parse season end for %s', data)

        season_range_start_year = int(data[SeasonPlayersDeserializer.team_season_season_start_year_field_name])
        season_range_end_year = int(data[SeasonPlayersDeserializer.team_season_season_end_year_field_name])

        # NBA API returns start year for last year in range
        return SeasonRange(start=Season.get_season_by_start_year(year=season_range_start_year),
                           end=Season.get_season_by_start_year(year=season_range_end_year)) class TeamGameLogDeserializer:
    game_date_format = "%b %d, %Y"

    result_set_index = 0
    game_id_index = 1
    game_date_index = 2
    match_up_index = 3
    home_team_outcome_index = 4
    result_sets_field_name = 'resultSets'
    row_set_field_name = 'rowSet'
    parameters_field_name = 'parameters'

    def __init__(self):
        pass

    @staticmethod
    def deserialize(data):
        season = TeamGameLogDeserializer.parse_season(data=data)
        season_type = TeamGameLogDeserializer.parse_season_type(data=data)
        return [TeamGameLogDeserializer.parse_result(data=result, season=season, season_type=season_type)
                for result in TeamGameLogDeserializer.parse_results(data=data)]

    @staticmethod
    def parse_result(data, season, season_type):
        match_up = TeamGameLogDeserializer.parse_match_up(match_up=data[TeamGameLogDeserializer.match_up_index])
        home_team_outcome = Outcome.get_outcome_from_abbreviation(abbreviation=data[TeamGameLogDeserializer.home_team_outcome_index])
        return LoggedGame(id=data[TeamGameLogDeserializer.game_id_index],
                          match_up=match_up,
                          start_date=TeamGameLogDeserializer.parse_date(date_string=data[TeamGameLogDeserializer.game_date_index]),
                          season=season,
                          season_type=season_type,
                          home_team_outcome=home_team_outcome)

    @staticmethod
    def parse_parameters(data):
        if TeamGameLogDeserializer.parameters_field_name not in data:
            raise ValueError('Unable to parse parameters from %s', data)

        return data[TeamGameLogDeserializer.parameters_field_name]

    @staticmethod
    def parse_season(data):
        parameters = TeamGameLogDeserializer.parse_parameters(data=data)

        if Season.get_query_parameter_name() not in parameters:
            raise ValueError('Unable to parse season from %s', data)

        return Season.get_season_by_name(name=parameters[Season.get_query_parameter_name()])

    @staticmethod
    def parse_season_type(data):
        parameters = TeamGameLogDeserializer.parse_parameters(data=data)

        if SeasonType.get_query_parameter_name() not in parameters:
            raise ValueError('Unable to parse season type from %s', data)

        return SeasonType.get_season_type(season_type_name=parameters[SeasonType.get_query_parameter_name()])

    @staticmethod
    def parse_results(data):
        if TeamGameLogDeserializer.result_sets_field_name not in data:
            raise ValueError('Unable to parse results for %s', data)

        result_sets = data[TeamGameLogDeserializer.result_sets_field_name]

        if len(result_sets) < 1:
            raise ValueError('Unable to parse results for %s', data)

        if TeamGameLogDeserializer.row_set_field_name not in result_sets[TeamGameLogDeserializer.result_set_index]:
            raise ValueError('Unable to parse results for %s', data)

        return result_sets[TeamGameLogDeserializer.result_set_index][TeamGameLogDeserializer.row_set_field_name]

    @staticmethod
    def parse_match_up(match_up):

        if " vs. " in match_up:
            teams = match_up.split(" vs. ")
            return MatchUp.create(home_team_abbreviation=str(teams[0]),
                                  away_team_abbreviation=str(teams[1]))

        elif " @ " in match_up:
            teams = match_up.split(" @ ")
            return MatchUp.create(home_team_abbreviation=str(teams[1]),
                                  away_team_abbreviation=str(teams[0]))

        else:
            raise RuntimeError("Unexpected matchup: %s", match_up)

    @staticmethod
    def parse_date(date_string):
        return datetime.strptime(date_string, TeamGameLogDeserializer.game_date_format).date() class TraditionalGameBoxScoreDeserializer(BoxScoreDeserializer):

    def team_box_scores_deserializer(self, data):
        return TraditionalTeamBoxScoresDeserializer.deserialize(data=data)

    def player_box_scores_deserializer(self, data):
        return TraditionalPlayerBoxScoresDeserializer.deserialize(data=data) class AdvancedGameBoxScoreDeserializer(BoxScoreDeserializer):

    def player_box_scores_deserializer(self, data):
        return AdvancedPlayerBoxScoresDeserializer.deserialize(data=data)

    def team_box_scores_deserializer(self, data):
        return AdvancedTeamBoxScoresDeserializer.deserialize(data=data) class RotoWirePlayerNewsItemsDeserializer:
    def __init__(self):
        pass

    list_items_field_name = 'ListItems'

    @staticmethod
    def deserialize(data):
        return [
            RotoWirePlayerNewsItemDeserializer.deserialize(data=player_news_item)
            for player_news_item in data[RotoWirePlayerNewsItemsDeserializer.list_items_field_name]
        ] class QueryParameterGenerator:

    game_id_parameter_name = "GameId"
    start_period_parameter_name = "StartPeriod"
    end_period_parameter_name = "EndPeriod"
    start_range_parameter_name = "StartRange"
    end_range_parameter_name = "EndRange"
    range_type_parameter_name = "RangeType"

    def __init__(self):
        pass

    @staticmethod
    def generate_request_parameters(league=None, season_type=None, season=None, current_season_only=None, team=None,
                                    player_id=None):
        parameters = {}

        if league is not None:
            parameters[League.get_query_parameter_name()] = league.value

        if season_type is not None:
            parameters[SeasonType.get_query_parameter_name()] = season_type.value

        if season is not None:
            parameters[Season.get_query_parameter_name()] = season.value

        if current_season_only is not None:
            parameters[CurrentSeasonOnly.get_query_parameter_name()] = current_season_only.value

        if team is not None:
            parameters[Team.get_query_parameter_name()] = Team.get_id(team=team)

        if player_id is not None:
            parameters[Player.get_query_parameter_name()] = player_id

        return parameters

    @staticmethod
    def generate_box_score_request_parameters(game_id, start_period=0, end_period=0, start_range=0, end_range=0,
                                              range_type=0):
        assert start_period >= 0
        assert end_period >= 0
        assert end_period >= start_period
        assert start_range >= 0
        assert end_range >= 0
        assert end_range >= start_range
        assert range_type >= 0

        parameters = {}

        parameters[QueryParameterGenerator.game_id_parameter_name] = game_id
        parameters[QueryParameterGenerator.start_period_parameter_name] = start_period
        parameters[QueryParameterGenerator.end_period_parameter_name] = end_period
        parameters[QueryParameterGenerator.start_range_parameter_name] = start_range
        parameters[QueryParameterGenerator.end_range_parameter_name] = end_range
        parameters[QueryParameterGenerator.range_type_parameter_name] = range_type

        return parameters class UriGenerator:
    date_format = "%Y%m%d"
    stats_base_uri = "http://stats.nba.com/stats/"
    stats_prod_base_uri = "http://stats-prod.nba.com/wp-json/statscms/v1/"
    data_base_uri = "http://data.nba.net/"

    common_all_players_path = "commonallplayers"
    team_game_log_path = "teamgamelog"
    common_player_info_path = "commonplayerinfo"
    advanced_box_score_path = "boxscoreadvancedv2"
    traditional_box_score_path = "boxscoretraditionalv2"
    calendar_path = "calendar"
    scoreboard_path = "scoreboard"
    players_path = "players"
    roto_wire_player_news_path = "rotowire/player"

    def __init__(self):
        pass

    @staticmethod
    def generate_common_all_players_uri():
        return UriGenerator.stats_base_uri + UriGenerator.common_all_players_path

    @staticmethod
    def generate_team_game_log_uri():
        return UriGenerator.stats_base_uri + UriGenerator.team_game_log_path

    @staticmethod
    def generate_common_player_info_uri():
        return UriGenerator.stats_base_uri + UriGenerator.common_player_info_path

    @staticmethod
    def generate_advanced_box_score_uri():
        return UriGenerator.stats_base_uri + UriGenerator.advanced_box_score_path

    @staticmethod
    def generate_traditional_box_score_uri():
        return UriGenerator.stats_base_uri + UriGenerator.traditional_box_score_path

    @staticmethod
    def generate_data_uri(path):
        return UriGenerator.data_base_uri + 'data/10s/prod/v1/' + path + '.json'

    @staticmethod
    def generate_calendar_data_uri():
        return UriGenerator.generate_data_uri(path=UriGenerator.calendar_path)

    @staticmethod
    def generate_scoreboard_data_uri(date_value):
        assert isinstance(date_value, date)

        path = date_value.strftime(UriGenerator.date_format) + '/' + UriGenerator.scoreboard_path
        return UriGenerator.generate_data_uri(path=path)

    @staticmethod
    def generate_players_data_uri(season):
        assert isinstance(season, Season)

        path = str(Season.get_start_year_by_season(season=season)) + '/' + UriGenerator.players_path
        return UriGenerator.generate_data_uri(path=path)

    @staticmethod
    def generate_roto_wire_player_news_uri():
        return UriGenerator.stats_prod_base_uri + '/' + UriGenerator.roto_wire_player_news_path
import requests
from nba_data.data.current_season_only import CurrentSeasonOnly
from nba_data.data.date_range import DateRange
from nba_data.data.league import League
from nba_data.data.season import Season
from nba_data.data.season_type import SeasonType
from nba_data.deserializers.calendar import CalendarDeserializer
from nba_data.deserializers.common_all_players import CommonAllPlayersDeserializer
from nba_data.deserializers.common_player_info import CommonPlayerInfoDeserializer
from nba_data.deserializers.scoreboard import ScoreboardDeserializer
from nba_data.deserializers.season_players import SeasonPlayersDeserializer
from nba_data.deserializers.team_game_log import TeamGameLogDeserializer
from nba_data.deserializers.box_scores.game import TraditionalGameBoxScoreDeserializer, AdvancedGameBoxScoreDeserializer
from nba_data.deserializers.roto_wire.player_news_items import RotoWirePlayerNewsItemsDeserializer
from nba_data.nba_stats_api_utils.query_parameter_generator import QueryParameterGenerator
from nba_data.nba_stats_api_utils.uri_generator import UriGenerator



class Client:
    advanced_box_score_deserializer = AdvancedGameBoxScoreDeserializer()
    traditional_box_score_deserializer = TraditionalGameBoxScoreDeserializer()
    headers = {'user-agent': ('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) '
                              'AppleWebKit/537.36 (KHTML, like Gecko) '
                              'Chrome/45.0.2454.101 Safari/537.36'),
               'referer': 'http://stats.nba.com/scores/'}

    def __init__(self):
        pass

    @staticmethod
    def get_all_nba_players():
        return Client.get_players_for_season(season=Season.season_2015, current_season_only=CurrentSeasonOnly.no)

    @staticmethod
    def get_players_for_season(season, league=League.nba, current_season_only=CurrentSeasonOnly.yes):
        parameters = QueryParameterGenerator.generate_request_parameters(season=season, league=league,
                                                                         current_season_only=current_season_only)
        return Client.get_deserialized_data(uri=UriGenerator.generate_common_all_players_uri(),
                                            parameters=parameters, deserializer=CommonAllPlayersDeserializer)

    @staticmethod
    def get_games_for_team(season, team, season_type=SeasonType.regular_season):
        parameters = QueryParameterGenerator.generate_request_parameters(season=season,
                                                                         season_type=season_type, team=team)
        return Client.get_deserialized_data(uri=UriGenerator.generate_team_game_log_uri(),
                                            parameters=parameters, deserializer=TeamGameLogDeserializer)

    @staticmethod
    def get_player_info(player_id):
        parameters = QueryParameterGenerator.generate_request_parameters(player_id=player_id)
        return Client.get_deserialized_data(uri=UriGenerator.generate_common_player_info_uri(),
                                            parameters=parameters, deserializer=CommonPlayerInfoDeserializer)

    @staticmethod
    def get_advanced_box_score(game_id):

        parameters = QueryParameterGenerator.generate_box_score_request_parameters(game_id=game_id)