- """ account/update_profile """
- update_profile = bind_api(
- path = '/account/update_profile.json',
- method = 'POST',
- payload_type = 'user',
- allowed_param = ['name', 'url', 'location', 'description'],
- require_auth = True
- )
-
- """ favorites """
- favorites = bind_api(
- path = '/favorites/list.json',
- payload_type = 'status', payload_list = True,
- allowed_param = ['screen_name', 'user_id', 'max_id', 'count', 'since_id', 'max_id']
- )
-
- """ favorites/create """
- create_favorite = bind_api(
- path = '/favorites/create.json',
- method = 'POST',
- payload_type = 'status',
- allowed_param = ['id'],
- require_auth = True
- )
-
- """ favorites/destroy """
- destroy_favorite = bind_api(
- path = '/favorites/destroy.json',
- method = 'POST',
- payload_type = 'status',
- allowed_param = ['id'],
- require_auth = True
- )
-
- """ blocks/create """
- create_block = bind_api(
- path = '/blocks/create.json',
- method = 'POST',
- payload_type = 'user',
- allowed_param = ['id', 'user_id', 'screen_name'],
- require_auth = True
- )
-
- """ blocks/destroy """
- destroy_block = bind_api(
- path = '/blocks/destroy.json',
- method = 'DELETE',
- payload_type = 'user',
- allowed_param = ['id', 'user_id', 'screen_name'],
- require_auth = True
- )
-
- """ blocks/blocking """
- blocks = bind_api(
- path = '/blocks/list.json',
- payload_type = 'user', payload_list = True,
- allowed_param = ['cursor'],
- require_auth = True
- )
-
- """ blocks/blocking/ids """
- blocks_ids = bind_api(
- path = '/blocks/ids.json',
- payload_type = 'json',
- require_auth = True
- )
-
- """ report_spam """
- report_spam = bind_api(
- path = '/users/report_spam.json',
- method = 'POST',
- payload_type = 'user',
- allowed_param = ['user_id', 'screen_name'],
- require_auth = True
- )
-
- """ saved_searches """
- saved_searches = bind_api(
- path = '/saved_searches/list.json',
- payload_type = 'saved_search', payload_list = True,
- require_auth = True
- )
-
- """ saved_searches/show """
- get_saved_search = bind_api(
- path = '/saved_searches/show/{id}.json',
- payload_type = 'saved_search',
- allowed_param = ['id'],
- require_auth = True
- )
-
- """ saved_searches/create """
- create_saved_search = bind_api(
- path = '/saved_searches/create.json',
- method = 'POST',
- payload_type = 'saved_search',
- allowed_param = ['query'],
- require_auth = True
- )
-
- """ saved_searches/destroy """
- destroy_saved_search = bind_api(
- path = '/saved_searches/destroy/{id}.json',
- method = 'POST',
- payload_type = 'saved_search',
- allowed_param = ['id'],
- require_auth = True
- )
-
- create_list = bind_api(
- path = '/lists/create.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['name', 'mode', 'description'],
- require_auth = True
- )
-
- destroy_list = bind_api(
- path = '/lists/destroy.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['owner_screen_name', 'owner_id', 'list_id', 'slug'],
- require_auth = True
- )
-
- update_list = bind_api(
- path = '/lists/update.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['list_id', 'slug', 'name', 'mode', 'description', 'owner_screen_name', 'owner_id'],
- require_auth = True
- )
-
- lists_all = bind_api(
- path = '/lists/list.json',
- payload_type = 'list', payload_list = True,
- allowed_param = ['screen_name', 'user_id'],
- require_auth = True
- )
-
- lists_memberships = bind_api(
- path = '/lists/memberships.json',
- payload_type = 'list', payload_list = True,
- allowed_param = ['screen_name', 'user_id', 'filter_to_owned_lists', 'cursor'],
- require_auth = True
- )
-
- lists_subscriptions = bind_api(
- path = '/lists/subscriptions.json',
- payload_type = 'list', payload_list = True,
- allowed_param = ['screen_name', 'user_id', 'cursor'],
- require_auth = True
- )
-
- list_timeline = bind_api(
- path = '/lists/statuses.json',
- payload_type = 'status', payload_list = True,
- allowed_param = ['owner_screen_name', 'slug', 'owner_id', 'list_id', 'since_id', 'max_id', 'count', 'include_rts']
- )
-
- get_list = bind_api(
- path = '/lists/show.json',
- payload_type = 'list',
- allowed_param = ['owner_screen_name', 'owner_id', 'slug', 'list_id']
- )
-
- add_list_member = bind_api(
- path = '/lists/members/create.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'],
- require_auth = True
- )
-
- remove_list_member = bind_api(
- path = '/lists/members/destroy.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'],
- require_auth = True
- )
-
- list_members = bind_api(
- path = '/lists/members.json',
- payload_type = 'user', payload_list = True,
- allowed_param = ['owner_screen_name', 'slug', 'list_id', 'owner_id', 'cursor']
- )
-
- show_list_member = bind_api(
- path = '/lists/members/show.json',
- payload_type = 'user',
- allowed_param = ['list_id', 'slug', 'user_id', 'screen_name', 'owner_screen_name', 'owner_id']
- )
-
- subscribe_list = bind_api(
- path = '/lists/subscribers/create.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['owner_screen_name', 'slug', 'owner_id', 'list_id'],
- require_auth = True
- )
-
- unsubscribe_list = bind_api(
- path = '/lists/subscribers/destroy.json',
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['owner_screen_name', 'slug', 'owner_id', 'list_id'],
- require_auth = True
- )
-
- list_subscribers = bind_api(
- path = '/lists/subscribers.json',
- payload_type = 'user', payload_list = True,
- allowed_param = ['owner_screen_name', 'slug', 'owner_id', 'list_id', 'cursor']
- )
-
- show_list_subscriber = bind_api(
- path = '/lists/subscribers/show.json',
- payload_type = 'user',
- allowed_param = ['owner_screen_name', 'slug', 'screen_name', 'owner_id', 'list_id', 'user_id']
- )
-
- """ trends/available """
- trends_available = bind_api(
- path = '/trends/available.json',
- payload_type = 'json'
- )
-
- trends_place = bind_api(
- path = '/trends/place.json',
- payload_type = 'json',
- allowed_param = ['id', 'exclude']
- )
-
- trends_closest = bind_api(
- path = '/trends/closest.json',
- payload_type = 'json',
- allowed_param = ['lat', 'long']
- )
-
- """ search """
- search = bind_api(
- path = '/search/tweets.json',
- payload_type = 'search_results',
- allowed_param = ['q', 'lang', 'locale', 'since_id', 'geocode', 'max_id', 'since', 'until', 'result_type', 'count', 'include_entities', 'from', 'to', 'source']
- )
-
- """ trends/daily """
- trends_daily = bind_api(
- path = '/trends/daily.json',
- payload_type = 'json',
- allowed_param = ['date', 'exclude']
- )
-
- """ trends/weekly """
- trends_weekly = bind_api(
- path = '/trends/weekly.json',
- payload_type = 'json',
- allowed_param = ['date', 'exclude']
- )
-
- """ geo/reverse_geocode """
- reverse_geocode = bind_api(
- path = '/geo/reverse_geocode.json',
- payload_type = 'place', payload_list = True,
- allowed_param = ['lat', 'long', 'accuracy', 'granularity', 'max_results']
- )
-
- """ geo/id """
- geo_id = bind_api(
- path = '/geo/id/{id}.json',
- payload_type = 'place',
- allowed_param = ['id']
- )
-
- """ geo/search """
- geo_search = bind_api(
- path = '/geo/search.json',
- payload_type = 'place', payload_list = True,
- allowed_param = ['lat', 'long', 'query', 'ip', 'granularity', 'accuracy', 'max_results', 'contained_within']
- )
-
- """ geo/similar_places """
- geo_similar_places = bind_api(
- path = '/geo/similar_places.json',
- payload_type = 'place', payload_list = True,
- allowed_param = ['lat', 'long', 'name', 'contained_within']
- )
-
- """ help/languages.json """
- supported_languages = bind_api(
- path = '/help/languages.json',
- payload_type = 'json',
- require_auth = True
- )
-
- """ help/configuration """
- configuration = bind_api(
- path = '/help/configuration.json',
- payload_type = 'json',
- require_auth = True
- )
+ @property
+ def get_saved_search(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/saved_searches/show/%3Aid
+ :allowed_param:'id'
+ """
+ return bind_api(
+ api=self,
+ path='/saved_searches/show/{id}.json',
+ payload_type='saved_search',
+ allowed_param=['id'],
+ require_auth=True
+ )
+
+ @property
+ def create_saved_search(self):
+ """ :reference: https://dev.twitter.com/rest/reference/post/saved_searches/create
+ :allowed_param:'query'
+ """
+ return bind_api(
+ api=self,
+ path='/saved_searches/create.json',
+ method='POST',
+ payload_type='saved_search',
+ allowed_param=['query'],
+ require_auth=True
+ )
+
+ @property
+ def destroy_saved_search(self):
+ """ :reference: https://dev.twitter.com/rest/reference/post/saved_searches/destroy/%3Aid
+ :allowed_param:'id'
+ """
+ return bind_api(
+ api=self,
+ path='/saved_searches/destroy/{id}.json',
+ method='POST',
+ payload_type='saved_search',
+ allowed_param=['id'],
+ require_auth=True
+ )
+
+ @property
+ def create_list(self):
+ """ :reference: https://dev.twitter.com/rest/reference/post/lists/create
+ :allowed_param:'name', 'mode', 'description'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/create.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['name', 'mode', 'description'],
+ require_auth=True
+ )
+
+ @property
+ def destroy_list(self):
+ """ :reference: https://dev.twitter.com/rest/reference/post/lists/destroy
+ :allowed_param:'owner_screen_name', 'owner_id', 'list_id', 'slug'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/destroy.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['owner_screen_name', 'owner_id', 'list_id', 'slug'],
+ require_auth=True
+ )
+
+ @property
+ def update_list(self):
+ """ :reference: https://dev.twitter.com/rest/reference/post/lists/update
+ :allowed_param: list_id', 'slug', 'name', 'mode', 'description', 'owner_screen_name', 'owner_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/update.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['list_id', 'slug', 'name', 'mode', 'description', 'owner_screen_name', 'owner_id'],
+ require_auth=True
+ )
+
+ @property
+ def lists_all(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/lists/list
+ :allowed_param:'screen_name', 'user_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/list.json',
+ payload_type='list', payload_list=True,
+ allowed_param=['screen_name', 'user_id'],
+ require_auth=True
+ )
+
+ @property
+ def lists_memberships(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/lists/memberships
+ :allowed_param:'screen_name', 'user_id', 'filter_to_owned_lists', 'cursor'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/memberships.json',
+ payload_type='list', payload_list=True,
+ allowed_param=['screen_name', 'user_id', 'filter_to_owned_lists', 'cursor'],
+ require_auth=True
+ )
+
+ @property
+ def lists_subscriptions(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/lists/subscriptions
+ :allowed_param:'screen_name', 'user_id', 'cursor'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/subscriptions.json',
+ payload_type='list', payload_list=True,
+ allowed_param=['screen_name', 'user_id', 'cursor'],
+ require_auth=True
+ )
+
+ @property
+ def list_timeline(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/lists/statuses
+ :allowed_param:'owner_screen_name', 'slug', 'owner_id', 'list_id',
+ 'since_id', 'max_id', 'count', 'include_rts
+ """
+ return bind_api(
+ api=self,
+ path='/lists/statuses.json',
+ payload_type='status', payload_list=True,
+ allowed_param=['owner_screen_name', 'slug', 'owner_id',
+ 'list_id', 'since_id', 'max_id', 'count',
+ 'include_rts']
+ )
+
+ @property
+ def get_list(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/lists/show
+ :allowed_param:'owner_screen_name', 'owner_id', 'slug', 'list_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/show.json',
+ payload_type='list',
+ allowed_param=['owner_screen_name', 'owner_id', 'slug', 'list_id']
+ )
+
+ @property
+ def add_list_member(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/members/create
+ :allowed_param:'screen_name', 'user_id', 'owner_screen_name',
+ 'owner_id', 'slug', 'list_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members/create.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['screen_name', 'user_id', 'owner_screen_name',
+ 'owner_id', 'slug', 'list_id'],
+ require_auth=True
+ )
+
+ @property
+ def remove_list_member(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/members/destroy
+ :allowed_param:'screen_name', 'user_id', 'owner_screen_name',
+ 'owner_id', 'slug', 'list_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members/destroy.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['screen_name', 'user_id', 'owner_screen_name',
+ 'owner_id', 'slug', 'list_id'],
+ require_auth=True
+ )
+
+ def add_list_members(self, screen_name=None, user_id=None, slug=None,
+ list_id=None, owner_id=None, owner_screen_name=None):
+ """ Perform bulk add of list members from user ID or screenname """
+ return self._add_list_members(list_to_csv(screen_name),
+ list_to_csv(user_id),
+ slug, list_id, owner_id,
+ owner_screen_name)
+
+ @property
+ def _add_list_members(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/members/create_all
+ :allowed_param:'screen_name', 'user_id', 'slug', 'lit_id',
+ 'owner_id', 'owner_screen_name'
+
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members/create_all.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['screen_name', 'user_id', 'slug', 'lit_id',
+ 'owner_id', 'owner_screen_name'],
+ require_auth=True
+ )
+
+ def remove_list_members(self, screen_name=None, user_id=None, slug=None,
+ list_id=None, owner_id=None, owner_screen_name=None):
+ """ Perform bulk remove of list members from user ID or screenname """
+ return self._remove_list_members(list_to_csv(screen_name),
+ list_to_csv(user_id),
+ slug, list_id, owner_id,
+ owner_screen_name)
+
+ @property
+ def _remove_list_members(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/members/destroy_all
+ :allowed_param:'screen_name', 'user_id', 'slug', 'lit_id',
+ 'owner_id', 'owner_screen_name'
+
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members/destroy_all.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['screen_name', 'user_id', 'slug', 'lit_id',
+ 'owner_id', 'owner_screen_name'],
+ require_auth=True
+ )
+
+ @property
+ def list_members(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/lists/members
+ :allowed_param:'owner_screen_name', 'slug', 'list_id',
+ 'owner_id', 'cursor
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members.json',
+ payload_type='user', payload_list=True,
+ allowed_param=['owner_screen_name', 'slug', 'list_id',
+ 'owner_id', 'cursor']
+ )
+
+ @property
+ def show_list_member(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/lists/members/show
+ :allowed_param:'list_id', 'slug', 'user_id', 'screen_name',
+ 'owner_screen_name', 'owner_id
+ """
+ return bind_api(
+ api=self,
+ path='/lists/members/show.json',
+ payload_type='user',
+ allowed_param=['list_id', 'slug', 'user_id', 'screen_name',
+ 'owner_screen_name', 'owner_id']
+ )
+
+ @property
+ def subscribe_list(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/subscribers/create
+ :allowed_param:'owner_screen_name', 'slug', 'owner_id',
+ 'list_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/subscribers/create.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['owner_screen_name', 'slug', 'owner_id',
+ 'list_id'],
+ require_auth=True
+ )
+
+ @property
+ def unsubscribe_list(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/post/lists/subscribers/destroy
+ :allowed_param:'owner_screen_name', 'slug', 'owner_id',
+ 'list_id'
+ """
+ return bind_api(
+ api=self,
+ path='/lists/subscribers/destroy.json',
+ method='POST',
+ payload_type='list',
+ allowed_param=['owner_screen_name', 'slug', 'owner_id',
+ 'list_id'],
+ require_auth=True
+ )
+
+ @property
+ def list_subscribers(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/lists/subscribers
+ :allowed_param:'owner_screen_name', 'slug', 'owner_id',
+ 'list_id', 'cursor
+ """
+ return bind_api(
+ api=self,
+ path='/lists/subscribers.json',
+ payload_type='user', payload_list=True,
+ allowed_param=['owner_screen_name', 'slug', 'owner_id',
+ 'list_id', 'cursor']
+ )
+
+ @property
+ def show_list_subscriber(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/lists/subscribers/show
+ :allowed_param:'owner_screen_name', 'slug', 'screen_name',
+ 'owner_id', 'list_id', 'user_id
+ """
+ return bind_api(
+ api=self,
+ path='/lists/subscribers/show.json',
+ payload_type='user',
+ allowed_param=['owner_screen_name', 'slug', 'screen_name',
+ 'owner_id', 'list_id', 'user_id']
+ )
+
+ @property
+ def trends_available(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/trends/available """
+ return bind_api(
+ api=self,
+ path='/trends/available.json',
+ payload_type='json'
+ )
+
+ @property
+ def trends_place(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/trends/place
+ :allowed_param:'id', 'exclude'
+ """
+ return bind_api(
+ api=self,
+ path='/trends/place.json',
+ payload_type='json',
+ allowed_param=['id', 'exclude']
+ )
+
+ @property
+ def trends_closest(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/trends/closest
+ :allowed_param:'lat', 'long'
+ """
+ return bind_api(
+ api=self,
+ path='/trends/closest.json',
+ payload_type='json',
+ allowed_param=['lat', 'long']
+ )
+
+ @property
+ def search(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/search/tweets
+ :allowed_param:'q', 'lang', 'locale', 'since_id', 'geocode',
+ 'max_id', 'since', 'until', 'result_type', 'count',
+ 'include_entities', 'from', 'to', 'source']
+ """
+ return bind_api(
+ api=self,
+ path='/search/tweets.json',
+ payload_type='search_results',
+ allowed_param=['q', 'lang', 'locale', 'since_id', 'geocode',
+ 'max_id', 'since', 'until', 'result_type',
+ 'count', 'include_entities', 'from',
+ 'to', 'source']
+ )
+
+ @property
+ def reverse_geocode(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/geo/reverse_geocode
+ :allowed_param:'lat', 'long', 'accuracy', 'granularity', 'max_results'
+ """
+ return bind_api(
+ api=self,
+ path='/geo/reverse_geocode.json',
+ payload_type='place', payload_list=True,
+ allowed_param=['lat', 'long', 'accuracy', 'granularity',
+ 'max_results']
+ )
+
+ @property
+ def geo_id(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/geo/id/%3Aplace_id
+ :allowed_param:'id'
+ """
+ return bind_api(
+ api=self,
+ path='/geo/id/{id}.json',
+ payload_type='place',
+ allowed_param=['id']
+ )
+
+ @property
+ def geo_search(self):
+ """ :reference: https://dev.twitter.com/docs/api/1.1/get/geo/search
+ :allowed_param:'lat', 'long', 'query', 'ip', 'granularity',
+ 'accuracy', 'max_results', 'contained_within
+
+ """
+ return bind_api(
+ api=self,
+ path='/geo/search.json',
+ payload_type='place', payload_list=True,
+ allowed_param=['lat', 'long', 'query', 'ip', 'granularity',
+ 'accuracy', 'max_results', 'contained_within']
+ )
+
+ @property
+ def geo_similar_places(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/geo/similar_places
+ :allowed_param:'lat', 'long', 'name', 'contained_within'
+ """
+ return bind_api(
+ api=self,
+ path='/geo/similar_places.json',
+ payload_type='place', payload_list=True,
+ allowed_param=['lat', 'long', 'name', 'contained_within']
+ )
+
+ @property
+ def supported_languages(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/help/languages """
+ return bind_api(
+ api=self,
+ path='/help/languages.json',
+ payload_type='json',
+ require_auth=True
+ )
+
+ @property
+ def configuration(self):
+ """ :reference: https://dev.twitter.com/rest/reference/get/help/configuration """
+ return bind_api(
+ api=self,
+ path='/help/configuration.json',
+ payload_type='json',
+ require_auth=True
+ )