kimai_client_lib 1.0.0

JSON API for the Kimai time-tracking software. Read our [API documentation](https://www.kimai.org/documentation/rest-api.html) and download the [Open API definition](doc.json) to import into your API client.
Documentation
/*
 * Kimai - API
 *
 * JSON API for the Kimai time-tracking software. Read our [API documentation](https://www.kimai.org/documentation/rest-api.html) and download the [Open API definition](doc.json) to import into your API client. 
 *
 * The version of the OpenAPI document: 1.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExpenseEditForm {
    #[serde(rename = "begin")]
    pub begin: String,
    /// User ID
    #[serde(rename = "user")]
    pub user: i32,
    /// Project ID
    #[serde(rename = "project")]
    pub project: i32,
    /// Activity ID
    #[serde(rename = "activity", skip_serializing_if = "Option::is_none")]
    pub activity: Option<i32>,
    /// Expense-Category ID
    #[serde(rename = "expenseCategory")]
    pub expense_category: i32,
    /// Description for the expense
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Cost per entry (multiplied by multiplier). This field is not available to every user.
    #[serde(rename = "cost", skip_serializing_if = "Option::is_none")]
    pub cost: Option<f64>,
    #[serde(rename = "multiplier")]
    pub multiplier: f64,
    /// Whether this item should be refundable (yes) or not (no) or if it should be calculated by inherited settings from customer, project and activity (auto).
    #[serde(rename = "billableMode")]
    pub billable_mode: BillableMode,
    #[serde(rename = "exported", skip_serializing_if = "Option::is_none")]
    pub exported: Option<bool>,
}

impl ExpenseEditForm {
    pub fn new(begin: String, user: i32, project: i32, expense_category: i32, multiplier: f64, billable_mode: BillableMode) -> ExpenseEditForm {
        ExpenseEditForm {
            begin,
            user,
            project,
            activity: None,
            expense_category,
            description: None,
            cost: None,
            multiplier,
            billable_mode,
            exported: None,
        }
    }
}
/// Whether this item should be refundable (yes) or not (no) or if it should be calculated by inherited settings from customer, project and activity (auto).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BillableMode {
    #[serde(rename = "auto")]
    Auto,
    #[serde(rename = "yes")]
    Yes,
    #[serde(rename = "no")]
    No,
}

impl Default for BillableMode {
    fn default() -> BillableMode {
        Self::Auto
    }
}