1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="gmail_v1.html">Gmail API</a> . <a href="gmail_v1.users.html">users</a> . <a href="gmail_v1.users.settings.html">settings</a> . <a href="gmail_v1.users.settings.filters.html">filters</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#create">create(userId, body)</a></code></p> 79<p class="firstline">Creates a filter.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(userId, id)</a></code></p> 82<p class="firstline">Deletes a filter.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(userId, id)</a></code></p> 85<p class="firstline">Gets a filter.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(userId)</a></code></p> 88<p class="firstline">Lists the message filters of a Gmail user.</p> 89<h3>Method Details</h3> 90<div class="method"> 91 <code class="details" id="create">create(userId, body)</code> 92 <pre>Creates a filter. 93 94Args: 95 userId: string, User's email address. The special value "me" can be used to indicate the authenticated user. (required) 96 body: object, The request body. (required) 97 The object takes the form of: 98 99{ # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. 100 "action": { # A set of actions to perform on a message. # Action that the filter performs. 101 "forward": "A String", # Email address that the message should be forwarded to. 102 "removeLabelIds": [ # List of labels to remove from the message. 103 "A String", 104 ], 105 "addLabelIds": [ # List of labels to add to the message. 106 "A String", 107 ], 108 }, 109 "id": "A String", # The server assigned ID of the filter. 110 "criteria": { # Message matching criteria. # Matching criteria for the filter. 111 "from": "A String", # The sender's display name or email address. 112 "hasAttachment": True or False, # Whether the message has any attachment. 113 "subject": "A String", # Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed. 114 "sizeComparison": "A String", # How the message size in bytes should be in relation to the size field. 115 "to": "A String", # The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive. 116 "query": "A String", # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 117 "excludeChats": True or False, # Whether the response should exclude chats. 118 "negatedQuery": "A String", # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 119 "size": 42, # The size of the entire RFC822 message in bytes, including all headers and attachments. 120 }, 121 } 122 123 124Returns: 125 An object of the form: 126 127 { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. 128 "action": { # A set of actions to perform on a message. # Action that the filter performs. 129 "forward": "A String", # Email address that the message should be forwarded to. 130 "removeLabelIds": [ # List of labels to remove from the message. 131 "A String", 132 ], 133 "addLabelIds": [ # List of labels to add to the message. 134 "A String", 135 ], 136 }, 137 "id": "A String", # The server assigned ID of the filter. 138 "criteria": { # Message matching criteria. # Matching criteria for the filter. 139 "from": "A String", # The sender's display name or email address. 140 "hasAttachment": True or False, # Whether the message has any attachment. 141 "subject": "A String", # Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed. 142 "sizeComparison": "A String", # How the message size in bytes should be in relation to the size field. 143 "to": "A String", # The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive. 144 "query": "A String", # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 145 "excludeChats": True or False, # Whether the response should exclude chats. 146 "negatedQuery": "A String", # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 147 "size": 42, # The size of the entire RFC822 message in bytes, including all headers and attachments. 148 }, 149 }</pre> 150</div> 151 152<div class="method"> 153 <code class="details" id="delete">delete(userId, id)</code> 154 <pre>Deletes a filter. 155 156Args: 157 userId: string, User's email address. The special value "me" can be used to indicate the authenticated user. (required) 158 id: string, The ID of the filter to be deleted. (required) 159</pre> 160</div> 161 162<div class="method"> 163 <code class="details" id="get">get(userId, id)</code> 164 <pre>Gets a filter. 165 166Args: 167 userId: string, User's email address. The special value "me" can be used to indicate the authenticated user. (required) 168 id: string, The ID of the filter to be fetched. (required) 169 170Returns: 171 An object of the form: 172 173 { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. 174 "action": { # A set of actions to perform on a message. # Action that the filter performs. 175 "forward": "A String", # Email address that the message should be forwarded to. 176 "removeLabelIds": [ # List of labels to remove from the message. 177 "A String", 178 ], 179 "addLabelIds": [ # List of labels to add to the message. 180 "A String", 181 ], 182 }, 183 "id": "A String", # The server assigned ID of the filter. 184 "criteria": { # Message matching criteria. # Matching criteria for the filter. 185 "from": "A String", # The sender's display name or email address. 186 "hasAttachment": True or False, # Whether the message has any attachment. 187 "subject": "A String", # Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed. 188 "sizeComparison": "A String", # How the message size in bytes should be in relation to the size field. 189 "to": "A String", # The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive. 190 "query": "A String", # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 191 "excludeChats": True or False, # Whether the response should exclude chats. 192 "negatedQuery": "A String", # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 193 "size": 42, # The size of the entire RFC822 message in bytes, including all headers and attachments. 194 }, 195 }</pre> 196</div> 197 198<div class="method"> 199 <code class="details" id="list">list(userId)</code> 200 <pre>Lists the message filters of a Gmail user. 201 202Args: 203 userId: string, User's email address. The special value "me" can be used to indicate the authenticated user. (required) 204 205Returns: 206 An object of the form: 207 208 { # Response for the ListFilters method. 209 "filter": [ # List of a user's filters. 210 { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. 211 "action": { # A set of actions to perform on a message. # Action that the filter performs. 212 "forward": "A String", # Email address that the message should be forwarded to. 213 "removeLabelIds": [ # List of labels to remove from the message. 214 "A String", 215 ], 216 "addLabelIds": [ # List of labels to add to the message. 217 "A String", 218 ], 219 }, 220 "id": "A String", # The server assigned ID of the filter. 221 "criteria": { # Message matching criteria. # Matching criteria for the filter. 222 "from": "A String", # The sender's display name or email address. 223 "hasAttachment": True or False, # Whether the message has any attachment. 224 "subject": "A String", # Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed. 225 "sizeComparison": "A String", # How the message size in bytes should be in relation to the size field. 226 "to": "A String", # The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive. 227 "query": "A String", # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 228 "excludeChats": True or False, # Whether the response should exclude chats. 229 "negatedQuery": "A String", # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". 230 "size": 42, # The size of the entire RFC822 message in bytes, including all headers and attachments. 231 }, 232 }, 233 ], 234 }</pre> 235</div> 236 237</body></html>