目录

Drive.Comments.Update

Class Info

public class Drive.Comments.Update extends DriveRequest<Comment>

Drive.Comments.Update class.

Protected Constructor Summary

Constructor Name

Drive.Comments.Update(String fileId, String commentId, Comment content)

Constructs a Drive.Comments.Update object.

Public Method Summary

Qualifier and Type

Method Name and Description

String

getCommentId()

Obtains a file comment ID.

String

getFileId()

Obtains a file ID.

Drive.Comments.Update

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Comments.Update

setForm(String form)

Sets the response data format.

Drive.Comments.Update

setCommentId(String commentId)

Sets a file comment ID.

Drive.Comments.Update

setFields(String fields)

Sets the fields to be contained in a response. Note: If fields is set to *, replies in drive#comments is not returned.

Drive.Comments.Update

setFileId(String fileId)

Sets a file ID.

Drive.Comments.Update

setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and newline characters.

Drive.Comments.Update

setQuotaId(String quotaId)

Sets a string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Comment

execute()

Sends an HTTP request and returns the object to be converted.

Protected Constructors

[h2]Drive.Comments.Update

Constructor

protected Drive.Comments.Update(String fileId, String commentId, Comment content)

Constructs a Drive.Comments.Update object.

Parameters

Name

Description

fileId

File ID, which is returned when a file list is obtained through the Files.list API.

commentId

File comment ID, which is returned when a file comment list is obtained through the Comments.list API.

content

A Comment object.

Public Methods

[h2]getCommentId

Method

public String getCommentId()

Obtains a file comment ID.

Returns

Type

Description

String

Comment ID.

[h2]getFileId

Method

public String getFileId()

Obtains a file ID.

Returns

Type

Description

String

File ID.

[h2]set

Method

public Drive.Comments.Update set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Parameters

Name

Description

parameterName

Parameter name.

value

Parameter value.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setForm

Method

public Drive.Comments.Update setForm(String form)

Sets the response data format.

Parameters

Name

Description

form

Response data format. The default data format is json, and only this format is supported currently.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setCommentId

Method

public Drive.Comments.Update setCommentId(String commentId)

Sets a file comment ID.

Parameters

Name

Description

commentId

Comment ID.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setFields

Method

public Drive.Comments.Update setFields(String fields)

Sets the fields to be contained in a response.

Parameters

Name

Description

fields

Fields to be contained in a response. An asterisk (*) can be used to match all related fields.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setFileId

Method

public Drive.Comments.Update setFileId(String fileId)

Sets a file ID.

Parameters

Name

Description

fileId

File ID.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setPrettyPrint

Method

public Drive.Comments.Update setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and newline characters.

Parameters

Name

Description

prettyPrint

Indicates whether to return a response containing indentations and newline characters. The value is a Boolean value.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]setQuotaId

Method

public Drive.Comments.Update setQuotaId(String quotaId)

Sets a string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Parameters

Name

Description

quotaId

A string of less than 40 characters to identify a user. The string is used by the server to restrict the user's API calls.

Returns

Type

Description

Drive.Comments.Update

A Drive.Comments.Update object.

[h2]execute

Method

public T execute() throws IOException

Sends an HTTP request and returns the object to be converted.

Throws

Name

Description

java.io.IOException

I/O exception thrown upon an API call failure. You can use the getMessage method to obtain the error description.

Returns

Type

Description

Comment

The Drive.Comments.Update class inherits DriveRequest<Comment>. Therefore, the return result of the execute() method is encapsulated as a Comment object.

Sample Code

private void updateComments(Drive drive, File file, Comment comment){
    try{
        Comment newComment = new Comment();
        newComment.setDescription("update interface test");
        comment = drive.comments().update(file.getId(), comment.getId(), newComment).execute();
    } catch (Exception e){
        Log.e(TAG, "updateComments error: " + e.getMessage());
    }
}