fastcomments-sdk 3.0.1

Official FastComments Rust SDK (Typed API Client & Utilities)
Documentation
/*
 * fastcomments
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VoteBodyParams {
    #[serde(rename = "commenterEmail", deserialize_with = "Option::deserialize")]
    pub commenter_email: Option<String>,
    #[serde(rename = "commenterName", deserialize_with = "Option::deserialize")]
    pub commenter_name: Option<String>,
    #[serde(rename = "voteDir")]
    pub vote_dir: VoteDir,
    #[serde(rename = "url", deserialize_with = "Option::deserialize")]
    pub url: Option<String>,
}

impl VoteBodyParams {
    pub fn new(commenter_email: Option<String>, commenter_name: Option<String>, vote_dir: VoteDir, url: Option<String>) -> VoteBodyParams {
        VoteBodyParams {
            commenter_email,
            commenter_name,
            vote_dir,
            url,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VoteDir {
    #[serde(rename = "up")]
    Up,
    #[serde(rename = "down")]
    Down,
}

impl Default for VoteDir {
    fn default() -> VoteDir {
        Self::Up
    }
}