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="#delete">delete(fileId, revisionId)</a></code></p> 79<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> 80<p class="toc_element"> 81 <code><a href="#get">get(fileId, revisionId, acknowledgeAbuse=None)</a></code></p> 82<p class="firstline">Gets a revision's metadata or content by ID.</p> 83<p class="toc_element"> 84 <code><a href="#get_media">get_media(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="#list">list(fileId, pageToken=None, pageSize=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="#update">update(fileId, revisionId, body)</a></code></p> 94<p class="firstline">Updates a revision with patch semantics.</p> 95<h3>Method Details</h3> 96<div class="method"> 97 <code class="details" id="delete">delete(fileId, revisionId)</code> 98 <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. 99 100Args: 101 fileId: string, The ID of the file. (required) 102 revisionId: string, The ID of the revision. (required) 103</pre> 104</div> 105 106<div class="method"> 107 <code class="details" id="get">get(fileId, revisionId, acknowledgeAbuse=None)</code> 108 <pre>Gets a revision's metadata or content by ID. 109 110Args: 111 fileId: string, The ID of the file. (required) 112 revisionId: string, The ID of the revision. (required) 113 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 114 115Returns: 116 An object of the form: 117 118 { # The metadata for a revision to a file. 119 "mimeType": "A String", # The MIME type of the revision. 120 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 121 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 122 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 123 "me": True or False, # Whether this user is the requesting user. 124 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 125 "displayName": "A String", # A plain text displayable name for this user. 126 "permissionId": "A String", # The user's ID as visible in Permission resources. 127 "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. 128 "photoLink": "A String", # A link to the user's profile photo, if available. 129 }, 130 "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. 131 # This field is only applicable to files with binary content in Drive. 132 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. 133 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 134 "exportLinks": { # Links for exporting Google Docs to specific formats. 135 "a_key": "A String", # A mapping from export format to URL 136 }, 137 "published": True or False, # Whether this revision is published. This is only applicable to Google Docs. 138 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 139 "id": "A String", # The ID of the revision. 140 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 141 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs. 142 }</pre> 143</div> 144 145<div class="method"> 146 <code class="details" id="get_media">get_media(fileId, revisionId, acknowledgeAbuse=None)</code> 147 <pre>Gets a revision's metadata or content by ID. 148 149Args: 150 fileId: string, The ID of the file. (required) 151 revisionId: string, The ID of the revision. (required) 152 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 153 154Returns: 155 The media object as a string. 156 157 </pre> 158</div> 159 160<div class="method"> 161 <code class="details" id="list">list(fileId, pageToken=None, pageSize=None)</code> 162 <pre>Lists a file's revisions. 163 164Args: 165 fileId: string, The ID of the file. (required) 166 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. 167 pageSize: integer, The maximum number of revisions to return per page. 168 169Returns: 170 An object of the form: 171 172 { # A list of revisions of a file. 173 "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. 174 "kind": "drive#revisionList", # Identifies what kind of resource this is. Value: the fixed string "drive#revisionList". 175 "revisions": [ # The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. 176 { # The metadata for a revision to a file. 177 "mimeType": "A String", # The MIME type of the revision. 178 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 179 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 180 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 181 "me": True or False, # Whether this user is the requesting user. 182 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 183 "displayName": "A String", # A plain text displayable name for this user. 184 "permissionId": "A String", # The user's ID as visible in Permission resources. 185 "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. 186 "photoLink": "A String", # A link to the user's profile photo, if available. 187 }, 188 "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. 189 # This field is only applicable to files with binary content in Drive. 190 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. 191 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 192 "exportLinks": { # Links for exporting Google Docs to specific formats. 193 "a_key": "A String", # A mapping from export format to URL 194 }, 195 "published": True or False, # Whether this revision is published. This is only applicable to Google Docs. 196 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 197 "id": "A String", # The ID of the revision. 198 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 199 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs. 200 }, 201 ], 202 }</pre> 203</div> 204 205<div class="method"> 206 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 207 <pre>Retrieves the next page of results. 208 209Args: 210 previous_request: The request for the previous page. (required) 211 previous_response: The response from the request for the previous page. (required) 212 213Returns: 214 A request object that you can call 'execute()' on to request the next 215 page. Returns None if there are no more items in the collection. 216 </pre> 217</div> 218 219<div class="method"> 220 <code class="details" id="update">update(fileId, revisionId, body)</code> 221 <pre>Updates a revision with patch semantics. 222 223Args: 224 fileId: string, The ID of the file. (required) 225 revisionId: string, The ID of the revision. (required) 226 body: object, The request body. (required) 227 The object takes the form of: 228 229{ # The metadata for a revision to a file. 230 "mimeType": "A String", # The MIME type of the revision. 231 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 232 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 233 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 234 "me": True or False, # Whether this user is the requesting user. 235 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 236 "displayName": "A String", # A plain text displayable name for this user. 237 "permissionId": "A String", # The user's ID as visible in Permission resources. 238 "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. 239 "photoLink": "A String", # A link to the user's profile photo, if available. 240 }, 241 "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. 242 # This field is only applicable to files with binary content in Drive. 243 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. 244 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 245 "exportLinks": { # Links for exporting Google Docs to specific formats. 246 "a_key": "A String", # A mapping from export format to URL 247 }, 248 "published": True or False, # Whether this revision is published. This is only applicable to Google Docs. 249 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 250 "id": "A String", # The ID of the revision. 251 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 252 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs. 253} 254 255 256Returns: 257 An object of the form: 258 259 { # The metadata for a revision to a file. 260 "mimeType": "A String", # The MIME type of the revision. 261 "kind": "drive#revision", # Identifies what kind of resource this is. Value: the fixed string "drive#revision". 262 "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time). 263 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision. 264 "me": True or False, # Whether this user is the requesting user. 265 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 266 "displayName": "A String", # A plain text displayable name for this user. 267 "permissionId": "A String", # The user's ID as visible in Permission resources. 268 "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. 269 "photoLink": "A String", # A link to the user's profile photo, if available. 270 }, 271 "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. 272 # This field is only applicable to files with binary content in Drive. 273 "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. 274 "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive. 275 "exportLinks": { # Links for exporting Google Docs to specific formats. 276 "a_key": "A String", # A mapping from export format to URL 277 }, 278 "published": True or False, # Whether this revision is published. This is only applicable to Google Docs. 279 "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. 280 "id": "A String", # The ID of the revision. 281 "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. 282 "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs. 283 }</pre> 284</div> 285 286</body></html>