approve(fileId, approvalId, body=None, x__xgafv=None)
Approves an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This is used to update the ReviewerResponse of the requesting user with a Response of `APPROVED`. If this is the last required reviewer response, this also completes the approval and sets the approval Status to `APPROVED`.
cancel(fileId, approvalId, body=None, x__xgafv=None)
Cancels an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). Updates the approval Status to `CANCELLED`. This can be called by any user with the `writer` permission on the file while the approval Status is `IN_PROGRESS`.
Close httplib2 connections.
comment(fileId, approvalId, body=None, x__xgafv=None)
Comments on an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This sends a notification to both the initiator and the reviewers. Additionally, a message is also added to the approval activity log.
decline(fileId, approvalId, body=None, x__xgafv=None)
Declines an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This is used to update the ReviewerResponse of the requesting user with a Response of `DECLINED`. This also completes the approval and sets the approval Status to `DECLINED`.
get(fileId, approvalId, x__xgafv=None)
Gets an approval by ID. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
list(fileId, pageSize=None, pageToken=None, x__xgafv=None)
Lists the approvals on a file. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
Retrieves the next page of results.
reassign(fileId, approvalId, body=None, x__xgafv=None)
Reassigns the reviewers on an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). Adds or replaces reviewers in the ReviewerResponse of the approval. This can be called by any user with the `writer` permission on the file while the approval Status is `IN_PROGRESS` and the Response for the reviewer being reassigned is `NO_RESPONSE`. A user with the `reader` permission can only reassign an approval that's assigned to themselves. Removing a reviewer isn't allowed.
start(fileId, body=None, x__xgafv=None)
Starts an approval on a file. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
approve(fileId, approvalId, body=None, x__xgafv=None)
Approves an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This is used to update the ReviewerResponse of the requesting user with a Response of `APPROVED`. If this is the last required reviewer response, this also completes the approval and sets the approval Status to `APPROVED`.
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval to approve. (required)
body: object, The request body.
The object takes the form of:
{ # Request for approving an approval as a reviewer.
"message": "A String", # Optional. A message to accompany the reviewer response on the approval. This message is included in notifications for the action and in the approval activity log.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
cancel(fileId, approvalId, body=None, x__xgafv=None)
Cancels an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). Updates the approval Status to `CANCELLED`. This can be called by any user with the `writer` permission on the file while the approval Status is `IN_PROGRESS`.
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval to cancel. (required)
body: object, The request body.
The object takes the form of:
{ # Request for cancelling an approval as an initiator.
"message": "A String", # Optional. A message to accompany the cancellation of the approval. This message is included in notifications for the action and in the approval activity log.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
close()
Close httplib2 connections.
comment(fileId, approvalId, body=None, x__xgafv=None)
Comments on an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This sends a notification to both the initiator and the reviewers. Additionally, a message is also added to the approval activity log.
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval to comment on. (required)
body: object, The request body.
The object takes the form of:
{ # Request for commenting on an approval.
"message": "A String", # Required. A message to comment on the approval. This message is included in notifications for the action and in the approval activity log.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
decline(fileId, approvalId, body=None, x__xgafv=None)
Declines an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). This is used to update the ReviewerResponse of the requesting user with a Response of `DECLINED`. This also completes the approval and sets the approval Status to `DECLINED`.
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval to decline. (required)
body: object, The request body.
The object takes the form of:
{ # Request for declining an approval as a reviewer.
"message": "A String", # Optional. A message to accompany the reviewer response on the approval. This message is included in notifications for the action and in the approval activity log.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
get(fileId, approvalId, x__xgafv=None)
Gets an approval by ID. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
list(fileId, pageSize=None, pageToken=None, x__xgafv=None)
Lists the approvals on a file. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
pageSize: integer, The maximum number of approvals to return. When not set, at most 100 approvals are returned.
pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The response of an approvals list request.
"items": [ # The list of approvals. If `nextPageToken` is populated, then this list may be incomplete and an additional page of results should be fetched.
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
},
],
"kind": "A String", # This is always drive#approvalList
"nextPageToken": "A String", # The page token for the next page of approvals. This is absent if the end of the approvals 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.
}
list_next()
Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.
reassign(fileId, approvalId, body=None, x__xgafv=None)
Reassigns the reviewers on an approval. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals). Adds or replaces reviewers in the ReviewerResponse of the approval. This can be called by any user with the `writer` permission on the file while the approval Status is `IN_PROGRESS` and the Response for the reviewer being reassigned is `NO_RESPONSE`. A user with the `reader` permission can only reassign an approval that's assigned to themselves. Removing a reviewer isn't allowed.
Args:
fileId: string, Required. The ID of the file that the approval is on. (required)
approvalId: string, Required. The ID of the approval to reassign. (required)
body: object, The request body.
The object takes the form of:
{ # Request for reassigning an approval. Reviewers can be added or replaced, but not removed.
"addReviewers": [ # Optional. The list of reviewers to add.
{ # Representation of a reviewer addition.
"addedReviewerEmail": "A String", # Required. The email of the reviewer to add.
},
],
"message": "A String", # Optional. A message to send to the new reviewers. This message is included in notifications for the action and in the approval activity log.
"replaceReviewers": [ # Optional. The list of reviewer replacements.
{ # Representation of a reviewer replacement.
"addedReviewerEmail": "A String", # Required. The email of the reviewer to add.
"removedReviewerEmail": "A String", # Required. The email of the reviewer to remove.
},
],
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}
start(fileId, body=None, x__xgafv=None)
Starts an approval on a file. For more information, see [Manage approvals](https://developers.google.com/workspace/drive/api/guides/approvals).
Args:
fileId: string, Required. The ID of the file that the approval is created on. (required)
body: object, The request body.
The object takes the form of:
{ # Allows creating an approval on a file.
"dueTime": "A String", # Optional. The time that the approval is due.
"lockFile": True or False, # Optional. Whether to lock the file when starting the approval.
"message": "A String", # Optional. A message to send to reviewers when notifying them of the approval request.
"reviewerEmails": [ # Required. The emails of the users who are set to review the approval.
"A String",
],
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Metadata for an approval. An approval is a review or approve process for a Drive item.
"approvalId": "A String", # The approval ID.
"completeTime": "A String", # Output only. The time the approval was completed.
"createTime": "A String", # Output only. The time the approval was created.
"dueTime": "A String", # The time that the approval is due.
"initiator": { # Information about a Drive user. # The user that requested the approval.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
"kind": "A String", # This is always drive#approval.
"modifyTime": "A String", # Output only. The most recent time the approval was modified.
"reviewerResponses": [ # The responses made on the approval by reviewers.
{ # A response on an approval made by a specific reviewer.
"kind": "A String", # This is always drive#reviewerResponse.
"response": "A String", # A reviewer’s response for the approval.
"reviewer": { # Information about a Drive user. # The user that's responsible for this response.
"displayName": "A String", # Output only. A plain text displayable name for this user.
"emailAddress": "A String", # Output only. 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.
"kind": "drive#user", # Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.
"me": True or False, # Output only. Whether this user is the requesting user.
"permissionId": "A String", # Output only. The user's ID as visible in Permission resources.
"photoLink": "A String", # Output only. A link to the user's profile photo, if available.
},
},
],
"status": "A String", # Output only. The status of the approval at the time this resource was requested.
"targetFileId": "A String", # Target file id of the approval.
}