Class Info |
|---|
public class Drive.Replies.Create extends DriveRequest<Reply> Drive.Replies.Create类结构。 |
Constructor Name |
|---|
Drive.Replies.Create(String fileId, String commentId, Reply content) Drive.Replies.Create构造方法。 |
Qualifier and Type | Method Name and Description |
|---|---|
execute() 发送HTTP请求,返回要转换的对象。 | |
String | 获得回复的评论ID。 |
String | 获得回复评论的文件ID。 |
set(String parameterName, Object value) 设置其他参数名称和参数值。 | |
setCommentId(String commentId) 设置回复的评论ID。 | |
setFileId(String fileId) 设置回复评论的文件ID。 | |
setFields(String fields) 设置希望在响应中包含的字段。 | |
setForm(String form) 设置响应的数据格式。 | |
setPrettyPrint(Boolean prettyPrint) 设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。 | |
setQuotaId(String quotaId) 设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 |
Constructor |
|---|
protected Drive.Replies.Create(String fileId, String commentId, Reply content) Drive.Replies.Create构造方法。 |
Parameters
Name | Description |
|---|---|
fileId | 文件ID。 |
commentId | 评论ID。 |
content | 文件评论的回复。 |
Method |
|---|
public String getCommentId() 获得回复的评论ID。 |
Returns
Type | Description |
|---|---|
String | 回复的评论ID。 |
Method |
|---|
public String getFileId() 获得回复评论的文件ID。 |
Returns
Type | Description |
|---|---|
String | 回复评论的文件ID。 |
Method |
|---|
public Drive.Replies.Create set(String parameterName, Object value) 设置其他参数名称和参数值。 |
Parameters
Name | Description |
|---|---|
parameterName | 参数名称。 |
value | 参数值。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setCommentId(String commentId) 设置回复的评论ID。 |
Parameters
Name | Description |
|---|---|
commentId | 回复的评论ID。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setFields(String fields) 设置希望在响应中包含的字段。 |
Parameters
Name | Description |
|---|---|
fields | 希望在响应中包含的字段,支持*匹配所有字段。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setFileId(String fileId) 设置回复评论的文件ID。 |
Parameters
Name | Description |
|---|---|
fileId | 回复评论的文件ID。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setForm(String form) 设置响应的数据格式。 |
Parameters
Name | Description |
|---|---|
form | 响应的数据格式。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setPrettyPrint(Boolean prettyPrint) 设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。 |
Parameters
Name | Description |
|---|---|
prettyPrint | 带有缩进和换行符的响应(格式化,便于阅读打印)。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public Drive.Replies.Create setQuotaId(String quotaId) 设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 |
Parameters
Name | Description |
|---|---|
quotaId | 一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 |
Returns
Type | Description |
|---|---|
Drive.Replies.Create | 返回一个Drive.Replies.Create类对象。 |
Method |
|---|
public T execute() throws IOException 发送HTTP请求,返回要转换的对象。 |
Throws
Name | Description |
|---|---|
java.io.IOException | 若接口调用异常,会返回IOException。您可以通过getMessage方法获取错误描述。 |
Returns
Type | Description |
|---|---|
Reply | Drive.Replies.Create类继承自DriveRequest< Reply>。调用execute方法返回,返回结果封装为Reply对象。 |
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());
}
}