"""Ows-podcast api calls module.""" from owsrequest import request from asset_transcoder.utils.exceptions import OwsError OWS_PODCAST = 'ows-podcast' def ownership(user_id, object_type, object_id): """Ownership check.""" response = request.get( OWS_PODCAST, '/check-ownership', params={ 'object_id': str(object_id), 'object_type': object_type }, headers={ 'Orchard-Identity-UUID': user_id } ) if response.status_code > 399: raise OwsError.response_error(response) return response.json()['authorized']