Skip to main content

autogen_squareup/models/
invoice_status.rs

1/*
2 * Square
3 *
4 * Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.
5 *
6 * The version of the OpenAPI document: 2.0
7 * Contact: developers@squareup.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// InvoiceStatus : Indicates the status of an [invoice](entity:Invoice).
15/// Indicates the status of an [invoice](entity:Invoice).
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum InvoiceStatus {
18    #[serde(rename = "DRAFT")]
19    Draft,
20    #[serde(rename = "UNPAID")]
21    Unpaid,
22    #[serde(rename = "SCHEDULED")]
23    Scheduled,
24    #[serde(rename = "PARTIALLY_PAID")]
25    PartiallyPaid,
26    #[serde(rename = "PAID")]
27    Paid,
28    #[serde(rename = "PARTIALLY_REFUNDED")]
29    PartiallyRefunded,
30    #[serde(rename = "REFUNDED")]
31    Refunded,
32    #[serde(rename = "CANCELED")]
33    Canceled,
34    #[serde(rename = "FAILED")]
35    Failed,
36    #[serde(rename = "PAYMENT_PENDING")]
37    PaymentPending,
38
39}
40
41impl std::fmt::Display for InvoiceStatus {
42    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
43        match self {
44            Self::Draft => write!(f, "DRAFT"),
45            Self::Unpaid => write!(f, "UNPAID"),
46            Self::Scheduled => write!(f, "SCHEDULED"),
47            Self::PartiallyPaid => write!(f, "PARTIALLY_PAID"),
48            Self::Paid => write!(f, "PAID"),
49            Self::PartiallyRefunded => write!(f, "PARTIALLY_REFUNDED"),
50            Self::Refunded => write!(f, "REFUNDED"),
51            Self::Canceled => write!(f, "CANCELED"),
52            Self::Failed => write!(f, "FAILED"),
53            Self::PaymentPending => write!(f, "PAYMENT_PENDING"),
54        }
55    }
56}
57
58impl Default for InvoiceStatus {
59    fn default() -> InvoiceStatus {
60        Self::Draft
61    }
62}
63