"""Api Podcast. API to talk to megaphone for the podcast model. """ from podcast.models.api_base import ApiBase class ApiPodcast(ApiBase): """API to talk to megaphone for the podcast model.""" def get_all(self, page=1, per_page=50): """Get all podcasts.""" return self._paginated_get( 'podcasts?page={0}&per_page={1}'.format(page, per_page)) def create(self, podcast_data): """Create a podcast.""" return self._post('podcasts', podcast_data) def delete(self, podcast_id): """Delete a podcast.""" return self._delete('podcasts/{0}'.format(podcast_id)) def get(self, podcast_id): """Get a single podcast.""" return self._get('podcasts/{0}'.format(podcast_id)) def update(self, podcast_id, data): """Update a single podcast.""" return self._put('podcasts/{0}'.format(podcast_id), data)