目录

Drive.Replies.Create

Class Info

public class Drive.Replies.Create extends DriveRequest<Reply>

Drive.Replies.Create class.

Protected Constructor Summary

Constructor Name

Drive.Replies.Create(String fileId, String commentId, Reply content)

Constructs a Drive.Replies.Create object.

Public Method Summary

Qualifier and Type

Method Name and Description

Reply

execute()

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

String

getCommentId()

Obtains the ID of a comment replied.

String

getFileId()

Obtains the ID of a file whose comment is replied.

Drive.Replies.Create

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Drive.Replies.Create

setCommentId(String commentId)

Sets the ID of a comment replied.

Drive.Replies.Create

setFileId(String fileId)

Sets the ID of a file whose comment is replied.

Drive.Replies.Create

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Replies.Create

setForm(String form)

Sets the response data format.

Drive.Replies.Create

setPrettyPrint(Boolean prettyPrint)

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

Drive.Replies.Create

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.

Protected Constructors

[h2]Drive.Replies.Create

Constructor

protected Drive.Replies.Create(String fileId, String commentId, Reply content)

Constructs a Drive.Replies.Create object.

Parameters

Name

Description

fileId

File ID.

commentId

Comment ID.

content

Reply to a comment.

Public Methods

[h2]getCommentId

Method

public String getCommentId()

Obtains the ID of a comment replied.

Returns

Type

Description

String

Comment ID.

[h2]getFileId

Method

public String getFileId()

Obtains the ID of a file whose comment is replied.

Returns

Type

Description

String

ID of a file whose comment is replied.

[h2]set

Method

public Drive.Replies.Create 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.Replies.Create

A Drive.Replies.Create object.

[h2]setCommentId

Method

public Drive.Replies.Create setCommentId(String commentId)

Sets the ID of a comment replied.

Parameters

Name

Description

commentId

Comment ID.

Returns

Type

Description

Drive.Replies.Create

A Drive.Replies.Create object.

[h2]setFields

Method

public Drive.Replies.Create 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.Replies.Create

A Drive.Replies.Create object.

[h2]setFileId

Method

public Drive.Replies.Create setFileId(String fileId)

Sets the ID of a file whose comment is replied.

Parameters

Name

Description

fileId

ID of a file whose comment is replied.

Returns

Type

Description

Drive.Replies.Create

A Drive.Replies.Create object.

[h2]setForm

Method

public Drive.Replies.Create setForm(String form)

Sets the response data format.

Parameters

Name

Description

form

Response data format.

Returns

Type

Description

Drive.Replies.Create

A Drive.Replies.Create object.

[h2]setPrettyPrint

Method

public Drive.Replies.Create setPrettyPrint(Boolean prettyPrint)

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

Parameters

Name

Description

prettyPrint

Response containing indentations and newline characters.

Returns

Type

Description

Drive.Replies.Create

A Drive.Replies.Create object.

[h2]setQuotaId

Method

public Drive.Replies.Create 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.Replies.Create

A Drive.Replies.Create 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

Reply

The Drive.Replies.Create class inherits DriveRequest< Reply>. Therefore, the return result of the execute() method is encapsulated as a Reply object.

Sample Code

private void createReplies(Drive drive, File mFile, Comment mComment) {
    try {
        Reply reply = new Reply();
        reply.setDescription("interface test reply");
        reply.setOperate("resolve");        
        drive.replies().create(mFile.getId(), mComment.getId(), reply).setFields("*").execute();
    } catch (Exception e) {
        Log.e(TAG, "createReplies error: " + e.getMessage());
    }
}