Trait
- class q2_smart.ts_endpoints.traits.UserTrait(trait_id, trait_value)[source]
Bases:
objectModel that describes the payload for the set_user_traits endpoint.
- class q2_smart.ts_endpoints.traits.TraitBatch(user_id, trait_value)[source]
Bases:
objectModel that describes the payload for the set_trait_batch endpoint.
- class q2_smart.ts_endpoints.traits.Traits(logger, config, cache)[source]
Bases:
TSEndpoint- async set_trait(trait_id, user_id)[source]
Deprecated. Please use set_user_traits instead.
- Return type:
- async set_user_traits(user_id, user_traits)[source]
Set multiple traits for a specific user in batch.
- async set_trait_batch(trait_id, trait_batch)[source]
Set a specific trait for multiple users in batch.
- Parameters:
trait_id (
str) – The ID of the trait to settrait_batch (
list[TraitBatch]) – List of TraitBatch objects containing user_id and trait_value pairs
- Return type:
- Returns:
Response data indicating the number of successfully set traits, and any error information