-
public interface TerraWebhookPayloadInterface 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 anActivityobject (API version 2).Optional<Athlete>asAthlete()Attempt to parse the raw payload as anAthleteobject.Optional<AuthData>asAuthData()Attempt to parse the raw payload as aAuthDataobject.Optional<List<Body>>asBodyV2()Attempt to parse the raw payload as aBodyobject (API version 2).Optional<List<Daily>>asDailyV2()Attempt to parse the raw payload as aDailyobject (API version 2).Optional<DeauthData>asDeauthData()Attempt to parse the raw payload as aDeauthDataobject.Optional<List<Menstruation>>asMenstruationV2()Attempt to parse the raw payload as aMenstruationobject (API version 2).Optional<List<Nutrition>>asNutritionV2()Attempt to parse the raw payload as aNutritionobject (API version 2).Optional<ReauthData>asReauthData()Attempt to parse the raw payload as aReauthDataobject.Optional<RequestProcessing>asRequestProcessing()Attempt to parse the raw payload as anRequestProcessingobject.Optional<List<Sleep>>asSleepV2()Attempt to parse the raw payload as anSleepobject (API version 2).com.fasterxml.jackson.databind.JsonNodegetRaw()The raw, unparsed JSON body for the request.StringgetType()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:
Optionalcontaining the user for the event
-
asReauthData
Optional<ReauthData> asReauthData()
Attempt to parse the raw payload as aReauthDataobject. If the event type is notuser_reauththen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asAuthData
Optional<AuthData> asAuthData()
Attempt to parse the raw payload as aAuthDataobject. If the event type is notauththen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asDeauthData
Optional<DeauthData> asDeauthData()
Attempt to parse the raw payload as aDeauthDataobject. If the event type is notdeauththen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asAthlete
Optional<Athlete> asAthlete()
Attempt to parse the raw payload as anAthleteobject. If the event type is notathletethen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asActivityV2
Optional<List<Activity>> asActivityV2()
Attempt to parse the raw payload as anActivityobject (API version 2). If the event type is notactivitythen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asBodyV2
Optional<List<Body>> asBodyV2()
Attempt to parse the raw payload as aBodyobject (API version 2). If the event type is notbodythen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asDailyV2
Optional<List<Daily>> asDailyV2()
Attempt to parse the raw payload as aDailyobject (API version 2). If the event type is notdailythen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asMenstruationV2
Optional<List<Menstruation>> asMenstruationV2()
Attempt to parse the raw payload as aMenstruationobject (API version 2). If the event type is notmenstruationthen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asNutritionV2
Optional<List<Nutrition>> asNutritionV2()
Attempt to parse the raw payload as aNutritionobject (API version 2). If the event type is notnutritionthen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asSleepV2
Optional<List<Sleep>> asSleepV2()
Attempt to parse the raw payload as anSleepobject (API version 2). If the event type is notsleepthen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
asRequestProcessing
Optional<RequestProcessing> asRequestProcessing()
Attempt to parse the raw payload as anRequestProcessingobject. If the event type is notrequest_processingthen this will fail and an emptyOptionalwill be returned.- Returns:
Optionalcontaining the parsed data, if available
-
-