| class info |
| public class Drive.Replies.Create extends DriveRequest<Reply> |
| Drive. Replies.Create class. |
| Constructor name |
Drive.Replies.Create (String fileId, String commentId, Reply content) Constructor for the Drive.Replies.Create class. |
| Return type | Method name |
| 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 | setFields(String fields) Sets the fields to be contained in a response. |
| Drive.Replies.Create | setFileId(String fileId) Sets the ID of a file whose comment is replied. |
| 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 line-wrapping breaks. |
| 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. |
| Reply | execute() Sends an HTTP request and returns the object to be converted. |
| constructor |
| protected Drive.Replies.Create(String fileId, String commentId, Reply content) |
| Constructs a Drive.Replies.Create object. |
Parameters
| Parameter name | Parameter desc |
| fileId | File ID. |
| commentId | Comment ID. |
| content | Reply. |
| Method |
| public String getCommentId() |
| Obtains the ID of a comment replied. |
Return
| type | desc |
| String | Comment ID. |
| Method |
| public String getFileId() |
| Obtains the ID of a file whose comment is replied. |
Return
| type | desc |
| String | ID of a file whose comment is replied. |
| Method |
public Drive.Replies.Create set(String parameterName, Object value) |
| Sets the given parameter value for the given parameter name. |
Parameters
| Parameter name | Parameter desc |
| parameterName | Parameter name. |
| value | Parameter value. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public Drive.Replies.Create setCommentId(String commentId) |
| Sets the ID of a comment replied. |
Parameters
| Parameter name | Parameter desc |
| commentId | Comment ID. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public Drive.Replies.Create setFields(String fields) |
| Sets the fields to be contained in a response. |
Parameters
| Parameter name | Parameter desc |
| fields | Fields to be contained in a response. An asterisk(*) can be used to match all related fields. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public Drive.Replies.Create setFileId(String fileId) |
| Sets the ID of a file whose comment is replied. |
Parameters
| Parameter name | Parameter desc |
| fileId | ID of a file whose comment is replied. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public Drive.Replies.Create setForm(String form) |
| Sets the response data format. |
Parameters
| Parameter name | Parameter desc |
| form | Response data format. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public Drive.Replies.Create setPrettyPrint(Boolean prettyPrint) |
| Sets whether to return a response containing indentations and line-wrapping breaks. |
Parameters
| Parameter name | Parameter desc |
| prettyPrint | Response containing indentations and line-wrapping breaks. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| 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
| Parameter name | Parameter desc |
| 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. |
Return
| type | desc |
| Drive.Replies.Create | A Drive.Replies.Create object. |
| Method |
public T execute() throws IOException |
| Sends an HTTP request and returns the object to be converted. |
Throws
| Parameter name | Parameter desc |
| java.io.IOException | I/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description. |
Return
| type | desc |
| Reply | The Drive.Replies.Create class extends DriveRequest. Therefore, the return result of the execute() method is encapsulated as a Reply object. |
Code Example
- private void createReplies(String mFile, String mComment, Reply mReply) {
- Drive drive = DriveUtil.buildDrive();
- if (drive == null) {
- Log.e(TAG, "createReplies error: drive is null.");
- sendHandleMessage(R.id.drive_replies_create, FAIL);
- return;
- }
- if (mFile == null) {
- Log.e(TAG, "createReplies error: mFile is null.");
- sendHandleMessage(R.id.drive_replies_create, FAIL);
- return;
- }
- if (mComment == null) {
- Log.e(TAG, "createReplies error: mComment is null.");
- sendHandleMessage(R.id.drive_replies_create, FAIL);
- return;
- }
- try {
- Reply reply = new Reply();
- reply.setDescription("interface test reply");
- reply.setOperate("resolve");
- mReply = drive.replies().create(mFile.getId(), mComment.getId(), reply).setFields("*").execute();
- sendHandleMessage(R.id.drive_replies_create, SUCCESS);
- } catch (Exception ex) {
- sendHandleMessage(R.id.drive_replies_create, FAIL);
- Log.e(TAG, "createReplies error: " + ex.toString());
- }