/*
 * Tribufu API
 *
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Search {
    #[serde(rename = "type")]
    pub r#type: models::SearchType,
    #[serde(rename = "query", deserialize_with = "Option::deserialize")]
    pub query: Option<String>,
    #[serde(rename = "page", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub page: Option<Option<i32>>,
    #[serde(rename = "game_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub game_id: Option<Option<String>>,
}

impl Search {
    pub fn new(r#type: models::SearchType, query: Option<String>) -> Search {
        Search {
            r#type,
            query,
            page: None,
            game_id: None,
        }
    }
}

