1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* public
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.87.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventInput {
/// customer_id of the customer whose usage needs to be tracked
#[serde(rename = "customer_id")]
pub customer_id: String,
/// Event Id acts as an idempotency key. Any subsequent requests with the same event_id will be ignored
#[serde(rename = "event_id")]
pub event_id: String,
/// Name of the event
#[serde(rename = "event_name")]
pub event_name: String,
/// Custom metadata. Only key value pairs are accepted, objects or arrays submitted will be rejected.
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, models::EventMetadataValue>>,
/// Custom Timestamp. Defaults to current timestamp in UTC. Timestamps that are older that 1 hour or after 5 mins, from current timestamp, will be rejected.
#[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
}
impl EventInput {
pub fn new(customer_id: String, event_id: String, event_name: String) -> EventInput {
EventInput {
customer_id,
event_id,
event_name,
metadata: None,
timestamp: None,
}
}
}