合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
Class Info |
|---|
public class Drive.Comments.Update extends DriveRequest<Comment> Drive.Comments.Update类结构。 |
Constructor Name |
|---|
Drive.Comments.Update(String fileId, String commentId, Comment content) Drive.Comments.Update构造方法。 |
Qualifier and Type | Method Name and Description |
|---|---|
String | 获取文件评论的ID。 |
String | 获取文件ID。 |
set(String parameterName, Object value) 设置其他参数名称和参数值。 | |
setForm(String form) 设置响应的数据格式。 | |
setCommentId(String commentId) 设置文件评论的ID。 | |
setFields(String fields) 设置希望在响应中包含的字段。说明:fields填*时,drive#comments 结构中replies不返回。 | |
setFileId(String fileId) 设置文件ID。 | |
setPrettyPrint(Boolean prettyPrint) 设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。 | |
setQuotaId(String quotaId) 设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 | |
execute() 发送HTTP请求,返回要转换的对象。 |
Constructor |
|---|
protected Drive.Comments.Update(String fileId, String commentId, Comment content) Drive.Comments.Update构造方法。 |
Parameters
Name | Description |
|---|---|
fileId | 文件ID,通过Files.list接口获取到文件列表信息时会返回文件的fileId。 |
commentId | 文件评论ID,通过Comments.list接口获取文件评论列表信息时会返回文件评论的commentId。 |
content | Comment类对象。 |
Method |
|---|
public String getCommentId() 获取文件评论的ID。 |
Returns
Type | Description |
|---|---|
String | 文件评论的ID。 |
Method |
|---|
public String getFileId() 获取文件ID。 |
Returns
Type | Description |
|---|---|
String | 文件ID。 |
Method |
|---|
public Drive.Comments.Update set(String parameterName, Object value) 设置其他参数名称和参数值。 |
Parameters
Name | Description |
|---|---|
parameterName | 参数名称。 |
value | 参数值。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setForm(String form) 设置响应的数据格式。 |
Parameters
Name | Description |
|---|---|
form | 响应的数据格式,默认为json,只支持json。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setCommentId(String commentId) 设置文件评论的ID。 |
Parameters
Name | Description |
|---|---|
commentId | 文件评论的ID。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setFields(String fields) 设置希望在响应中包含的字段。 |
Parameters
Name | Description |
|---|---|
fields | 希望在响应中包含的字段,支持*匹配所有字段。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setFileId(String fileId) 设置文件ID。 |
Parameters
Name | Description |
|---|---|
fileId | 文件ID。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setPrettyPrint(Boolean prettyPrint) 设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。 |
Parameters
Name | Description |
|---|---|
prettyPrint | 布尔值,标识响应是否带有缩进和换行符。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public Drive.Comments.Update setQuotaId(String quotaId) 设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 |
Parameters
Name | Description |
|---|---|
quotaId | 一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update | 返回一个Drive.Comments.Update类对象。 |
Method |
|---|
public T execute() throws IOException 发送HTTP请求,返回要转换的对象。 |
Throws
Name | Description |
|---|---|
java.io.IOException | 若接口调用异常,会返回IOException。您可以通过getMessage方法获取错误描述。 |
Returns
Type | Description |
|---|---|
Drive.Comments.Update类继承自DriveRequest<Comment>。调用execute方法返回,返回结果封装为Comment对象。 |
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());
}
} 合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功