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
GET traits models
- class q2_smart.ts_endpoints.models.trait_list.TraitMetadata(id, display_name, description, type, source, users_count, total_users)[source]
Visible trait metadata.
users_countandtotal_usersare snapshots from daily trait coverage processing, not live counts. They may be older when processing is delayed.