use super::CatalogEndpoint;
use openlark_core::api::{ApiRequest, HttpMethod};
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(test, derive(strum_macros::EnumIter))]
pub enum DocsApiV1 {
ContentGet,
}
impl DocsApiV1 {
pub fn to_url(&self) -> String {
match self {
DocsApiV1::ContentGet => "/open-apis/docs/v1/content".to_string(),
}
}
pub fn to_request<R>(&self) -> ApiRequest<R> {
<Self as CatalogEndpoint>::to_request(self)
}
}
impl CatalogEndpoint for DocsApiV1 {
fn to_url(&self) -> String {
DocsApiV1::to_url(self)
}
fn method(&self) -> HttpMethod {
HttpMethod::Get
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::common::api_endpoints::test_support::catalog_semantics_snapshot;
#[test]
fn docs_catalog_semantics_snapshot() {
insta::assert_snapshot!(catalog_semantics_snapshot::<DocsApiV1>());
}
}