Page Summary
-
The
DataDeleteRequest.Builderis used to create newDataDeleteRequestsfor deleting data from the Google Fit store. -
You can specify data to delete by adding specific data sources, data types, or sessions, or by choosing to delete all data or all sessions.
-
You must set a time interval for the data deletion query.
-
The
build()method finalizes the request once all specifications are set.
Builder used to create new DataDeleteRequests.
Public Constructor Summary
|
Builder()
|
Public Method Summary
| DataDeleteRequest.Builder |
addDataSource(DataSource
dataSource)
Adds a specific data source to delete data from the Google Fit store.
|
| DataDeleteRequest.Builder | |
| DataDeleteRequest.Builder | |
| DataDeleteRequest |
build()
Finishes building and returns the request.
|
| DataDeleteRequest.Builder |
deleteAllData()
Adds option to delete data for all data types.
|
| DataDeleteRequest.Builder | |
| DataDeleteRequest.Builder |
setTimeInterval(long startTime, long endTime, TimeUnit
timeUnit)
Sets the time interval for the data delete query.
|
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public DataDeleteRequest.Builder addDataSource (DataSource dataSource)
Adds a specific data source to delete data from the Google Fit store. Apps can
either use this function or use
addDataType(DataType) to add a specific data type, or use
deleteAllData() to mark data for all data types to be deleted.
Throws
| IllegalArgumentException | If the input data source is invalid or if all data is already marked for deletion |
|---|
public DataDeleteRequest.Builder addDataType (DataType dataType)
Adds a specific data type to delete data from the Google Fit store. Apps can either
use this function or use
addDataSource(DataSource) to add a specific data source, or use
deleteAllData() to mark data for all data types to be deleted.
Throws
| IllegalArgumentException | If invalid data type is specified or if all data is already marked for deletion |
|---|
public DataDeleteRequest.Builder addSession (Session session)
Adds a specific session to delete from the Google Fit store. Apps can either use
this function or use
deleteAllSessions() to mark all sessions for deletion. Only sessions that
have already ended can be marked for deletion.
Throws
| IllegalArgumentException | If the input session is invalid or is still ongoing, or if all sessions are already marked for deletion |
|---|
public DataDeleteRequest build ()
Finishes building and returns the request.
Throws
| IllegalStateException | If time interval is not set or if input sessions are outside the query time interval, or if no data or session is marked for deletion |
|---|
public DataDeleteRequest.Builder deleteAllData ()
Adds option to delete data for all data types. Apps can either use this function to
delete all data or specify a specific data source using
addDataSource(DataSource) or a specific data type using
addDataType(DataType) for data deletion.
Throws
| IllegalArgumentException | If a specific data source/type is already added for deletion. |
|---|
public DataDeleteRequest.Builder deleteAllSessions ()
public DataDeleteRequest.Builder setTimeInterval (long startTime, long endTime, TimeUnit timeUnit)
Sets the time interval for the data delete query.
Throws
| IllegalArgumentException | If the input time interval is invalid. |
|---|