Package-level declarations

Types

Link copied to clipboard
class ApiClient(baseURL: String, clientCredentials: String, engine: HttpClientEngine = Android.create())
Link copied to clipboard
data class Asset(val state: AssetState, val updatedAt: ZonedDateTime)

A class representing the current state of a particular asset in the computer vision pipeline

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class AssetUrls(val previewImage: String?, val model: String?, val stripes: String?, val texture: String?, val material: String?)
Link copied to clipboard
data class BodyFat(val bodyFatPercentage: Double?, val leanMassPercentage: Double?, val fatMass: Double?, val leanMass: Double?)
Link copied to clipboard
Link copied to clipboard
data class BodyShapePrediction(val id: String, val status: String, val scanId: String, val predictionType: String, val targetWeight: Int? = null, val targetBodyfat: Int? = null, val createdAt: String, val updatedAt: String)

Body shape prediction response object

Link copied to clipboard
data class BodyShapePredictionAssetUrl(val bodyShapePrediction: String? = null)
Link copied to clipboard
data class BodyShapePredictionPayload(val scanId: String, val predictionType: String, val targetWeight: Float? = null, val targetBodyfat: Float? = null)

Body shape prediction post request payload

Link copied to clipboard
data class ExistingUser(val token: String, val email: String?, val sex: UserSex?, val region: UserRegion?, val usaResidence: String?, val birthDate: LocalDate?, val weight: Weight?, val height: Height?, val researchConsent: Boolean?)

A object representing the data used to update an existing user in Prism's systems. This must be after a user has already been created. It should always be done before a new scan, so the user data is up to date.

Link copied to clipboard
data class Height(val value: Double, val unit: HeightUnit)
Link copied to clipboard
Link copied to clipboard
class LocalDateTypeAdapter : TypeAdapter<LocalDate>
Link copied to clipboard
data class Measurements(val neckFit: Double, val shoulderFit: Double, val upperChestFit: Double, val chestFit: Double, val lowerChestFit: Double, val waistFit: Double, val waistNavyFit: Double, val stomachFit: Double, val hipsFit: Double, val upperThighLeftFit: Double, val upperThighRightFit: Double, val thighLeftFit: Double, val thighRightFit: Double, val lowerThighLeftFit: Double, val lowerThighRightFit: Double, val calfLeftFit: Double, val calfRightFit: Double, val ankleLeftFit: Double, val ankleRightFit: Double, val midArmRightFit: Double, val midArmLeftFit: Double, val lowerArmRightFit: Double, val lowerArmLeftFit: Double, val waistToHipRatio: Double, val forearmLeftFit: Double, val forearmRightFit: Double, val wristLeftFit: Double, val wristRightFit: Double)
Link copied to clipboard
Link copied to clipboard
data class NewScan(val userToken: String, val deviceConfigName: String, val bodyFatMethod: BodyfatMethodEnum? = null, val assetConfigId: AssetsBundleId? = null)

This represents the data to initiate a new scan in Prism's system

Link copied to clipboard
data class NewUser(val token: String, val email: String?, val sex: UserSex, val region: UserRegion = UserRegion.NORTH_AMERICA, val usaResidence: String?, val birthDate: LocalDate, val weight: Weight, val height: Height, val researchConsent: Boolean, val termsOfService: TermsOfService)

A object representing the data used to create a new user in Prism's systems. This must be done before any scans can be created. Note that user creation will fail if the user does not explicitly accept the terms of service.

Link copied to clipboard
data class PageInfo(val cursor: String?)
Link copied to clipboard
class Paginated<T>(val results: List<T>, val pageInfo: PageInfo)
Link copied to clipboard
Link copied to clipboard
data class PrismApiError(val statusCode: Int, val message: String?, val error: String?)

A generic error class that is returned from failed API calls

Link copied to clipboard
class PrismApiException(val statusCode: Int, val serverMessage: String?, val error: String?) : Exception
Link copied to clipboard
data class Scan(val id: String, val userId: String, val userToken: String, val status: ScanStatus, val deviceConfigName: String, val weight: Weight, val height: Height, val measurements: Measurements?, val bodyFat: BodyFat?, val scanAssets: ScanAsset?, val createdAt: ZonedDateTime, val updatedAt: ZonedDateTime, val assetConfigId: AssetsBundleId?)
Link copied to clipboard
data class ScanAsset(val id: String, val scanId: String, val captureData: AssetState?, val captureDataUpdatedAt: ZonedDateTime?, val body: AssetState?, val bodyUpdatedAt: ZonedDateTime?, val fittedBody: AssetState?, val fittedBodyUpdatedAt: ZonedDateTime?, val measurement: AssetState?, val measurementUpdatedAt: ZonedDateTime?, val createdAt: ZonedDateTime, val updatedAt: ZonedDateTime)
Link copied to clipboard
class ScanClient(client: ApiClient)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class TermsOfService(val accepted: Boolean, val version: String?)
Link copied to clipboard
data class UploadUrl(val url: String, val expirationTime: ZonedDateTime)

A class representing a time-limited, signed URL for uploading capture data

Link copied to clipboard
data class User(val id: String, val token: String, val email: String?, val sex: UserSex, val region: UserRegion, val usaResidence: String?, val birthDate: LocalDate, val weight: Weight, val height: Height, val researchConsent: Boolean)
Link copied to clipboard
class UserClient(client: ApiClient)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Weight(val value: Double, val unit: WeightUnit)
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T> deserializeResponse(body: String, responseTypeToken: TypeToken<T>): Result<T>
Link copied to clipboard
inline fun <A, B> Result<A>.flatMap(transform: (value: A) -> Result<B>): Result<B>
Link copied to clipboard
Link copied to clipboard
fun isResponseOK(response: HttpResponse): Boolean
Link copied to clipboard
suspend fun <T> parseResponse(response: HttpResponse, responseTypeToken: TypeToken<T>, errorTag: String): Result<T>
suspend fun <T : Any> parseResponse(response: HttpResponse, responseClass: KClass<T>, errorTag: String): Result<T>