pub struct UsageWebhookPayload {
pub request_id: Uuid,
pub timestamp: DateTime<Utc>,
pub provider: String,
pub model: ModelWebhook,
pub organization_id: String,
pub project_id: Option<String>,
pub user_id: Option<String>,
pub usage: TokenUsageWebhook,
pub performance: Option<PerformanceMetrics>,
pub tags: Vec<String>,
pub metadata: HashMap<String, Value>,
}Expand description
Webhook payload for usage data ingestion
Fields§
§request_id: UuidRequest identifier (optional, will be generated if not provided)
timestamp: DateTime<Utc>Timestamp of the LLM request
provider: StringProvider information
model: ModelWebhookModel information
organization_id: StringOrganization identifier
project_id: Option<String>Project identifier (optional)
user_id: Option<String>User identifier (optional)
usage: TokenUsageWebhookToken usage information
performance: Option<PerformanceMetrics>Performance metrics (optional)
Custom tags for categorization
metadata: HashMap<String, Value>Additional metadata
Implementations§
Source§impl UsageWebhookPayload
impl UsageWebhookPayload
Sourcepub fn to_usage_record(&self) -> UsageRecord
pub fn to_usage_record(&self) -> UsageRecord
Convert webhook payload to domain UsageRecord
Trait Implementations§
Source§impl Clone for UsageWebhookPayload
impl Clone for UsageWebhookPayload
Source§fn clone(&self) -> UsageWebhookPayload
fn clone(&self) -> UsageWebhookPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UsageWebhookPayload
impl Debug for UsageWebhookPayload
Source§impl<'de> Deserialize<'de> for UsageWebhookPayload
impl<'de> Deserialize<'de> for UsageWebhookPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for UsageWebhookPayload
impl Serialize for UsageWebhookPayload
Source§impl Validate for UsageWebhookPayload
impl Validate for UsageWebhookPayload
Source§impl<'v_a> ValidateArgs<'v_a> for UsageWebhookPayload
impl<'v_a> ValidateArgs<'v_a> for UsageWebhookPayload
Auto Trait Implementations§
impl Freeze for UsageWebhookPayload
impl RefUnwindSafe for UsageWebhookPayload
impl Send for UsageWebhookPayload
impl Sync for UsageWebhookPayload
impl Unpin for UsageWebhookPayload
impl UnwindSafe for UsageWebhookPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more