| class info |
| public class Drive.Changes.Subscribe extends DriveRequest<Channel> |
| Drive.Changes.Subscribe class. |
| Constructor name |
Drive.Changes.Subscribe(String cursor, Channel content) Constructor for the Drive.Changes.Subscribe class. |
| Return type | Method 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. |
| constructor |
| protected Drive.Changes.Subscribe (String cursor, Channel content) |
| Constructs a Drive.Changes.Subscribe object. |
Parameters
| Parameter name | Parameter desc |
| cursor | Cursor, which is obtained from nextCursor in the previous response or using the getStartCursor() method. |
| content | Channel to be subscribed. |
| Method |
| public Drive.Changes.Subscribe setFields(String fields) |
| Sets the fields to be contained in a response. |
Parameters
| Parameter name | Parameter desc |
| fields | Fields to be contained in a response. An asterisk (*) can be used to match all related fields. |
Return
| type | desc |
| Drive.Changes.Subscribe | A 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 name | Parameter desc |
| parameterName | Parameter name. |
| value | Parameter value. |
Return
| type | desc |
| Drive.Changes.Subscribe | A Drive.Changes.Subscribe object. |
| Method |
public String getCursor() |
| Obtains the value of cursor. |
Return
| type | desc |
| String | Value of cursor. |
| Method |
public Drive.Changes.Subscribe setCursor(String cursor) |
| Sets cursor. |
Parameters
| Parameter name | Parameter desc |
| cursor | Cursor, which is obtained from nextCursor in the previous response or using the getStartCursor() method. |
Return
| type | desc |
| Drive.Changes.Subscribe | A Drive.Changes.Subscribe object. |
| Method |
public Integer getPageSize() |
| Obtains the value of pageSize. |
Return
| type | desc |
| Integer | Value of pageSize. |
| Method |
public Drive.Changes.Subscribe setPageSize(Integer pageSize) |
| Sets pageSize. |
Parameters
| Parameter name | Parameter desc |
| pageSize | Number of changes returned on each page. The default value is 100. The value can range from 1 to 100. |
Return
| type | desc |
| Drive.Changes.Subscribe | A Drive.Changes.Subscribe object. |
| Method |
public String getContainers() |
| Obtains the types of space to query. |
Return
| type | desc |
| String | Types 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 name | Parameter desc |
| containers | Types of space to query. The options are drive and applicationData. |
Return
| type | desc |
| Drive.Changes.Subscribe | A Drive.Changes.Subscribe object. |
| Method |
public Drive.Changes.Subscribe setForm(String form) |
| Sets the response data format. |
Parameters
| Parameter name | Parameter desc |
| form | Response data format. The default data format is JSON, and only this format is supported currently. |
Return
| type | desc |
| 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 name | Parameter desc |
| prettyPrint | Indicates whether to return a response containing indentations and line-wrapping breaks. The value is of the Boolean type. |
Return
| type | desc |
| 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 name | Parameter desc |
| 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. |
Return
| type | desc |
| 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
| type | desc |
| Boolean | 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. 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 name | Parameter desc |
| 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. |
Return
| type | desc |
| Drive.Changes.Subscribe | A Drive.Changes.Subscribe object. |
| Method |
public boolean isIncludeDeleted() |
| Obtains the value converted from the value set for includeDeleted. |
Return
| type | desc |
| boolean | Value 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 name | Parameter desc |
| java.io.IOException | I/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description. |
Return
| type | desc |
| Channel | The Drive.Changes.Subscribe class extends DriveRequest<Channel>. Therefore, the return result of the execute() method is encapsulated as a DriveRequest<Channel> object. |
Sample Code
- private void subscribeChange(Drive drive, String cursor) {
- try {
- Channel channel = new Channel();
- channel.setId(HmsProxyImpl.getInstance().getDeveiceId());
- channel.setType("web_hook");
- channel.setAddress("https://......");
- Drive.Changes.Subscribe subscribe = drive.changes().subscribe(cursor, channel);
- Channel result = subscribe.execute();
- } catch (Exception e) {
- Log.e(TAG, "subscribeChange error: " + e.toString());
- }
- }