stripe/resources/generated/
test_helpers_test_clock.rs1use crate::ids::TestHelpersTestClockId;
6use crate::params::{Object, Timestamp};
7use serde::{Deserialize, Serialize};
8
9#[derive(Clone, Debug, Default, Deserialize, Serialize)]
11pub struct TestHelpersTestClock {
12 pub id: TestHelpersTestClockId,
14
15 #[serde(skip_serializing_if = "Option::is_none")]
19 pub created: Option<Timestamp>,
20
21 #[serde(default)]
23 pub deleted: bool,
24
25 #[serde(skip_serializing_if = "Option::is_none")]
27 pub deletes_after: Option<Timestamp>,
28
29 #[serde(skip_serializing_if = "Option::is_none")]
31 pub frozen_time: Option<Timestamp>,
32
33 #[serde(skip_serializing_if = "Option::is_none")]
35 pub livemode: Option<bool>,
36
37 #[serde(skip_serializing_if = "Option::is_none")]
39 pub name: Option<String>,
40
41 #[serde(skip_serializing_if = "Option::is_none")]
43 pub status: Option<TestHelpersTestClockStatus>,
44}
45
46impl Object for TestHelpersTestClock {
47 type Id = TestHelpersTestClockId;
48 fn id(&self) -> Self::Id {
49 self.id.clone()
50 }
51 fn object(&self) -> &'static str {
52 "test_helpers.test_clock"
53 }
54}
55
56#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
58#[serde(rename_all = "snake_case")]
59pub enum TestHelpersTestClockStatus {
60 Advancing,
61 InternalFailure,
62 Ready,
63}
64
65impl TestHelpersTestClockStatus {
66 pub fn as_str(self) -> &'static str {
67 match self {
68 TestHelpersTestClockStatus::Advancing => "advancing",
69 TestHelpersTestClockStatus::InternalFailure => "internal_failure",
70 TestHelpersTestClockStatus::Ready => "ready",
71 }
72 }
73}
74
75impl AsRef<str> for TestHelpersTestClockStatus {
76 fn as_ref(&self) -> &str {
77 self.as_str()
78 }
79}
80
81impl std::fmt::Display for TestHelpersTestClockStatus {
82 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
83 self.as_str().fmt(f)
84 }
85}
86impl std::default::Default for TestHelpersTestClockStatus {
87 fn default() -> Self {
88 Self::Advancing
89 }
90}