import requests
from api_auth import APICredentials, APIParams
 
class StaticEncryptionKeyStatusUpdate:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Updates whether content may be encrypted using a static encryption key.
        """
        self._update_status_encryption_key_status()
 
    def _update_status_encryption_key_status(self):

        static_encryption_key_status = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/use-static-encryption-key/update")
 
        new_static_encryption_key_status = {
            'use_static_encryption_key': True
        }
 
        static_encryption_key_status['item'] = new_static_encryption_key_status
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(static_encryption_key_status) 
            )
 
        print(response.json())

StaticEncryptionKeyStatusUpdate().run()