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="drive_v2.html">Drive API</a> . <a href="drive_v2.revisions.html">revisions</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="#delete">delete(fileId, revisionId)</a></code></p> 82<p class="firstline">Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(fileId, revisionId)</a></code></p> 85<p class="firstline">Gets a specific revision.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(fileId, maxResults=None, pageToken=None)</a></code></p> 88<p class="firstline">Lists a file's revisions.</p> 89<p class="toc_element"> 90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 91<p class="firstline">Retrieves the next page of results.</p> 92<p class="toc_element"> 93 <code><a href="#patch">patch(fileId, revisionId, body=None)</a></code></p> 94<p class="firstline">Updates a revision.</p> 95<p class="toc_element"> 96 <code><a href="#update">update(fileId, revisionId, body=None)</a></code></p> 97<p class="firstline">Updates a revision.</p> 98<h3>Method Details</h3> 99<div class="method"> 100 <code class="details" id="close">close()</code> 101 <pre>Close httplib2 connections.</pre> 102</div> 103 104<div class="method"> 105 <code class="details" id="delete">delete(fileId, revisionId)</code> 106 <pre>Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. 107 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)</code> 116 <pre>Gets a specific revision. 117 118Args: 119 fileId: string, The ID of the file. (required) 120 revisionId: string, The ID of the revision. (required) 121 122Returns: 123 An object of the form: 124 125 { # A revision of a file. 126 "downloadUrl": "A String", 127 "etag": "A String", # The ETag of the revision. 128 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 129 "a_key": "A String", # A mapping from export format to URL 130 }, 131 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 132 "id": "A String", # The ID of the revision. 133 "kind": "drive#revision", # This is always drive#revision. 134 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 135 "displayName": "A String", # A plain text displayable name for this user. 136 "emailAddress": "A String", # The email address of the user. 137 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 138 "kind": "drive#user", # This is always drive#user. 139 "permissionId": "A String", # The user's ID as visible in the permissions collection. 140 "picture": { # The user's profile picture. 141 "url": "A String", # A URL that points to a profile picture of this user. 142 }, 143 }, 144 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 145 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 146 "mimeType": "A String", # The MIME type of the revision. 147 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 148 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 149 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 150 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 151 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 152 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 153 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 154 "selfLink": "A String", # A link back to this revision. 155}</pre> 156</div> 157 158<div class="method"> 159 <code class="details" id="list">list(fileId, maxResults=None, pageToken=None)</code> 160 <pre>Lists a file's revisions. 161 162Args: 163 fileId: string, The ID of the file. (required) 164 maxResults: integer, Maximum number of revisions to return. 165 pageToken: string, Page token for revisions. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. 166 167Returns: 168 An object of the form: 169 170 { # A list of revisions of a file. 171 "etag": "A String", # The ETag of the list. 172 "items": [ # The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. 173 { # A revision of a file. 174 "downloadUrl": "A String", 175 "etag": "A String", # The ETag of the revision. 176 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 177 "a_key": "A String", # A mapping from export format to URL 178 }, 179 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 180 "id": "A String", # The ID of the revision. 181 "kind": "drive#revision", # This is always drive#revision. 182 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 183 "displayName": "A String", # A plain text displayable name for this user. 184 "emailAddress": "A String", # The email address of the user. 185 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 186 "kind": "drive#user", # This is always drive#user. 187 "permissionId": "A String", # The user's ID as visible in the permissions collection. 188 "picture": { # The user's profile picture. 189 "url": "A String", # A URL that points to a profile picture of this user. 190 }, 191 }, 192 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 193 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 194 "mimeType": "A String", # The MIME type of the revision. 195 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 196 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 197 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 198 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 199 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 200 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 201 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 202 "selfLink": "A String", # A link back to this revision. 203 }, 204 ], 205 "kind": "drive#revisionList", # This is always drive#revisionList. 206 "nextPageToken": "A String", # The page token for the next page of revisions. This field 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. 207 "selfLink": "A String", # A link back to this list. 208}</pre> 209</div> 210 211<div class="method"> 212 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 213 <pre>Retrieves the next page of results. 214 215Args: 216 previous_request: The request for the previous page. (required) 217 previous_response: The response from the request for the previous page. (required) 218 219Returns: 220 A request object that you can call 'execute()' on to request the next 221 page. Returns None if there are no more items in the collection. 222 </pre> 223</div> 224 225<div class="method"> 226 <code class="details" id="patch">patch(fileId, revisionId, body=None)</code> 227 <pre>Updates a revision. 228 229Args: 230 fileId: string, The ID for the file. (required) 231 revisionId: string, The ID for the revision. (required) 232 body: object, The request body. 233 The object takes the form of: 234 235{ # A revision of a file. 236 "downloadUrl": "A String", 237 "etag": "A String", # The ETag of the revision. 238 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 239 "a_key": "A String", # A mapping from export format to URL 240 }, 241 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 242 "id": "A String", # The ID of the revision. 243 "kind": "drive#revision", # This is always drive#revision. 244 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 245 "displayName": "A String", # A plain text displayable name for this user. 246 "emailAddress": "A String", # The email address of the user. 247 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 248 "kind": "drive#user", # This is always drive#user. 249 "permissionId": "A String", # The user's ID as visible in the permissions collection. 250 "picture": { # The user's profile picture. 251 "url": "A String", # A URL that points to a profile picture of this user. 252 }, 253 }, 254 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 255 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 256 "mimeType": "A String", # The MIME type of the revision. 257 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 258 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 259 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 260 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 261 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 262 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 263 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 264 "selfLink": "A String", # A link back to this revision. 265} 266 267 268Returns: 269 An object of the form: 270 271 { # A revision of a file. 272 "downloadUrl": "A String", 273 "etag": "A String", # The ETag of the revision. 274 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 275 "a_key": "A String", # A mapping from export format to URL 276 }, 277 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 278 "id": "A String", # The ID of the revision. 279 "kind": "drive#revision", # This is always drive#revision. 280 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 281 "displayName": "A String", # A plain text displayable name for this user. 282 "emailAddress": "A String", # The email address of the user. 283 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 284 "kind": "drive#user", # This is always drive#user. 285 "permissionId": "A String", # The user's ID as visible in the permissions collection. 286 "picture": { # The user's profile picture. 287 "url": "A String", # A URL that points to a profile picture of this user. 288 }, 289 }, 290 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 291 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 292 "mimeType": "A String", # The MIME type of the revision. 293 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 294 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 295 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 296 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 297 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 298 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 299 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 300 "selfLink": "A String", # A link back to this revision. 301}</pre> 302</div> 303 304<div class="method"> 305 <code class="details" id="update">update(fileId, revisionId, body=None)</code> 306 <pre>Updates a revision. 307 308Args: 309 fileId: string, The ID for the file. (required) 310 revisionId: string, The ID for the revision. (required) 311 body: object, The request body. 312 The object takes the form of: 313 314{ # A revision of a file. 315 "downloadUrl": "A String", 316 "etag": "A String", # The ETag of the revision. 317 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 318 "a_key": "A String", # A mapping from export format to URL 319 }, 320 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 321 "id": "A String", # The ID of the revision. 322 "kind": "drive#revision", # This is always drive#revision. 323 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 324 "displayName": "A String", # A plain text displayable name for this user. 325 "emailAddress": "A String", # The email address of the user. 326 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 327 "kind": "drive#user", # This is always drive#user. 328 "permissionId": "A String", # The user's ID as visible in the permissions collection. 329 "picture": { # The user's profile picture. 330 "url": "A String", # A URL that points to a profile picture of this user. 331 }, 332 }, 333 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 334 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 335 "mimeType": "A String", # The MIME type of the revision. 336 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 337 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 338 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 339 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 340 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 341 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 342 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 343 "selfLink": "A String", # A link back to this revision. 344} 345 346 347Returns: 348 An object of the form: 349 350 { # A revision of a file. 351 "downloadUrl": "A String", 352 "etag": "A String", # The ETag of the revision. 353 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 354 "a_key": "A String", # A mapping from export format to URL 355 }, 356 "fileSize": "A String", # The size of the revision in bytes. This will only be populated on files with content stored in Drive. 357 "id": "A String", # The ID of the revision. 358 "kind": "drive#revision", # This is always drive#revision. 359 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 360 "displayName": "A String", # A plain text displayable name for this user. 361 "emailAddress": "A String", # The email address of the user. 362 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 363 "kind": "drive#user", # This is always drive#user. 364 "permissionId": "A String", # The user's ID as visible in the permissions collection. 365 "picture": { # The user's profile picture. 366 "url": "A String", # A URL that points to a profile picture of this user. 367 }, 368 }, 369 "lastModifyingUserName": "A String", # Name of the last user to modify this revision. 370 "md5Checksum": "A String", # An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. 371 "mimeType": "A String", # The MIME type of the revision. 372 "modifiedDate": "A String", # Last time this revision was modified (formatted RFC 3339 timestamp). 373 "originalFilename": "A String", # The original filename when this revision was created. This will only be populated on files with content stored in Drive. 374 "pinned": True or False, # Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. 375 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. 376 "published": True or False, # Whether this revision is published. This is only populated and can only be modified for Docs Editors files. 377 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 378 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. 379 "selfLink": "A String", # A link back to this revision. 380}</pre> 381</div> 382 383</body></html>