import requests
from api_auth import APICredentials, APIParams
 
class StaticEncryptionKeyLiveSlicersUpdate:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Defines the set of Live Slicers whose content will be encrypted using a static encryption key.
        """
        self._update_live_slicers()
 
    def _update_live_slicers(self):

        live_slicers = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/static-key-slicer-ids/update")
 
        new_live_slicers = {
            'static_key_slicer_ids': ['liveslicer1', 'liveslicer2']
        }
 
        live_slicers['item'] = new_live_slicers
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(live_slicers) 
            )
 
        print(response.json())

StaticEncryptionKeyLiveSlicersUpdate().run()