import json
import requests
from api_auth import APICredentials, APIParams

class GetLatestStatsMultipleAssets:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get the latest statistics for the specified assets.
        """
        self._get_latest_stats_multiple_assets()

    def _get_latest_stats_multiple_assets(self):
        url = "{}{}".format(self.host, "/api/v4/monitoring/vod-stats/search")
 
        # Replace with the desired asset IDs.
        asset_ids = ['114n9q6a847ieldd8bb8dbf67afef96b', 'k30y636fa2f143eb95c7a41d96d581c4']

        headers = {'Content-Type': 'application/json'}

        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), json={"asset_ids": asset_ids}, headers=headers 
        )

        if response.status_code == 200:
            print(response.json())
        else:
            print(response.status_code)

GetLatestStatsMultipleAssets().run()