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
use serde::{Serialize, Deserialize};
/**A Reader represents a physical device for accepting payment details.
Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader)*/
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TerminalReader {
///The most recent action performed by the reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<serde_json::Value>,
///The current software version of the reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub device_sw_version: Option<String>,
///Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`.
pub device_type: String,
///Unique identifier for the object.
pub id: String,
///The local IP address of the reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
///Custom label given to the reader for easier identification.
pub label: String,
///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
pub livemode: bool,
///The location identifier of the reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<serde_json::Value>,
///Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
pub metadata: serde_json::Value,
///String representing the object's type. Objects of the same type share the same value.
pub object: String,
///Serial number of the reader.
pub serial_number: String,
///The networking status of the reader.
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
impl std::fmt::Display for TerminalReader {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}