ynab_api_async_fork/models/
save_scheduled_transaction.rs

1/*
2 * YNAB API Endpoints
3 *
4 * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body.  API Documentation is at https://api.ynab.com
5 *
6 * The version of the OpenAPI document: 1.72.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SaveScheduledTransaction {
16    #[serde(rename = "account_id")]
17    pub account_id: String,
18    /// The scheduled transaction date in ISO format (e.g. 2016-12-01).  This should be a future date no more than 5 years into the future.
19    #[serde(rename = "date")]
20    pub date: String,
21    /// The scheduled transaction amount in milliunits format.
22    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
23    pub amount: Option<i64>,
24    /// The payee for the scheduled transaction.  To create a transfer between two accounts, use the account transfer payee pointing to the target account.  Account transfer payees are specified as `transfer_payee_id` on the account resource.
25    #[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
26    pub payee_id: Option<String>,
27    /// The payee name for the the scheduled transaction.  If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a payee with the same name or (2) creation of a new payee.
28    #[serde(rename = "payee_name", skip_serializing_if = "Option::is_none")]
29    pub payee_name: Option<String>,
30    /// The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported.
31    #[serde(rename = "category_id", skip_serializing_if = "Option::is_none")]
32    pub category_id: Option<String>,
33    #[serde(rename = "memo", skip_serializing_if = "Option::is_none")]
34    pub memo: Option<String>,
35    #[serde(rename = "flag_color", skip_serializing_if = "Option::is_none")]
36    pub flag_color: Option<crate::models::TransactionFlagColor>,
37    #[serde(rename = "frequency", skip_serializing_if = "Option::is_none")]
38    pub frequency: Option<crate::models::ScheduledTransactionFrequency>,
39}
40
41impl SaveScheduledTransaction {
42    pub fn new(account_id: String, date: String) -> SaveScheduledTransaction {
43        SaveScheduledTransaction {
44            account_id,
45            date,
46            amount: None,
47            payee_id: None,
48            payee_name: None,
49            category_id: None,
50            memo: None,
51            flag_color: None,
52            frequency: None,
53        }
54    }
55}
56
57