"""Api calls of ows_podcast enpoints.""" import requests from tests.integration.consts import api from tests.integration.consts import urls def create(podcast_id): """Create episode request.""" return requests.post( urls.CREATE_EPISODE.format(podcast_id=podcast_id), json={'draft': True, 'title': 'title'}, headers=api.REQUEST_HEADERS ) def get_by_id(podcast_id, episode_id): """Get episode by its id request.""" return requests.get( urls.GET_EPISODE_BY_ID.format( podcast_id=podcast_id, episode_id=episode_id ), headers=api.REQUEST_HEADERS ) def update(podcast_id, episode_id, payload): """Update episode request.""" return requests.put( urls.UPDATE_EPISODE.format( podcast_id=podcast_id, episode_id=episode_id ), json=payload, headers=api.REQUEST_HEADERS ) def delete(podcast_id, episode_id): """Delete episode request.""" return requests.delete( urls.DELETE_EPISODE.format( podcast_id=podcast_id, episode_id=episode_id ), headers=api.REQUEST_HEADERS ) def create_planned_inventory(podcast_id, payload): """Create planned-inventory request.""" return requests.post( urls.CREATE_PLANNED_INVENTORY.format(podcast_id=podcast_id), json=payload, headers=api.REQUEST_HEADERS ) def create_insertion_points(podcast_id, episode_id, payload): """Create insertion-points request.""" return requests.post( urls.CREATE_INSERTION_POINTS.format( podcast_id=podcast_id, episode_id=episode_id ), json=payload, headers=api.REQUEST_HEADERS )