From faf9c8aa1e41df1889f8382e9c2183e2d5f85de1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 9 Aug 2019 02:06:22 -0400 Subject: add openapi-generated api client --- ynab-api/src/models/sub_transaction.rs | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ynab-api/src/models/sub_transaction.rs (limited to 'ynab-api/src/models/sub_transaction.rs') diff --git a/ynab-api/src/models/sub_transaction.rs b/ynab-api/src/models/sub_transaction.rs new file mode 100644 index 0000000..aa7ed37 --- /dev/null +++ b/ynab-api/src/models/sub_transaction.rs @@ -0,0 +1,54 @@ +/* + * YNAB API Endpoints + * + * 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.youneedabudget.com + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +#[allow(unused_imports)] +use serde_json::Value; + + +#[derive(Debug, Serialize, Deserialize)] +pub struct SubTransaction { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "transaction_id")] + pub transaction_id: String, + /// The subtransaction amount in milliunits format + #[serde(rename = "amount")] + pub amount: i64, + #[serde(rename = "memo")] + pub memo: String, + #[serde(rename = "payee_id")] + pub payee_id: String, + #[serde(rename = "category_id")] + pub category_id: String, + /// If a transfer, the account_id which the subtransaction transfers to + #[serde(rename = "transfer_account_id")] + pub transfer_account_id: String, + /// Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. + #[serde(rename = "deleted")] + pub deleted: bool, +} + +impl SubTransaction { + pub fn new(id: String, transaction_id: String, amount: i64, memo: String, payee_id: String, category_id: String, transfer_account_id: String, deleted: bool) -> SubTransaction { + SubTransaction { + id: id, + transaction_id: transaction_id, + amount: amount, + memo: memo, + payee_id: payee_id, + category_id: category_id, + transfer_account_id: transfer_account_id, + deleted: deleted, + } + } +} + + -- cgit v1.2.3-54-g00ecf