• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
81  <code><a href="#create">create(userId, body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Creates a filter. Note: you can only create a maximum of 1,000 filters.</p>
83<p class="toc_element">
84  <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
85<p class="firstline">Deletes a filter.</p>
86<p class="toc_element">
87  <code><a href="#get">get(userId, id, x__xgafv=None)</a></code></p>
88<p class="firstline">Gets a filter.</p>
89<p class="toc_element">
90  <code><a href="#list">list(userId, x__xgafv=None)</a></code></p>
91<p class="firstline">Lists the message filters of a Gmail user.</p>
92<h3>Method Details</h3>
93<div class="method">
94    <code class="details" id="close">close()</code>
95  <pre>Close httplib2 connections.</pre>
96</div>
97
98<div class="method">
99    <code class="details" id="create">create(userId, body=None, x__xgafv=None)</code>
100  <pre>Creates a filter. Note: you can only create a maximum of 1,000 filters.
101
102Args:
103  userId: string, User&#x27;s email address. The special value &quot;me&quot; can be used to indicate the authenticated user. (required)
104  body: object, The request body.
105    The object takes the form of:
106
107{ # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
108  &quot;action&quot;: { # A set of actions to perform on a message. # Action that the filter performs.
109    &quot;addLabelIds&quot;: [ # List of labels to add to the message.
110      &quot;A String&quot;,
111    ],
112    &quot;forward&quot;: &quot;A String&quot;, # Email address that the message should be forwarded to.
113    &quot;removeLabelIds&quot;: [ # List of labels to remove from the message.
114      &quot;A String&quot;,
115    ],
116  },
117  &quot;criteria&quot;: { # Message matching criteria. # Matching criteria for the filter.
118    &quot;excludeChats&quot;: True or False, # Whether the response should exclude chats.
119    &quot;from&quot;: &quot;A String&quot;, # The sender&#x27;s display name or email address.
120    &quot;hasAttachment&quot;: True or False, # Whether the message has any attachment.
121    &quot;negatedQuery&quot;: &quot;A String&quot;, # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
122    &quot;query&quot;: &quot;A String&quot;, # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
123    &quot;size&quot;: 42, # The size of the entire RFC822 message in bytes, including all headers and attachments.
124    &quot;sizeComparison&quot;: &quot;A String&quot;, # How the message size in bytes should be in relation to the size field.
125    &quot;subject&quot;: &quot;A String&quot;, # Case-insensitive phrase found in the message&#x27;s subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
126    &quot;to&quot;: &quot;A String&quot;, # The recipient&#x27;s display name or email address. Includes recipients in the &quot;to&quot;, &quot;cc&quot;, and &quot;bcc&quot; header fields. You can use simply the local part of the email address. For example, &quot;example&quot; and &quot;example@&quot; both match &quot;example@gmail.com&quot;. This field is case-insensitive.
127  },
128  &quot;id&quot;: &quot;A String&quot;, # The server assigned ID of the filter.
129}
130
131  x__xgafv: string, V1 error format.
132    Allowed values
133      1 - v1 error format
134      2 - v2 error format
135
136Returns:
137  An object of the form:
138
139    { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
140  &quot;action&quot;: { # A set of actions to perform on a message. # Action that the filter performs.
141    &quot;addLabelIds&quot;: [ # List of labels to add to the message.
142      &quot;A String&quot;,
143    ],
144    &quot;forward&quot;: &quot;A String&quot;, # Email address that the message should be forwarded to.
145    &quot;removeLabelIds&quot;: [ # List of labels to remove from the message.
146      &quot;A String&quot;,
147    ],
148  },
149  &quot;criteria&quot;: { # Message matching criteria. # Matching criteria for the filter.
150    &quot;excludeChats&quot;: True or False, # Whether the response should exclude chats.
151    &quot;from&quot;: &quot;A String&quot;, # The sender&#x27;s display name or email address.
152    &quot;hasAttachment&quot;: True or False, # Whether the message has any attachment.
153    &quot;negatedQuery&quot;: &quot;A String&quot;, # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
154    &quot;query&quot;: &quot;A String&quot;, # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
155    &quot;size&quot;: 42, # The size of the entire RFC822 message in bytes, including all headers and attachments.
156    &quot;sizeComparison&quot;: &quot;A String&quot;, # How the message size in bytes should be in relation to the size field.
157    &quot;subject&quot;: &quot;A String&quot;, # Case-insensitive phrase found in the message&#x27;s subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
158    &quot;to&quot;: &quot;A String&quot;, # The recipient&#x27;s display name or email address. Includes recipients in the &quot;to&quot;, &quot;cc&quot;, and &quot;bcc&quot; header fields. You can use simply the local part of the email address. For example, &quot;example&quot; and &quot;example@&quot; both match &quot;example@gmail.com&quot;. This field is case-insensitive.
159  },
160  &quot;id&quot;: &quot;A String&quot;, # The server assigned ID of the filter.
161}</pre>
162</div>
163
164<div class="method">
165    <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
166  <pre>Deletes a filter.
167
168Args:
169  userId: string, User&#x27;s email address. The special value &quot;me&quot; can be used to indicate the authenticated user. (required)
170  id: string, The ID of the filter to be deleted. (required)
171  x__xgafv: string, V1 error format.
172    Allowed values
173      1 - v1 error format
174      2 - v2 error format
175</pre>
176</div>
177
178<div class="method">
179    <code class="details" id="get">get(userId, id, x__xgafv=None)</code>
180  <pre>Gets a filter.
181
182Args:
183  userId: string, User&#x27;s email address. The special value &quot;me&quot; can be used to indicate the authenticated user. (required)
184  id: string, The ID of the filter to be fetched. (required)
185  x__xgafv: string, V1 error format.
186    Allowed values
187      1 - v1 error format
188      2 - v2 error format
189
190Returns:
191  An object of the form:
192
193    { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
194  &quot;action&quot;: { # A set of actions to perform on a message. # Action that the filter performs.
195    &quot;addLabelIds&quot;: [ # List of labels to add to the message.
196      &quot;A String&quot;,
197    ],
198    &quot;forward&quot;: &quot;A String&quot;, # Email address that the message should be forwarded to.
199    &quot;removeLabelIds&quot;: [ # List of labels to remove from the message.
200      &quot;A String&quot;,
201    ],
202  },
203  &quot;criteria&quot;: { # Message matching criteria. # Matching criteria for the filter.
204    &quot;excludeChats&quot;: True or False, # Whether the response should exclude chats.
205    &quot;from&quot;: &quot;A String&quot;, # The sender&#x27;s display name or email address.
206    &quot;hasAttachment&quot;: True or False, # Whether the message has any attachment.
207    &quot;negatedQuery&quot;: &quot;A String&quot;, # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
208    &quot;query&quot;: &quot;A String&quot;, # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
209    &quot;size&quot;: 42, # The size of the entire RFC822 message in bytes, including all headers and attachments.
210    &quot;sizeComparison&quot;: &quot;A String&quot;, # How the message size in bytes should be in relation to the size field.
211    &quot;subject&quot;: &quot;A String&quot;, # Case-insensitive phrase found in the message&#x27;s subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
212    &quot;to&quot;: &quot;A String&quot;, # The recipient&#x27;s display name or email address. Includes recipients in the &quot;to&quot;, &quot;cc&quot;, and &quot;bcc&quot; header fields. You can use simply the local part of the email address. For example, &quot;example&quot; and &quot;example@&quot; both match &quot;example@gmail.com&quot;. This field is case-insensitive.
213  },
214  &quot;id&quot;: &quot;A String&quot;, # The server assigned ID of the filter.
215}</pre>
216</div>
217
218<div class="method">
219    <code class="details" id="list">list(userId, x__xgafv=None)</code>
220  <pre>Lists the message filters of a Gmail user.
221
222Args:
223  userId: string, User&#x27;s email address. The special value &quot;me&quot; can be used to indicate the authenticated user. (required)
224  x__xgafv: string, V1 error format.
225    Allowed values
226      1 - v1 error format
227      2 - v2 error format
228
229Returns:
230  An object of the form:
231
232    { # Response for the ListFilters method.
233  &quot;filter&quot;: [ # List of a user&#x27;s filters.
234    { # Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
235      &quot;action&quot;: { # A set of actions to perform on a message. # Action that the filter performs.
236        &quot;addLabelIds&quot;: [ # List of labels to add to the message.
237          &quot;A String&quot;,
238        ],
239        &quot;forward&quot;: &quot;A String&quot;, # Email address that the message should be forwarded to.
240        &quot;removeLabelIds&quot;: [ # List of labels to remove from the message.
241          &quot;A String&quot;,
242        ],
243      },
244      &quot;criteria&quot;: { # Message matching criteria. # Matching criteria for the filter.
245        &quot;excludeChats&quot;: True or False, # Whether the response should exclude chats.
246        &quot;from&quot;: &quot;A String&quot;, # The sender&#x27;s display name or email address.
247        &quot;hasAttachment&quot;: True or False, # Whether the message has any attachment.
248        &quot;negatedQuery&quot;: &quot;A String&quot;, # Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
249        &quot;query&quot;: &quot;A String&quot;, # Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
250        &quot;size&quot;: 42, # The size of the entire RFC822 message in bytes, including all headers and attachments.
251        &quot;sizeComparison&quot;: &quot;A String&quot;, # How the message size in bytes should be in relation to the size field.
252        &quot;subject&quot;: &quot;A String&quot;, # Case-insensitive phrase found in the message&#x27;s subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
253        &quot;to&quot;: &quot;A String&quot;, # The recipient&#x27;s display name or email address. Includes recipients in the &quot;to&quot;, &quot;cc&quot;, and &quot;bcc&quot; header fields. You can use simply the local part of the email address. For example, &quot;example&quot; and &quot;example@&quot; both match &quot;example@gmail.com&quot;. This field is case-insensitive.
254      },
255      &quot;id&quot;: &quot;A String&quot;, # The server assigned ID of the filter.
256    },
257  ],
258}</pre>
259</div>
260
261</body></html>