openlark_docs/common/api_endpoints/
docs.rs1use super::CatalogEndpoint;
4use openlark_core::api::{ApiRequest, HttpMethod};
5
6#[derive(Debug, Clone, PartialEq)]
8#[cfg_attr(test, derive(strum_macros::EnumIter))]
9pub enum DocsApiV1 {
10 ContentGet,
12}
13
14impl DocsApiV1 {
15 pub fn to_url(&self) -> String {
17 match self {
18 DocsApiV1::ContentGet => "/open-apis/docs/v1/content".to_string(),
19 }
20 }
21
22 pub fn to_request<R>(&self) -> ApiRequest<R> {
24 <Self as CatalogEndpoint>::to_request(self)
25 }
26}
27
28impl CatalogEndpoint for DocsApiV1 {
29 fn to_url(&self) -> String {
30 DocsApiV1::to_url(self)
31 }
32
33 fn method(&self) -> HttpMethod {
34 HttpMethod::Get
35 }
36
37 }
39
40#[cfg(test)]
41mod tests {
42 use super::*;
43 use crate::common::api_endpoints::test_support::catalog_semantics_snapshot;
44
45 #[test]
46 fn docs_catalog_semantics_snapshot() {
47 insta::assert_snapshot!(catalog_semantics_snapshot::<DocsApiV1>());
48 }
49}