use async_trait;
use crate::;
/// A trait which represents a query which may be made to a Traduora client.
///
/// This is the more general version of [`crate::Query`] because it allows the caller
/// of the trait to chose the type to deserialize to.
/// The distinction is useful to prevent deserialization of fields that the caller is not
/// interested in or to allow deserialization when the Traduora instance returns an
/// unexpected model.
///
/// # Examples
/// ```
/// # use traduora::{Login, TestClient as Traduora, TraduoraError};
/// use serde::Deserialize;
/// use traduora::{CustomQuery, api::users::Me};
///
/// #[derive(Deserialize)]
/// struct UserDataInfo {
/// data: IdOnlyInfo,
/// }
///
/// #[derive(Deserialize)]
/// struct IdOnlyInfo {
/// id: String,
/// }
///
/// # let login = Login::password("user@mail.example", "letmeinpls");
/// let client = Traduora::with_auth("localhost:8080", login)?;
/// let user_info: UserDataInfo = Me.query_custom(&client)?;
///
/// assert_eq!(user_info.data.id, "40379230-ced0-43b8-8b78-37c924f491a7");
/// # Ok::<(), TraduoraError>(())
/// ```
/// A trait which represents an asynchronous query which may be made to a Traduora client.
///
/// This is the more general version of [`crate::AsyncQuery`] because it allows the caller
/// of the trait to chose the type to deserialize to.
/// The distinction is useful to prevent deserialization of fields that the caller is not
/// interested in or to allow deserialization when the Traduora instance returns an
/// unexpected model.
///
/// # Examples
/// ```
/// # use traduora::{Login, TestClient as Traduora, TraduoraError};
/// use serde::Deserialize;
/// use traduora::{AsyncCustomQuery, api::users::Me};
///
/// #[derive(Deserialize)]
/// struct UserDataInfo {
/// data: IdOnlyInfo,
/// }
///
/// #[derive(Deserialize)]
/// struct IdOnlyInfo {
/// id: String,
/// }
///
/// # async fn main_async() -> Result<(), TraduoraError> {
/// # let login = Login::password("user@mail.example", "letmeinpls");
/// let client = Traduora::with_auth("localhost:8080", login)?;
/// let user_info: UserDataInfo = Me.query_custom_async(&client).await?;
///
/// assert_eq!(user_info.data.id, "40379230-ced0-43b8-8b78-37c924f491a7");
/// # Ok(())
/// # }
/// ```