blob: 497cab8c47b1bb86228814e898b77241a0ef2b2c [file] [log] [blame]
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001<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="drive_v3.html">Drive API</a> . <a href="drive_v3.revisions.html">revisions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080081 <code><a href="#delete">delete(fileId, revisionId)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080083<p class="toc_element">
84 <code><a href="#get">get(fileId, revisionId, acknowledgeAbuse=None)</a></code></p>
85<p class="firstline">Gets a revision's metadata or content by ID.</p>
86<p class="toc_element">
87 <code><a href="#get_media">get_media(fileId, revisionId, acknowledgeAbuse=None)</a></code></p>
88<p class="firstline">Gets a revision's metadata or content by ID.</p>
89<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070090 <code><a href="#list">list(fileId, pageSize=None, pageToken=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080091<p class="firstline">Lists a file's revisions.</p>
92<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070093 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#update">update(fileId, revisionId, body=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080097<p class="firstline">Updates a revision with patch semantics.</p>
98<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800105 <code class="details" id="delete">delete(fileId, revisionId)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700106 <pre>Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can&#x27;t be deleted.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800107
108Args:
109 fileId: string, The ID of the file. (required)
110 revisionId: string, The ID of the revision. (required)
111</pre>
112</div>
113
114<div class="method">
115 <code class="details" id="get">get(fileId, revisionId, acknowledgeAbuse=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 <pre>Gets a revision&#x27;s metadata or content by ID.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800117
118Args:
119 fileId: string, The ID of the file. (required)
120 revisionId: string, The ID of the revision. (required)
121 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
122
123Returns:
124 An object of the form:
125
126 { # The metadata for a revision to a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800127 &quot;exportLinks&quot;: { # Links for exporting Docs Editors files to specific formats.
128 &quot;a_key&quot;: &quot;A String&quot;, # A mapping from export format to URL
129 },
130 &quot;id&quot;: &quot;A String&quot;, # The ID of the revision.
131 &quot;keepForever&quot;: True or False, # Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.
132 # This field is only applicable to files with binary content in Drive.
133 &quot;kind&quot;: &quot;drive#revision&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#revision&quot;.
134 &quot;lastModifyingUser&quot;: { # Information about a Drive user. # The last user to modify this revision.
135 &quot;displayName&quot;: &quot;A String&quot;, # A plain text displayable name for this user.
136 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
137 &quot;kind&quot;: &quot;drive#user&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#user&quot;.
138 &quot;me&quot;: True or False, # Whether this user is the requesting user.
139 &quot;permissionId&quot;: &quot;A String&quot;, # The user&#x27;s ID as visible in Permission resources.
140 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
141 },
142 &quot;md5Checksum&quot;: &quot;A String&quot;, # The MD5 checksum of the revision&#x27;s content. This is only applicable to files with binary content in Drive.
143 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the revision.
144 &quot;modifiedTime&quot;: &quot;A String&quot;, # The last time the revision was modified (RFC 3339 date-time).
145 &quot;originalFilename&quot;: &quot;A String&quot;, # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
146 &quot;publishAuto&quot;: True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
147 &quot;published&quot;: True or False, # Whether this revision is published. This is only applicable to Docs Editors files.
148 &quot;publishedLink&quot;: &quot;A String&quot;, # A link to the published revision. This is only populated for Google Sites files.
149 &quot;publishedOutsideDomain&quot;: True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
150 &quot;size&quot;: &quot;A String&quot;, # The size of the revision&#x27;s content in bytes. This is only applicable to files with binary content in Drive.
151}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800152</div>
153
154<div class="method">
155 <code class="details" id="get_media">get_media(fileId, revisionId, acknowledgeAbuse=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 <pre>Gets a revision&#x27;s metadata or content by ID.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800157
158Args:
159 fileId: string, The ID of the file. (required)
160 revisionId: string, The ID of the revision. (required)
161 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
162
163Returns:
164 The media object as a string.
165
166 </pre>
167</div>
168
169<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700170 <code class="details" id="list">list(fileId, pageSize=None, pageToken=None)</code>
171 <pre>Lists a file&#x27;s revisions.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800172
173Args:
174 fileId: string, The ID of the file. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700175 pageSize: integer, The maximum number of revisions to return per page.
Bu Sun Kim65020912020-05-20 12:08:20 -0700176 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of &#x27;nextPageToken&#x27; from the previous response.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800177
178Returns:
179 An object of the form:
180
181 { # A list of revisions of a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800182 &quot;kind&quot;: &quot;drive#revisionList&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#revisionList&quot;.
183 &quot;nextPageToken&quot;: &quot;A String&quot;, # The page token for the next page of revisions. This will be absent if the end of the revisions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
184 &quot;revisions&quot;: [ # The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
185 { # The metadata for a revision to a file.
186 &quot;exportLinks&quot;: { # Links for exporting Docs Editors files to specific formats.
187 &quot;a_key&quot;: &quot;A String&quot;, # A mapping from export format to URL
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800188 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800189 &quot;id&quot;: &quot;A String&quot;, # The ID of the revision.
190 &quot;keepForever&quot;: True or False, # Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.
191 # This field is only applicable to files with binary content in Drive.
192 &quot;kind&quot;: &quot;drive#revision&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#revision&quot;.
193 &quot;lastModifyingUser&quot;: { # Information about a Drive user. # The last user to modify this revision.
194 &quot;displayName&quot;: &quot;A String&quot;, # A plain text displayable name for this user.
195 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
196 &quot;kind&quot;: &quot;drive#user&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#user&quot;.
197 &quot;me&quot;: True or False, # Whether this user is the requesting user.
198 &quot;permissionId&quot;: &quot;A String&quot;, # The user&#x27;s ID as visible in Permission resources.
199 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
200 },
201 &quot;md5Checksum&quot;: &quot;A String&quot;, # The MD5 checksum of the revision&#x27;s content. This is only applicable to files with binary content in Drive.
202 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the revision.
203 &quot;modifiedTime&quot;: &quot;A String&quot;, # The last time the revision was modified (RFC 3339 date-time).
204 &quot;originalFilename&quot;: &quot;A String&quot;, # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
205 &quot;publishAuto&quot;: True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
206 &quot;published&quot;: True or False, # Whether this revision is published. This is only applicable to Docs Editors files.
207 &quot;publishedLink&quot;: &quot;A String&quot;, # A link to the published revision. This is only populated for Google Sites files.
208 &quot;publishedOutsideDomain&quot;: True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
209 &quot;size&quot;: &quot;A String&quot;, # The size of the revision&#x27;s content in bytes. This is only applicable to files with binary content in Drive.
210 },
211 ],
212}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800213</div>
214
215<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700216 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
217 <pre>Retrieves the next page of results.
218
219Args:
220 previous_request: The request for the previous page. (required)
221 previous_response: The response from the request for the previous page. (required)
222
223Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700225 page. Returns None if there are no more items in the collection.
226 </pre>
227</div>
228
229<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700230 <code class="details" id="update">update(fileId, revisionId, body=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800231 <pre>Updates a revision with patch semantics.
232
233Args:
234 fileId: string, The ID of the file. (required)
235 revisionId: string, The ID of the revision. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700236 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800237 The object takes the form of:
238
239{ # The metadata for a revision to a file.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700240 &quot;exportLinks&quot;: { # Links for exporting Docs Editors files to specific formats.
Bu Sun Kim65020912020-05-20 12:08:20 -0700241 &quot;a_key&quot;: &quot;A String&quot;, # A mapping from export format to URL
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800242 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;id&quot;: &quot;A String&quot;, # The ID of the revision.
244 &quot;keepForever&quot;: True or False, # Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 # This field is only applicable to files with binary content in Drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700246 &quot;kind&quot;: &quot;drive#revision&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#revision&quot;.
247 &quot;lastModifyingUser&quot;: { # Information about a Drive user. # The last user to modify this revision.
248 &quot;displayName&quot;: &quot;A String&quot;, # A plain text displayable name for this user.
249 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
250 &quot;kind&quot;: &quot;drive#user&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#user&quot;.
251 &quot;me&quot;: True or False, # Whether this user is the requesting user.
252 &quot;permissionId&quot;: &quot;A String&quot;, # The user&#x27;s ID as visible in Permission resources.
253 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700254 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700255 &quot;md5Checksum&quot;: &quot;A String&quot;, # The MD5 checksum of the revision&#x27;s content. This is only applicable to files with binary content in Drive.
256 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the revision.
257 &quot;modifiedTime&quot;: &quot;A String&quot;, # The last time the revision was modified (RFC 3339 date-time).
258 &quot;originalFilename&quot;: &quot;A String&quot;, # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700259 &quot;publishAuto&quot;: True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
260 &quot;published&quot;: True or False, # Whether this revision is published. This is only applicable to Docs Editors files.
261 &quot;publishedLink&quot;: &quot;A String&quot;, # A link to the published revision. This is only populated for Google Sites files.
262 &quot;publishedOutsideDomain&quot;: True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;size&quot;: &quot;A String&quot;, # The size of the revision&#x27;s content in bytes. This is only applicable to files with binary content in Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800264}
265
266
267Returns:
268 An object of the form:
269
270 { # The metadata for a revision to a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800271 &quot;exportLinks&quot;: { # Links for exporting Docs Editors files to specific formats.
272 &quot;a_key&quot;: &quot;A String&quot;, # A mapping from export format to URL
273 },
274 &quot;id&quot;: &quot;A String&quot;, # The ID of the revision.
275 &quot;keepForever&quot;: True or False, # Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.
276 # This field is only applicable to files with binary content in Drive.
277 &quot;kind&quot;: &quot;drive#revision&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#revision&quot;.
278 &quot;lastModifyingUser&quot;: { # Information about a Drive user. # The last user to modify this revision.
279 &quot;displayName&quot;: &quot;A String&quot;, # A plain text displayable name for this user.
280 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
281 &quot;kind&quot;: &quot;drive#user&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#user&quot;.
282 &quot;me&quot;: True or False, # Whether this user is the requesting user.
283 &quot;permissionId&quot;: &quot;A String&quot;, # The user&#x27;s ID as visible in Permission resources.
284 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
285 },
286 &quot;md5Checksum&quot;: &quot;A String&quot;, # The MD5 checksum of the revision&#x27;s content. This is only applicable to files with binary content in Drive.
287 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the revision.
288 &quot;modifiedTime&quot;: &quot;A String&quot;, # The last time the revision was modified (RFC 3339 date-time).
289 &quot;originalFilename&quot;: &quot;A String&quot;, # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
290 &quot;publishAuto&quot;: True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
291 &quot;published&quot;: True or False, # Whether this revision is published. This is only applicable to Docs Editors files.
292 &quot;publishedLink&quot;: &quot;A String&quot;, # A link to the published revision. This is only populated for Google Sites files.
293 &quot;publishedOutsideDomain&quot;: True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
294 &quot;size&quot;: &quot;A String&quot;, # The size of the revision&#x27;s content in bytes. This is only applicable to files with binary content in Drive.
295}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800296</div>
297
298</body></html>