stripe/model/file_link.rs
1use serde::{Serialize, Deserialize};
2/**To share the contents of a `File` object with non-Stripe users, you can
3create a `FileLink`. `FileLink`s contain a URL that you can use to
4retrieve the contents of the file without authentication.*/
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct FileLink {
7 ///Time at which the object was created. Measured in seconds since the Unix epoch.
8 pub created: i64,
9 ///Returns if the link is already expired.
10 pub expired: bool,
11 ///Time that the link expires.
12 #[serde(skip_serializing_if = "Option::is_none")]
13 pub expires_at: Option<i64>,
14 ///The file object this link points to.
15 pub file: serde_json::Value,
16 ///Unique identifier for the object.
17 pub id: String,
18 ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
19 pub livemode: bool,
20 ///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.
21 pub metadata: serde_json::Value,
22 ///String representing the object's type. Objects of the same type share the same value.
23 pub object: String,
24 ///The publicly accessible URL to download the file.
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub url: Option<String>,
27}
28impl std::fmt::Display for FileLink {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
30 write!(f, "{}", serde_json::to_string(self).unwrap())
31 }
32}