square_api_client/models/gift_card.rs
1//! Model struct for GiftCard type
2
3use serde::{Deserialize, Serialize};
4
5use super::{
6 enums::{GiftCardGANSource, GiftCardStatus, GiftCardType},
7 DateTime, Money,
8};
9
10/// Represents a Square gift card.
11#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
12pub struct GiftCard {
13 /// **Read only** The Square-assigned ID of the gift card.
14 pub id: Option<String>,
15 /// The gift card type.
16 pub r#type: GiftCardType,
17 /// **Read only** The current gift card balance. This balance is always greater than or equal
18 /// to zero.
19 pub balance_money: Option<Money>,
20 /// **Read only** The timestamp when the gift card was created, in RFC 3339 format. In the case
21 /// of a digital gift card, it is the time when you create a card (using the Square Point of
22 /// Sale application, Seller Dashboard, or Gift Cards API).
23 ///
24 /// In the case of a plastic gift card, it is the time when Square associates the card with the
25 /// seller at the time of activation.
26 pub created_at: Option<DateTime>,
27 /// **Read only** The IDs of the [customer profiles](Customer) to whom this gift card is linked.
28 pub customer_ids: Option<Vec<String>>,
29 /// The gift card account number (GAN). Buyers can use the GAN to make purchases or check the
30 /// gift card balance.
31 pub gan: Option<String>,
32 /// The source that generated the gift card account number (GAN). The default value is `SQUARE`.
33 pub gan_source: Option<GiftCardGANSource>,
34 /// **Read only** The current gift card state.
35 pub state: Option<GiftCardStatus>,
36}