import json
import requests
from api_auth import APICredentials, APIParams

class GetEnhancedStatsSingleLiveStream:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get enhanced statistics for a single live stream.
        """
        self._get_enhanced_stats_single_live_stream()

    def _get_enhanced_stats_single_live_stream(self):
        stream_id = '114n9q6a847ieldd8bb8dbf67afef96b' # Replace with a live event or live channel ID.
        url = "{}{}{}".format(self.host, "/api/v4/monitoring/stream_stats_enhanced/", stream_id)

        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )

        print(response.json())

GetEnhancedStatsSingleLiveStream().run()