管理中心
我的
API参考云空间服务Androidcom.huawei.cloud.services.driveClass SummaryDrive.Comments.Update

Drive.Comments.Update

展开

Class Info

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

Drive.Comments.Update类结构。

Protected Constructor Summary

展开

Constructor Name

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

Drive.Comments.Update构造方法。

Public Method Summary

展开

Qualifier and Type

Method Name and Description

String

getCommentId()

获取文件评论的ID。

String

getFileId()

获取文件ID。

Drive.Comments.Update

set(String parameterName, Object value)

设置其他参数名称和参数值。

Drive.Comments.Update

setForm(String form)

设置响应的数据格式。

Drive.Comments.Update

setCommentId(String commentId)

设置文件评论的ID。

Drive.Comments.Update

setFields(String fields)

设置希望在响应中包含的字段。说明:fields填*时,drive#comments 结构中replies不返回。

Drive.Comments.Update

setFileId(String fileId)

设置文件ID。

Drive.Comments.Update

setPrettyPrint(Boolean prettyPrint)

设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。

Drive.Comments.Update

setQuotaId(String quotaId)

设置一个不超过40字符的字符串,用于代表用户,主要用于服务端基于用户限制单个用户的API访问数量,用做API访问量配额控制。

Comment

execute()

发送HTTP请求,返回要转换的对象。

Protected Constructors

Drive.Comments.Update

展开

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类对象。

Public Methods

getCommentId

展开

Method

public String getCommentId()

获取文件评论的ID。

Returns

展开

Type

Description

String

文件评论的ID。

getFileId

展开

Method

public String getFileId()

获取文件ID。

Returns

展开

Type

Description

String

文件ID。

set

展开

Method

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

设置其他参数名称和参数值。

Parameters

展开

Name

Description

parameterName

参数名称。

value

参数值。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setForm

展开

Method

public Drive.Comments.Update setForm(String form)

设置响应的数据格式。

Parameters

展开

Name

Description

form

响应的数据格式,默认为json,只支持json。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setCommentId

展开

Method

public Drive.Comments.Update setCommentId(String commentId)

设置文件评论的ID。

Parameters

展开

Name

Description

commentId

文件评论的ID。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setFields

展开

Method

public Drive.Comments.Update setFields(String fields)

设置希望在响应中包含的字段。

Parameters

展开

Name

Description

fields

希望在响应中包含的字段,支持*匹配所有字段。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setFileId

展开

Method

public Drive.Comments.Update setFileId(String fileId)

设置文件ID。

Parameters

展开

Name

Description

fileId

文件ID。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setPrettyPrint

展开

Method

public Drive.Comments.Update setPrettyPrint(Boolean prettyPrint)

设置返回带有缩进和换行符的响应(格式化,便于阅读打印)。

Parameters

展开

Name

Description

prettyPrint

布尔值,标识响应是否带有缩进和换行符。

Returns

展开

Type

Description

Drive.Comments.Update

返回一个Drive.Comments.Update类对象。

setQuotaId

展开

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类对象。

execute

展开

Method

public T execute() throws IOException

发送HTTP请求,返回要转换的对象。

Throws

展开

Name

Description

java.io.IOException

若接口调用异常,会返回IOException。您可以通过getMessage方法获取错误描述。

Returns

展开

Type

Description

Comment

Drive.Comments.Update类继承自DriveRequest<Comment>。调用execute方法返回,返回结果封装为Comment对象。

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());
    }
}