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_v3.html">Drive API</a> . <a href="drive_v3.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 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> 83<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"> 90 <code><a href="#list">list(fileId, pageSize=None, pageToken=None)</a></code></p> 91<p class="firstline">Lists a file's revisions.</p> 92<p class="toc_element"> 93 <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"> 96 <code><a href="#update">update(fileId, revisionId, body=None)</a></code></p> 97<p class="firstline">Updates a revision with patch semantics.</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 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. 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, acknowledgeAbuse=None)</code> 116 <pre>Gets a revision's metadata or content by ID. 117 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. 127 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 128 "a_key": "A String", # A mapping from export format to URL 129 }, 130 "id": "A String", # The ID of the revision. 131 "keepForever": 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 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "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. This may not be present in certain contexts if the user has not made their email address visible to the requester. 137 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 138 "me": True or False, # Whether this user is the requesting user. 139 "permissionId": "A String", # The user's ID as visible in Permission resources. 140 "photoLink": "A String", # A link to the user's profile photo, if available. 141 }, 142 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 143 "mimeType": "A String", # The MIME type of the revision. 144 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 145 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 146 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. 147 "published": True or False, # Whether this revision is published. This is only applicable to Docs Editors files. 148 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 149 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files. 150 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 151}</pre> 152</div> 153 154<div class="method"> 155 <code class="details" id="get_media">get_media(fileId, revisionId, acknowledgeAbuse=None)</code> 156 <pre>Gets a revision's metadata or content by ID. 157 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"> 170 <code class="details" id="list">list(fileId, pageSize=None, pageToken=None)</code> 171 <pre>Lists a file's revisions. 172 173Args: 174 fileId: string, The ID of the file. (required) 175 pageSize: integer, The maximum number of revisions to return per page. 176 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. 177 178Returns: 179 An object of the form: 180 181 { # A list of revisions of a file. 182 "kind": "drive#revisionList", # Identifies what kind of resource this is. Value: the fixed string "drive#revisionList". 183 "nextPageToken": "A String", # 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 "revisions": [ # 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 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 187 "a_key": "A String", # A mapping from export format to URL 188 }, 189 "id": "A String", # The ID of the revision. 190 "keepForever": 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 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 193 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 194 "displayName": "A String", # A plain text displayable name for this user. 195 "emailAddress": "A String", # 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 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 197 "me": True or False, # Whether this user is the requesting user. 198 "permissionId": "A String", # The user's ID as visible in Permission resources. 199 "photoLink": "A String", # A link to the user's profile photo, if available. 200 }, 201 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 202 "mimeType": "A String", # The MIME type of the revision. 203 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 204 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 205 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. 206 "published": True or False, # Whether this revision is published. This is only applicable to Docs Editors files. 207 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 208 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files. 209 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 210 }, 211 ], 212}</pre> 213</div> 214 215<div class="method"> 216 <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: 224 A request object that you can call 'execute()' on to request the next 225 page. Returns None if there are no more items in the collection. 226 </pre> 227</div> 228 229<div class="method"> 230 <code class="details" id="update">update(fileId, revisionId, body=None)</code> 231 <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) 236 body: object, The request body. 237 The object takes the form of: 238 239{ # The metadata for a revision to a file. 240 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 241 "a_key": "A String", # A mapping from export format to URL 242 }, 243 "id": "A String", # The ID of the revision. 244 "keepForever": 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. 245 # This field is only applicable to files with binary content in Drive. 246 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 247 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 248 "displayName": "A String", # A plain text displayable name for this user. 249 "emailAddress": "A String", # 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 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 251 "me": True or False, # Whether this user is the requesting user. 252 "permissionId": "A String", # The user's ID as visible in Permission resources. 253 "photoLink": "A String", # A link to the user's profile photo, if available. 254 }, 255 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 256 "mimeType": "A String", # The MIME type of the revision. 257 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 258 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 259 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. 260 "published": True or False, # Whether this revision is published. This is only applicable to Docs Editors files. 261 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 262 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files. 263 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 264} 265 266 267Returns: 268 An object of the form: 269 270 { # The metadata for a revision to a file. 271 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 272 "a_key": "A String", # A mapping from export format to URL 273 }, 274 "id": "A String", # The ID of the revision. 275 "keepForever": 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 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 278 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 279 "displayName": "A String", # A plain text displayable name for this user. 280 "emailAddress": "A String", # 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 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 282 "me": True or False, # Whether this user is the requesting user. 283 "permissionId": "A String", # The user's ID as visible in Permission resources. 284 "photoLink": "A String", # A link to the user's profile photo, if available. 285 }, 286 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 287 "mimeType": "A String", # The MIME type of the revision. 288 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 289 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 290 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. 291 "published": True or False, # Whether this revision is published. This is only applicable to Docs Editors files. 292 "publishedLink": "A String", # A link to the published revision. This is only populated for Google Sites files. 293 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Docs Editors files. 294 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 295}</pre> 296</div> 297 298</body></html>