Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Added a few missing Classes and methods #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions pypodio2/areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,41 @@ def sanitize_id(self, item_id):
return item_id


class Embed(Area):

def __init__(self, *args, **kwargs):
super(Embed, self).__init__(*args, **kwargs)

def create(self, attributes):
if type(attributes) != dict:
return ApiErrorException('Must be of type dict')
attributes = json.dumps(attributes)
return self.transport.POST(url='/embed/', body=attributes, type='application/json')

class Contact(Area):

def __init__(self, *args, **kwargs):
super(Contact, self).__init__(*args, **kwargs)

def create(self, space_id, attributes):
if type(attributes) != dict:
return ApiErrorException('Must be of type dict')
attributes = json.dumps(attributes)
return self.transport.POST(url='/contact/space/%d/' % space_id, body=attributes, type='application/json')


class Search(Area):

def __init__(self, *args, **kwargs):
super(Search, self).__init__(*args, **kwargs)

def searchApp(self, app_id, attributes):
if type(attributes) != dict:
return ApiErrorException('Must be of type dict')
attributes = json.dumps(attributes)
return self.transport.POST(url='/search/app/%d/' % app_id, body=attributes, type='application/json')


class Item(Area):

def __init__(self, *args, **kwargs):
Expand Down