#NEWLINE# def get_messages( self , **params ) : #NEWLINE# #INDENT# 'List email messages for an account.\n\n        GET method for the messages resource.\n\n        Each of the email, to, from, cc and bcc parameters can be set to a\n        comma-separated list of email addresses. These multiple addresses\n        are treated as an OR combination.\n\n        You can set more than one parameter when doing this call. Multiple\n        parameters are treated as an AND combination.\n\n        Optional Arguments:\n            subject: string - Get messages whose subject matches this search\n                string. To use regular expressions instead of simple string\n                matching, make sure the string starts and ends with /.\n            email: string - Email address of the contact for whom you want the\n                latest messages exchanged with. By "exchanged with contact X"\n                we mean any email received from contact X, sent to contact X\n                or sent by anyone to both contact X and the source owner.\n            to: string - Email address of a contact messages have been sent to.\n            sender: string - Email address of a contact messages have been\n                received from. Same as "from" in documentation. "from" is a\n                python keyword and we can\'t use that...\n            cc: string - Email address of a contact CC\'ed on the messages.\n            bcc: string - Email address of a contact BCC\'ed on the messages.\n            folder: string - Filter messages by the folder (or Gmail label).\n                This parameter can be the complete folder name with the\n                appropriate hierarchy delimiter for the mail server being\n                queried (eg. Inbox/My folder) or the "symbolic name" of the\n                folder (eg. \\Starred). The symbolic name refers to attributes\n                used to refer to special use folders in a language-independant\n                way. See http://code.google.com/apis/gmail/imap/#xlist\n                (Gmail specific) and RFC-6154.\n            source: string - Filter messages by the account source label.\n            file_name: string - Search for files based on their name. You can\n                filter names using typical shell wildcards such as *, ? and []\n                or regular expressions by enclosing the search expression in a\n                leading / and trailing /. For example, *.pdf would give you\n                all PDF files while /\\.jpe?g$/ would return all files whose\n                name ends with .jpg or .jpeg\n            file_size_min: integer - Search for files based on their size (in bytes).\n            file_size_max: integer - Search for files based on their size (in bytes).\n            date_before: integer (unix time) - Only include messages before a\n                given timestamp. The value this filter is applied to is the\n                Date: header of the message which refers to the time the\n                message is sent from the origin.\n            date_after: integer (unix time) - Only include messages after a\n                given timestamp. The value this filter is applied to is the\n                Date: header of the message which refers to the time the\n                message is sent from the origin.\n            indexed_before: integer (unix time) - Only include messages\n                indexed before a given timestamp. This is not the same as the\n                date of the email, it is the time Context.IO indexed this\n                message.\n            indexed_after: integer (unix time) - Only include messages indexed\n                after a given timestamp. This is not the same as the date of\n                the email, it is the time Context.IO indexed this message.\n            include_thread_size: integer - Set to 1 to include thread size in the result.\n            include_body: integer - Set to 1 to include message bodies in the\n                result. Since message bodies must be retrieved from the IMAP\n                server, expect a performance hit when setting this parameter.\n            include_headers: mixed - Can be set to 0 (default), 1 or raw. If\n                set to 1, complete message headers, parsed into an array, are\n                included in the results. If set to raw, the headers are also\n                included but as a raw unparsed string. Since full original\n                headers bodies must be retrieved from the IMAP server, expect\n                a performance hit when setting this parameter.\n            include_flags: integer - Set to 1 to include IMAP flags of\n                messages in the result. Since message flags must be retrieved\n                from the IMAP server, expect a performance hit when setting\n                this parameter.\n            body_type: string - Used when include_body is set to get only body\n                parts of a given MIME-type (for example text/html)\n            include_source: integer - Set to 1 to include message sources in the\n                result. Since message sources must be retrieved from the IMAP server,\n                expect a performance hit when setting this parameter.\n            sort_order: string - The sort order of the returned results.\n                Possible values are asc and desc\n            limit: integer - The maximum number of results to return.\n            offset: integer - Start the list at this offset (zero-based).\n\n        Returns:\n            A list of Message objects.\n        ' #NEWLINE# all_args = [ 'subject' , 'email' , 'to' , 'sender' , 'from_' , 'cc' , 'bcc' , 'folder' , 'date_before' , 'date_after' , 'indexed_before' , 'indexed_after' , 'include_thread_size' , 'include_body' , 'source' , 'file_name' , 'file_size_min' , 'file_size_max' , 'include_source' , 'include_headers' , 'include_flags' , 'body_type' , 'sort_order' , 'limit' , 'offset' ] #NEWLINE# params = helpers . sanitize_params ( params , all_args ) #NEWLINE# if ( 'sender' in params ) : #NEWLINE# #INDENT# params [ 'from' ] = params [ 'sender' ] #NEWLINE# del params [ 'sender' ] #NEWLINE# #UNINDENT# if ( 'from_' in params ) : #NEWLINE# #INDENT# params [ 'from' ] = params [ 'from_' ] #NEWLINE# del params [ 'from_' ] #NEWLINE# #UNINDENT# return [ Message ( self , obj ) for obj in self . _request_uri ( 'messages' , params = params ) ]