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
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data
 *
 * The Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data provides programmatic access to vendor direct fulfillment sandbox test data.
 *
 * The version of the OpenAPI document: 2021-10-28
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Transaction : The transaction details including the status. If the transaction was successful, also includes the requested test order data.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Transaction {
    /// The unique identifier returned in the response to the generateOrderScenarios request.
    #[serde(default, rename = "transactionId")]
    pub transaction_id: String,
    /// The current processing status of the transaction.
    #[serde(default, rename = "status")]
    pub status: Status,
    #[serde(default, rename = "testCaseData", skip_serializing_if = "Option::is_none")]
    pub test_case_data: Option<Box<crate::models::TestCaseData>>,
}

impl Transaction {
    /// The transaction details including the status. If the transaction was successful, also includes the requested test order data.
    pub fn new(transaction_id: String, status: Status) -> Transaction {
        Transaction {
            transaction_id,
            status,
            test_case_data: None,
        }
    }
}

/// The current processing status of the transaction.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "FAILURE")]
    FAILURE,
    #[serde(rename = "PROCESSING")]
    PROCESSING,
    #[serde(rename = "SUCCESS")]
    SUCCESS,
}

impl Default for Status {
    fn default() -> Status {
        Self::FAILURE
    }
}