-
public interface TerraWebhookPayload
Interface representing a payload received to a developer's webhook URL from Terra.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<List<Activity>>
asActivityV2()
Attempt to parse the raw payload as anActivity
object (API version 2).Optional<Athlete>
asAthlete()
Attempt to parse the raw payload as anAthlete
object.Optional<AuthData>
asAuthData()
Attempt to parse the raw payload as aAuthData
object.Optional<List<Body>>
asBodyV2()
Attempt to parse the raw payload as aBody
object (API version 2).Optional<List<Daily>>
asDailyV2()
Attempt to parse the raw payload as aDaily
object (API version 2).Optional<DeauthData>
asDeauthData()
Attempt to parse the raw payload as aDeauthData
object.Optional<List<Menstruation>>
asMenstruationV2()
Attempt to parse the raw payload as aMenstruation
object (API version 2).Optional<List<Nutrition>>
asNutritionV2()
Attempt to parse the raw payload as aNutrition
object (API version 2).Optional<ReauthData>
asReauthData()
Attempt to parse the raw payload as aReauthData
object.Optional<RequestProcessing>
asRequestProcessing()
Attempt to parse the raw payload as anRequestProcessing
object.Optional<List<Sleep>>
asSleepV2()
Attempt to parse the raw payload as anSleep
object (API version 2).com.fasterxml.jackson.databind.JsonNode
getRaw()
The raw, unparsed JSON body for the request.String
getType()
Get the type of the webhook event.Optional<User>
getUser()
Get the user that the webhook event is for.
-
-
-
Method Detail
-
getRaw
com.fasterxml.jackson.databind.JsonNode getRaw()
The raw, unparsed JSON body for the request.- Returns:
- the request body
-
getUser
Optional<User> getUser()
Get the user that the webhook event is for. Note that this will not be present for events of typeuser_reauth
.- Returns:
Optional
containing the user for the event
-
asReauthData
Optional<ReauthData> asReauthData()
Attempt to parse the raw payload as aReauthData
object. If the event type is notuser_reauth
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asAuthData
Optional<AuthData> asAuthData()
Attempt to parse the raw payload as aAuthData
object. If the event type is notauth
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asDeauthData
Optional<DeauthData> asDeauthData()
Attempt to parse the raw payload as aDeauthData
object. If the event type is notdeauth
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asAthlete
Optional<Athlete> asAthlete()
Attempt to parse the raw payload as anAthlete
object. If the event type is notathlete
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asActivityV2
Optional<List<Activity>> asActivityV2()
Attempt to parse the raw payload as anActivity
object (API version 2). If the event type is notactivity
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asBodyV2
Optional<List<Body>> asBodyV2()
Attempt to parse the raw payload as aBody
object (API version 2). If the event type is notbody
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asDailyV2
Optional<List<Daily>> asDailyV2()
Attempt to parse the raw payload as aDaily
object (API version 2). If the event type is notdaily
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asMenstruationV2
Optional<List<Menstruation>> asMenstruationV2()
Attempt to parse the raw payload as aMenstruation
object (API version 2). If the event type is notmenstruation
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asNutritionV2
Optional<List<Nutrition>> asNutritionV2()
Attempt to parse the raw payload as aNutrition
object (API version 2). If the event type is notnutrition
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asSleepV2
Optional<List<Sleep>> asSleepV2()
Attempt to parse the raw payload as anSleep
object (API version 2). If the event type is notsleep
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
asRequestProcessing
Optional<RequestProcessing> asRequestProcessing()
Attempt to parse the raw payload as anRequestProcessing
object. If the event type is notrequest_processing
then this will fail and an emptyOptional
will be returned.- Returns:
Optional
containing the parsed data, if available
-
-