# Drive API . revisions

## Instance Methods

Permanently deletes a revision. This method is only applicable to files with binary content in Drive.

Gets a revision's metadata or content by ID.

Gets a revision's metadata or content by ID.

Lists a file's revisions.

Updates a revision with patch semantics.

### Method Details

`delete(fileId, revisionId)`

    Permanently deletes a revision. This method is only applicable to files with binary content in Drive.

    Args:
      fileId: string, The ID of the file. (required)
      revisionId: string, The ID of the revision. (required)

`get(fileId, revisionId, acknowledgeAbuse=None)`

    Gets a revision's metadata or content by ID.

    Args:
      fileId: string, The ID of the file. (required)
      revisionId: string, The ID of the revision. (required)
      acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

    Returns:
      An object of the form:

        { # The metadata for a revision to a file.
        "mimeType": "A String", # The MIME type of the revision.
        "kind": "drive#revision", # This is always drive#revision.
        "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time).
        "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision.
          "me": True or False, # Whether this user is the requesting user.
          "kind": "drive#user", # This is always drive#user.
          "displayName": "A String", # A plain text displayable name for this user.
          "permissionId": "A String", # The user's ID as visible in Permission resources.
          "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.
          "photoLink": "A String", # A link to the user's profile photo, if available.
        },
        "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.
            # This field is only applicable to files with binary content in Drive.
        "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs.
        "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
        "published": True or False, # Whether this revision is published. This is only applicable to Google Docs.
        "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
        "id": "A String", # The ID of the revision.
        "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
        "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs.
      }

`get_media(fileId, revisionId, acknowledgeAbuse=None)`

    Gets a revision's metadata or content by ID.

    Args:
      fileId: string, The ID of the file. (required)
      revisionId: string, The ID of the revision. (required)
      acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

    Returns:
      The media object as a string.

`list(fileId)`

    Lists a file's revisions.

    Args:
      fileId: string, The ID of the file. (required)

    Returns:
      An object of the form:

        { # A list of revisions of a file.
        "kind": "drive#revisionList", # This is always drive#revisionList.
        "revisions": [ # The full list of revisions.
          { # The metadata for a revision to a file.
            "mimeType": "A String", # The MIME type of the revision.
            "kind": "drive#revision", # This is always drive#revision.
            "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time).
            "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision.
              "me": True or False, # Whether this user is the requesting user.
              "kind": "drive#user", # This is always drive#user.
              "displayName": "A String", # A plain text displayable name for this user.
              "permissionId": "A String", # The user's ID as visible in Permission resources.
              "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.
              "photoLink": "A String", # A link to the user's profile photo, if available.
            },
            "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.
                # This field is only applicable to files with binary content in Drive.
            "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs.
            "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
            "published": True or False, # Whether this revision is published. This is only applicable to Google Docs.
            "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
            "id": "A String", # The ID of the revision.
            "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
            "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs.
          },
        ],
      }

`update(fileId, revisionId, body)`

    Updates a revision with patch semantics.

    Args:
      fileId: string, The ID of the file. (required)
      revisionId: string, The ID of the revision. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # The metadata for a revision to a file.
      "mimeType": "A String", # The MIME type of the revision.
      "kind": "drive#revision", # This is always drive#revision.
      "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time).
      "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision.
        "me": True or False, # Whether this user is the requesting user.
        "kind": "drive#user", # This is always drive#user.
        "displayName": "A String", # A plain text displayable name for this user.
        "permissionId": "A String", # The user's ID as visible in Permission resources.
        "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.
        "photoLink": "A String", # A link to the user's profile photo, if available.
      },
      "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.
          # This field is only applicable to files with binary content in Drive.
      "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs.
      "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
      "published": True or False, # Whether this revision is published. This is only applicable to Google Docs.
      "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
      "id": "A String", # The ID of the revision.
      "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
      "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs.
    }

    Returns:
      An object of the form:

        { # The metadata for a revision to a file.
        "mimeType": "A String", # The MIME type of the revision.
        "kind": "drive#revision", # This is always drive#revision.
        "modifiedTime": "A String", # The last time the revision was modified (RFC 3339 date-time).
        "lastModifyingUser": { # Information about a Drive user. # The last user to modify this revision.
          "me": True or False, # Whether this user is the requesting user.
          "kind": "drive#user", # This is always drive#user.
          "displayName": "A String", # A plain text displayable name for this user.
          "permissionId": "A String", # The user's ID as visible in Permission resources.
          "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.
          "photoLink": "A String", # A link to the user's profile photo, if available.
        },
        "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.
            # This field is only applicable to files with binary content in Drive.
        "publishAuto": True or False, # Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs.
        "originalFilename": "A String", # The original filename used to create this revision. This is only applicable to files with binary content in Drive.
        "published": True or False, # Whether this revision is published. This is only applicable to Google Docs.
        "size": "A String", # The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
        "id": "A String", # The ID of the revision.
        "md5Checksum": "A String", # The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
        "publishedOutsideDomain": True or False, # Whether this revision is published outside the domain. This is only applicable to Google Docs.
      }