public static class

DataDeleteRequest.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.fitness.request.DataDeleteRequest.Builder

Class Overview

Builder used to create new DataDeleteRequests.

Summary

Public Constructors
DataDeleteRequest.Builder()
Public Methods
DataDeleteRequest.Builder addDataSource(DataSource dataSource)
Adds a specific data source to delete data from the Google Fit store.
DataDeleteRequest.Builder addDataType(DataType dataType)
Adds a specific data type to delete data from the Google Fit store.
DataDeleteRequest.Builder addSession(Session session)
Adds a specific session to delete from the Google Fit store.
DataDeleteRequest build()
Finishes building and returns the request.
DataDeleteRequest.Builder deleteAllData()
Adds option to delete data for all data types.
DataDeleteRequest.Builder deleteAllSessions()
DataDeleteRequest.Builder setTimeInterval(long startTime, long endTime, TimeUnit timeUnit)
Sets the time interval for the data delete query.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DataDeleteRequest.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.