stripe/model/
test_helpers_test_clock.rs

1use serde::{Serialize, Deserialize};
2/**A test clock enables deterministic control over objects in testmode. With a test clock, you can create
3objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances,
4you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.*/
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct TestHelpersTestClock {
7    ///Time at which the object was created. Measured in seconds since the Unix epoch.
8    pub created: i64,
9    ///Time at which this clock is scheduled to auto delete.
10    pub deletes_after: i64,
11    ///Time at which all objects belonging to this clock are frozen.
12    pub frozen_time: i64,
13    ///Unique identifier for the object.
14    pub id: String,
15    ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
16    pub livemode: bool,
17    ///The custom name supplied at creation.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub name: Option<String>,
20    ///String representing the object's type. Objects of the same type share the same value.
21    pub object: String,
22    ///The status of the Test Clock.
23    pub status: String,
24}
25impl std::fmt::Display for TestHelpersTestClock {
26    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
27        write!(f, "{}", serde_json::to_string(self).unwrap())
28    }
29}