sbanken/models/
payment.rs

1/*
2 * Bff.ApiBeta : V2 
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Payment {
16    #[serde(rename = "paymentId", skip_serializing_if = "Option::is_none")]
17    pub payment_id: Option<String>,
18    #[serde(rename = "recipientAccountNumber", skip_serializing_if = "Option::is_none")]
19    pub recipient_account_number: Option<String>,
20    #[serde(rename = "amount")]
21    pub amount: f32,
22    #[serde(rename = "dueDate")]
23    pub due_date: String,
24    #[serde(rename = "kid", skip_serializing_if = "Option::is_none")]
25    pub kid: Option<String>,
26    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
27    pub text: Option<String>,
28    #[serde(rename = "isActive")]
29    pub is_active: bool,
30    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
31    pub status: Option<String>,
32    #[serde(rename = "allowedNewStatusTypes", skip_serializing_if = "Option::is_none")]
33    pub allowed_new_status_types: Option<Vec<crate::models::NewStatusType>>,
34    #[serde(rename = "statusDetails", skip_serializing_if = "Option::is_none")]
35    pub status_details: Option<String>,
36    #[serde(rename = "productType", skip_serializing_if = "Option::is_none")]
37    pub product_type: Option<String>,
38    #[serde(rename = "paymentType", skip_serializing_if = "Option::is_none")]
39    pub payment_type: Option<String>,
40    #[serde(rename = "paymentNumber")]
41    pub payment_number: i32,
42    #[serde(rename = "beneficiaryName", skip_serializing_if = "Option::is_none")]
43    pub beneficiary_name: Option<String>,
44}
45
46impl Payment {
47    pub fn new(amount: f32, due_date: String, is_active: bool, payment_number: i32) -> Payment {
48        Payment {
49            payment_id: None,
50            recipient_account_number: None,
51            amount,
52            due_date,
53            kid: None,
54            text: None,
55            is_active,
56            status: None,
57            allowed_new_status_types: None,
58            status_details: None,
59            product_type: None,
60            payment_type: None,
61            payment_number,
62            beneficiary_name: None,
63        }
64    }
65}
66
67