use derive_builder::Builder;
use crate::api::endpoint_prelude::*;
#[derive(Debug, Builder, Clone)]
pub struct RevokePersonalAccessTokenSelf {}
impl RevokePersonalAccessTokenSelf {
pub fn builder() -> RevokePersonalAccessTokenSelfBuilder {
RevokePersonalAccessTokenSelfBuilder::default()
}
}
impl Endpoint for RevokePersonalAccessTokenSelf {
fn method(&self) -> Method {
Method::DELETE
}
fn endpoint(&self) -> Cow<'static, str> {
"personal_access_tokens/self".into()
}
}
#[cfg(test)]
mod tests {
use http::Method;
use crate::api::personal_access_tokens::RevokePersonalAccessTokenSelf;
use crate::api::{self, Query};
use crate::test::client::{ExpectedUrl, SingleTestClient};
#[test]
fn default_is_sufficient() {
RevokePersonalAccessTokenSelf::builder().build().unwrap();
}
#[test]
fn endpoint() {
let endpoint = ExpectedUrl::builder()
.method(Method::DELETE)
.endpoint("personal_access_tokens/self")
.build()
.unwrap();
let client = SingleTestClient::new_raw(endpoint, "");
let endpoint = RevokePersonalAccessTokenSelf::builder().build().unwrap();
api::ignore(endpoint).query(&client).unwrap();
}
}