'Returns a list of the direct messages sent to the authenticating user.
Args:
since_id:
Returns results with an ID greater than (that is, more recent
than) the specified ID. There are limits to the number of
Tweets which can be accessed through the API. If the limit of
Tweets has occurred since the since_id, the since_id will be
forced to the oldest ID available. [Optional]
max_id:
Returns results with an ID less than (that is, older than) or
equal to the specified ID. [Optional]
count:
Specifies the number of direct messages to try and retrieve, up to a
maximum of 200. The value of count is best thought of as a limit to the
number of Tweets to return because suspended or deleted content is
removed after the count has been applied. [Optional]
include_entities:
The entities node will be omitted when set to False.
[Optional]
skip_status:
When set to True statuses will not be included in the returned user
objects. [Optional]
full_text:
When set to True full message will be included in the returned message
object if message length is bigger than 140 characters. [Optional]
page:
If you want more than 200 messages, you can use this and get 20 messages
each time. You must recall it and increment the page value until it
return nothing. You can\'t use count option with it. First value is 1 and
not 0.
Returns:
A sequence of twitter.DirectMessage instances'

def GetDirectMessages(self, since_id=None, max_id=None, count=None, include_entities=True, skip_status=False, full_text=False, page=None):

    url = ('%s/direct_messages.json' % self.base_url)
    parameters = {}
    if since_id:
        parameters['since_id'] = since_id
    if max_id:
        parameters['max_id'] = max_id
    if count:
        try:
            parameters['count'] = int(count)
        except ValueError:
            raise TwitterError({'message': 'count    must    be    an    integer'})
    if (not include_entities):
        parameters['include_entities'] = 'false'
    if skip_status:
        parameters['skip_status'] = 1
    if full_text:
        parameters['full_text'] = 'true'
    if page:
        parameters['page'] = page
    resp = self._RequestUrl(url, 'GET', data=parameters)
    data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
    return [DirectMessage.NewFromJsonDict(x) for x in data]
