import json, requests, datetime, time
from api_auth import APICredentials, APIParams
channel_id = '02ed9f65570746528e7b3d0628960025' # Replace with the ID for the desired live channel.

class LiveChannel:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Update a live channel.
        """
        self._update_live_channel()

    def _update_live_channel(self):
        url = "{}{}{}".format(self.host, "/api/v4/channels/", channel_id)

        payload = {            
            'slicer_id': 'mySlicer3'
        }

        headers = {'Content-Type': 'application/json'}

        response = requests.patch(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers 
        )

        print(response.json())

LiveChannel().run()