pub struct CreateEventInput {
pub transaction_id: String,
pub external_customer_id: Option<String>,
pub external_subscription_id: Option<String>,
pub code: String,
pub timestamp: Option<i64>,
pub properties: Option<Value>,
pub precise_total_amount_cents: Option<i64>,
}Expand description
Input data for creating a usage event.
Fields§
§transaction_id: StringUnique identifier for this event (used for idempotency and retrieval)
external_customer_id: Option<String>External customer ID - required if external_subscription_id is not provided
external_subscription_id: Option<String>External subscription ID - required if external_customer_id is not provided
code: StringBillable metric code
timestamp: Option<i64>Event timestamp (Unix timestamp in seconds)
properties: Option<Value>Custom properties/metadata for the event
precise_total_amount_cents: Option<i64>Precise total amount in cents
Implementations§
Source§impl CreateEventInput
impl CreateEventInput
Sourcepub fn for_customer(
transaction_id: String,
external_customer_id: String,
code: String,
) -> Self
pub fn for_customer( transaction_id: String, external_customer_id: String, code: String, ) -> Self
Sourcepub fn for_subscription(
transaction_id: String,
external_subscription_id: String,
code: String,
) -> Self
pub fn for_subscription( transaction_id: String, external_subscription_id: String, code: String, ) -> Self
Sourcepub fn with_timestamp(self, timestamp: i64) -> Self
pub fn with_timestamp(self, timestamp: i64) -> Self
Sourcepub fn with_properties(self, properties: Value) -> Self
pub fn with_properties(self, properties: Value) -> Self
Sourcepub fn with_precise_total_amount_cents(self, amount: i64) -> Self
pub fn with_precise_total_amount_cents(self, amount: i64) -> Self
Trait Implementations§
Source§impl Clone for CreateEventInput
impl Clone for CreateEventInput
Source§fn clone(&self) -> CreateEventInput
fn clone(&self) -> CreateEventInput
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 CreateEventInput
impl Debug for CreateEventInput
Source§impl<'de> Deserialize<'de> for CreateEventInput
impl<'de> Deserialize<'de> for CreateEventInput
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
Auto Trait Implementations§
impl Freeze for CreateEventInput
impl RefUnwindSafe for CreateEventInput
impl Send for CreateEventInput
impl Sync for CreateEventInput
impl Unpin for CreateEventInput
impl UnwindSafe for CreateEventInput
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