use reqwest::Method;
use serde::{Deserialize, Serialize};
use super::Client;
use crate::error::Result;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SigningKeys {
pub current: String,
pub next: String,
}
pub struct SigningKeysApi<'a> {
pub(crate) client: &'a Client,
}
impl SigningKeysApi<'_> {
pub async fn get(&self) -> Result<SigningKeys> {
self.client
.http
.send_json(Method::GET, "v2/keys", &[], None, None)
.await
}
pub async fn rotate(&self) -> Result<SigningKeys> {
self.client
.http
.send_json(Method::POST, "v2/keys/rotate", &[], None, None)
.await
}
}