目录

Drive.Changes.List

Class Info

public class Drive.Changes. List extends DriveRequest<ChangeList>

Drive.Changes.List class.

Protected Constructor Summary

Constructor Name

Drive.Changes.List(String cursor)

Constructs a Drive.Changes.List object.

Public Method Summary

Qualifier and Type

Method Name and Description

Drive.Changes.List

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Changes.List

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

String

getCursor()

Obtains the value of cursor from nextCursor in the previous response or using the getStartCursor method.

Drive.Changes.List

setCursor(String cursor)

Sets cursor. The value is obtained from nextCursor in the previous response or using the getStartCursor method.

Integer

getPageSize()

Obtains the value of pageSize, indicating the number of changes returned on each page. The default value is 100. The value ranges from 1 to 100. Note: It is possible that partial or empty result pages are returned before the end of the result list has been reached.

Drive.Changes.List

setPageSize(Integer pageSize)

Sets the value of pageSize, indicating the number of changes returned on each page. The default value is 100. The value ranges from 1 to 100. Note: It is possible that partial or empty result pages are returned before the end of the result list has been reached.

String

getContainers()

Obtains the types of space to query.

Drive.Changes.List

setContainers(String containers)

Sets the types of space to query.

ChangeList

execute()

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

Drive.Changes.List

setForm(String form)

Sets the response data format.

Drive.Changes.List

setPrettyPrint(Boolean prettyPrint)

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

Drive.Changes.List

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.

Boolean

getIncludeDeleted()

Checks whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission.

Drive.Changes.List

setIncludeDeleted(Boolean includeDeleted)

Sets whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission.

boolean

isIncludeDeleted()

Obtains the value converted from the value specified for includeDeleted.

Protected Constructors

[h2]Drive.Changes.List

Constructor

protected Drive.Changes.List(String cursor)

Constructs a Drive.Changes.List object.

Parameters

Name

Description

cursor

Cursor for the current page, which is obtained from nextCursor in the previous response or using the getStartCursor method. The server returns a maximum of 100 changes for each query request. If there are more than 100 changes, the cursor needs to be set to nextCursor for a new change notification. This process repeats until nextCursor in the response is empty, which indicates that all changes have been returned.

Public Methods

[h2]setFields

Method

public Drive.Changes.List setFields(String fields)

Sets the fields to be contained in a response. Note: If fields is set to *, sharer, sharedWithMeTime, hasShared, capabilities, permissions, and permissionIds in drive#file are not returned.

Parameters

Name

Description

fields

Fields to be contained in a response. If all related fields need to be contained in a response, set this parameter to asterisk (*). If only certain fields need to be contained in a response, set this parameter to the specific fields, for example, category, nextCursor, newStartCursor, changes/category, and changes/changeType.

If this parameter is not set, the following fields are returned: category, changes.fileName, changes.time, newStartCursor, and nextCursor.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]set

Method

public Drive.Changes.List 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.Changes.List

A Drive.Changes.List object.

[h2]getCursor

Method

public String getCursor()

Obtains the value of cursor.

Returns

Type

Description

String

Value of cursor.

[h2]setCursor

Method

public Drive.Changes.List setCursor(String cursor)

Sets cursor.

Parameters

Name

Description

cursor

Cursor for the current page, which is obtained from nextCursor in the previous response or using the getStartCursor method. The server returns a maximum of 100 changes for each query request. If there are more than 100 changes, the cursor needs to be set to nextCursor for a new change notification. This process repeats until nextCursor in the response is empty, which indicates that all changes have been returned.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]getPageSize

Method

public Integer getPageSize()

Obtains the value of pageSize.

Returns

Type

Description

Integer

Value of pageSize.

[h2]setPageSize

Method

public Drive.Changes.List setPageSize(Integer pageSize)

Sets pageSize.

Parameters

Name

Description

pageSize

Number of changes returned on each page. The default value is 100. The value ranges from 1 to 100. Note: It is possible that partial or empty result pages are returned before the end of the result list has been reached.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]getContainers

Method

public String getContainers()

Obtains the types of space to query.

Returns

Type

Description

String

Types of space to query. The options include drive and applicationData.

[h2]setContainers

Method

public Drive.Changes.List setContainers(String containers)

Sets the types of space to query.

Parameters

Name

Description

containers

Types of space to query. The options include drive and applicationData.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]setForm

Method

public Drive.Changes.List setForm(String form)

Sets the response data format.

Parameters

Name

Description

form

Response data format. The default data format is json, and only this format is supported currently.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]setPrettyPrint

Method

public Drive.Changes.List setPrettyPrint(Boolean prettyPrint)

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

Parameters

Name

Description

prettyPrint

Indicates whether to return a response containing indentations and newline characters. The value is a Boolean value.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]setQuotaId

Method

public Drive.Changes.List 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.Changes.List

A Drive.Changes.List object.

[h2]getIncludeDeleted

Method

public Boolean getIncludeDeleted()

Checks whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission. The default return value is true.

Returns

Type

Description

Boolean

Whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission. The default return value is true.

[h2]setIncludeDeleted

Method

public Drive.Changes.List setIncludeDeleted(Boolean includeDeleted)

Sets whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission.

Parameters

Name

Description

includeDeleted

Indicates whether the changes that have been deleted are included in the returned change list. A deleted change may be one deleted by the user or one that the user no longer has the required permission.

Returns

Type

Description

Drive.Changes.List

A Drive.Changes.List object.

[h2]isIncludeDeleted

Method

public boolean isIncludeDeleted()

Checks whether to set the conversion value of the IncludeDeleted parameter.

Returns

Type

Description

boolean

true if the conversion value of the IncludeDeleted parameter is set; false otherwise.

[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

ChangeList

The Drive.Changes.List class inherits DriveRequest<ChangeList>. Therefore, the return result of the execute() method is encapsulated as a ChangeList object.

Sample Code

private void listChange (Drive drive, String cursor){
    try{
        Drive.Changes.List listRequest = drive.changes().list(cursor);
        ChangeList changeList = listRequest.execute();
    } catch (Exception e){
        Log.e(TAG, "listChange error: " + e.getMessage());
    }
}