目录

class info
public class Drive.Changes.Subscribe extends DriveRequest<Channel>
Drive.Changes.Subscribe class.

Protected Constructor Summary

Constructor name

Drive.Changes.Subscribe(String cursor, Channel content) 

Constructor for the Drive.Changes.Subscribe class.

Public Method Summary

Return typeMethod name
Drive.Changes.Subscribe

setFields(String fields)

Sets the fields to be contained in a response.

Drive.Changes.Subscribe

set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

String

getCursor()

Obtains the value of cursor.

Drive.Changes.Subscribe

setCursor(String cursor)

Sets cursor.

Integer

getPageSize()

Obtains the value of pageSize.

Drive.Changes.Subscribe

setPageSize(Integer pageSize)

Sets pageSize.

String

getContainers()

Obtains the types of space to query.

Drive.Changes.Subscribe

setContainers(String containers)

Sets the types of space to query.

Channel

execute()

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

Drive.Changes.Subscribe

setForm(String form)

Sets the response data format.

Drive.Changes.Subscribe

setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and line-wrapping breaks.

Drive.Changes.Subscribe

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. The default return value is true.

Drive.Changes.Subscribe

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 set for includeDeleted.

Protected Constructors

constructor
protected Drive.Changes.Subscribe (String cursor, Channel content)
Constructs a Drive.Changes.Subscribe object.

Parameters

Parameter nameParameter desc
cursorCursor, which is obtained from nextCursor in the previous response or using the getStartCursor() method.
contentChannel to be subscribed.

Public Methods

Method
public Drive.Changes.Subscribe setFields(String fields)
Sets the fields to be contained in a response.

Parameters

Parameter nameParameter desc
fieldsFields to be contained in a response. An asterisk (*) can be used to match all related fields.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public Drive.Changes.Subscribe set(String parameterName, Object value)

Sets the given parameter value for the given parameter name.

Parameters

Parameter nameParameter desc
parameterNameParameter name.
valueParameter value.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public String getCursor()

Obtains the value of cursor.

Return

typedesc
StringValue of cursor.
Method


public Drive.Changes.Subscribe setCursor(String cursor)

Sets cursor.

Parameters

Parameter nameParameter desc
cursorCursor, which is obtained from nextCursor in the previous response or using the getStartCursor() method.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public Integer getPageSize()

Obtains the value of pageSize.

Return

typedesc
IntegerValue of pageSize.
Method


public Drive.Changes.Subscribe setPageSize(Integer pageSize)

Sets pageSize.

Parameters

Parameter nameParameter desc
pageSizeNumber of changes returned on each page. The default value is 100. The value can range from 1 to 100.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public String getContainers()

Obtains the types of space to query.

Return

typedesc
StringTypes of space to query. The options are drive and applicationData.
Method


public Drive.Changes.Subscribe setContainers(String containers)

Sets the types of space to query.

Parameters

Parameter nameParameter desc
containersTypes of space to query. The options are drive and applicationData.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public Drive.Changes.Subscribe setForm(String form)

Sets the response data format.

Parameters

Parameter nameParameter desc
formResponse data format. The default data format is JSON, and only this format is supported currently.

Return

typedesc
Drive.Changes.Subscribe

A Drive.Changes.Subscribe object.

Method


public Drive.Changes.Subscribe setPrettyPrint(Boolean prettyPrint)

Sets whether to return a response containing indentations and line-wrapping breaks.

Parameters

Parameter nameParameter desc
prettyPrintIndicates whether to return a response containing indentations and line-wrapping breaks. The value is of the Boolean type.

Return

typedesc
Drive.Changes.Subscribe

A Drive.Changes.Subscribe object.

Method


public Drive.Changes.Subscribe setQuotaId(String quotaId)

Sets a string of fewer than 40 characters to identify a user. The string is used by the server to restrict the user’s API calls.

Parameters

Parameter nameParameter desc
quotaIdA 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

typedesc
Drive.Changes.Subscribe

A Drive.Changes.Subscribe object.

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.

Return

typedesc
BooleanIndicates 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.
Method


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

Parameter nameParameter desc
includeDeletedIndicates 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.

Return

typedesc
Drive.Changes.SubscribeA Drive.Changes.Subscribe object.
Method


public boolean isIncludeDeleted()

Obtains the value converted from the value set for includeDeleted.

Return

typedesc
booleanValue converted from the value set for includeDeleted.
Method


public T execute() throws IOException

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

Throws

Parameter nameParameter desc
java.io.IOExceptionI/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description.

Return

typedesc
ChannelThe Drive.Changes.Subscribe class extends DriveRequest<Channel>. Therefore, the return result of the execute() method is encapsulated as a DriveRequest<Channel> object.


Sample Code

  1. private void subscribeChange(Drive drive, String cursor) {
  2.    try {
  3.        Channel channel = new Channel();
  4.        channel.setId(HmsProxyImpl.getInstance().getDeveiceId());
  5.        channel.setType("web_hook");
  6.        channel.setAddress("https://......");
  7.        Drive.Changes.Subscribe subscribe = drive.changes().subscribe(cursor, channel);
  8.        Channel result = subscribe.execute();
  9.    } catch (Exception e) {
  10.        Log.e(TAG, "subscribeChange error: " + e.toString());
  11.    }
  12. }