AiutaSizeFit
Main interface for the Aiuta SizeFit service that provides size recommendations based on user's body measurements and shape.
This service uses the NaizFit API to calculate personalized size recommendations for clothing items based on the user's physical characteristics and the product's size chart.
Important: This interface implements AutoCloseable. When you're done using the instance, call close to release network resources (HTTP client, connection pools).
val sizeFit = aiutaSizeFit {
aiuta = myAiutaInstance
apiKey = "your-api-key"
partitionHeader = "1"
}
try {
val config = AiutaSizeFitConfig(
age = 30,
height = 165,
weight = 68,
gender = AiutaSizeFitConfig.Gender.FEMALE,
hipShape = AiutaSizeFitConfig.HipShape.NORMAL,
bellyShape = AiutaSizeFitConfig.BellyShape.NORMAL
)
val recommendation = sizeFit.recommendSize("product-size-chart-code", config)
println("Recommended size: ${recommendation.recommendedSizeName}")
} finally {
sizeFit.close()
}Content copied to clipboard
See also
Functions
Link copied to clipboard
abstract suspend fun recommendSize(code: String, config: AiutaSizeFitConfig): AiutaSizeFitRecommendation
Get a size recommendation based on user's body measurements and shape.