#[derive(Debug)]
pub struct VersionClient<'a> {
base_client: &'a mut crate::core::base_client::BaseClient,
}
impl<'a> VersionClient<'a> {
pub(crate) fn _new(
base_client: &'a mut crate::core::base_client::BaseClient,
) -> Self {
Self { base_client }
}
pub fn sidebar(
&mut self,
) -> crate::resources::doc::version::sidebar::resource_client::SidebarClient<'_> {
crate::resources::doc::version::sidebar::resource_client::SidebarClient::_new(
self.base_client,
)
}
pub fn topbar(
&mut self,
) -> crate::resources::doc::version::topbar::resource_client::TopbarClient<'_> {
crate::resources::doc::version::topbar::resource_client::TopbarClient::_new(
self.base_client,
)
}
pub fn api_link(
&mut self,
) -> crate::resources::doc::version::api_link::resource_client::ApiLinkClient<'_> {
crate::resources::doc::version::api_link::resource_client::ApiLinkClient::_new(
self.base_client,
)
}
pub fn page(
&mut self,
) -> crate::resources::doc::version::page::resource_client::PageClient<'_> {
crate::resources::doc::version::page::resource_client::PageClient::_new(
self.base_client,
)
}
pub fn dropdown(
&mut self,
) -> crate::resources::doc::version::dropdown::resource_client::DropdownClient<'_> {
crate::resources::doc::version::dropdown::resource_client::DropdownClient::_new(
self.base_client,
)
}
pub fn external_link(
&mut self,
) -> crate::resources::doc::version::external_link::resource_client::ExternalLinkClient<
'_,
> {
crate::resources::doc::version::external_link::resource_client::ExternalLinkClient::_new(
self.base_client,
)
}
pub fn space(
&mut self,
) -> crate::resources::doc::version::space::resource_client::SpaceClient<'_> {
crate::resources::doc::version::space::resource_client::SpaceClient::_new(
self.base_client,
)
}
pub fn title(
&mut self,
) -> crate::resources::doc::version::title::resource_client::TitleClient<'_> {
crate::resources::doc::version::title::resource_client::TitleClient::_new(
self.base_client,
)
}
pub async fn list(
&mut self,
request: super::request_types::ListRequest,
) -> crate::SdkResult<Vec<crate::models::DocVersion>> {
let url = self
.base_client
.build_url(
&format!(
"/doc_project/{}/version", crate
::core::params::format_string_param(& request.doc_name)
),
None,
);
let mut builder = reqwest::Client::default().get(&url);
builder = builder.header("x-sideko-sdk-language", "rust");
builder = self
.base_client
.apply_auths_to_builder(builder, &["ApiKeyAuth", "CookieAuth"])
.await?;
let mut response = builder.send().await?;
response = self.base_client.error_for_status("GET", response).await?;
crate::core::response::process_json::<Vec<crate::models::DocVersion>>(response)
.await
}
pub async fn get(
&mut self,
request: super::request_types::GetRequest,
) -> crate::SdkResult<crate::models::DocVersion> {
let url = self
.base_client
.build_url(
&format!(
"/doc_project/{}/version/{}", crate
::core::params::format_string_param(& request.doc_name), crate
::core::params::format_string_param(& request.doc_version)
),
None,
);
let mut builder = reqwest::Client::default().get(&url);
builder = builder.header("x-sideko-sdk-language", "rust");
builder = self
.base_client
.apply_auths_to_builder(builder, &["ApiKeyAuth", "CookieAuth"])
.await?;
let mut response = builder.send().await?;
response = self.base_client.error_for_status("GET", response).await?;
crate::core::response::process_json::<crate::models::DocVersion>(response).await
}
}