import json
import requests
from api_auth import APICredentials, APIParams

class GetLatestStatsSingleAsset:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get the latest statistics for a single asset.
        """
        self._get_latest_stats_single_asset()

    def _get_latest_stats_single_asset(self):
        asset_id = "7771125f336c4e229c20f7307f8c3122" # Replace with the desired asset ID.
        url = "{}{}{}".format(self.host, "/api/v4/monitoring/vod-stats/", asset_id)

        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )

        if response.status_code == 200:
            print(response.json())
        else:
            print(response.status_code)

GetLatestStatsSingleAsset().run()