use pandora_api_derive::PandoraJsonRequest;
use serde::{Deserialize, Serialize};
use crate::errors::Error;
use crate::json::{PandoraJsonApiRequest, PandoraSession};
#[derive(Debug, Clone, Default, Serialize, PandoraJsonRequest)]
#[serde(rename_all = "camelCase")]
pub struct CheckLicensing {}
impl CheckLicensing {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CheckLicensingResponse {
pub is_allowed: bool,
}
pub async fn check_licensing(
session: &mut PandoraSession,
) -> Result<CheckLicensingResponse, Error> {
CheckLicensing::default().response(session).await
}
pub struct EchoUnsupported {}
#[cfg(test)]
mod tests {
use super::*;
use crate::json::{tests::session_login, Partner};
#[tokio::test]
async fn licensing_check_test() {
let partner = Partner::default();
let mut session = session_login(&partner)
.await
.expect("Failed initializing login session");
let check_licensing_response = check_licensing(&mut session)
.await
.expect("Error making test.checkLicensing request");
log::debug!("test.checkLicensing() => {:?}", check_licensing_response);
}
}