#[derive(Debug)]
pub struct GuideClient<'a> {
    base_client: &'a mut crate::core::base_client::BaseClient,
}
impl<'a> GuideClient<'a> {
    pub(crate) fn _new(
        base_client: &'a mut crate::core::base_client::BaseClient,
    ) -> Self {
        Self { base_client }
    }
    /// Delete a specific guide for a specific version of a documentation project
    ///
    /// DELETE /doc_project/{doc_name}/version/{doc_version}/guide/{guide_id}
    pub async fn delete(
        &mut self,
        request: super::request_types::DeleteRequest,
    ) -> crate::SdkResult<()> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide/{}", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version), crate
                    ::core::params::format_string_param(& request.guide_id)
                ),
            );
        let mut builder = reqwest::Client::default().delete(&url);
        builder = builder.header("x-sideko-sdk-language", "rust");
        builder = self
            .base_client
            .apply_auths_to_builder(builder, &["ApiKeyAuth", "CookieAuth"])
            .await?;
        let response = builder.send().await?;
        self.base_client.error_for_status("DELETE", response).await?;
        Ok(())
    }
    /// List guides for a specific version of a documentation project
    ///
    /// GET /doc_project/{doc_name}/version/{doc_version}/guide
    pub async fn list(
        &mut self,
        request: super::request_types::ListRequest,
    ) -> crate::SdkResult<Vec<crate::models::GuideWithChildren>> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version)
                ),
            );
        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::GuideWithChildren>,
        >(response)
            .await
    }
    /// Get a specific guide for a specific version of a documentation project
    ///
    /// GET /doc_project/{doc_name}/version/{doc_version}/guide/{guide_id}
    pub async fn get(
        &mut self,
        request: super::request_types::GetRequest,
    ) -> crate::SdkResult<crate::models::Guide> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide/{}", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version), crate
                    ::core::params::format_string_param(& request.guide_id)
                ),
            );
        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::Guide>(response).await
    }
    /// Get content for a specific guide for a specific version of a documentation project
    ///
    /// GET /doc_project/{doc_name}/version/{doc_version}/guide/{guide_id}/content
    pub async fn get_content(
        &mut self,
        request: super::request_types::GetContentRequest,
    ) -> crate::SdkResult<crate::models::GuideContent> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide/{}/content", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version), crate
                    ::core::params::format_string_param(& request.guide_id)
                ),
            );
        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::GuideContent>(response)
            .await
    }
    /// Update a specific guide for a specific version of a documentation project
    ///
    /// PATCH /doc_project/{doc_name}/version/{doc_version}/guide/{guide_id}
    pub async fn patch(
        &mut self,
        request: super::request_types::PatchRequest,
    ) -> crate::SdkResult<crate::models::Guide> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide/{}", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version), crate
                    ::core::params::format_string_param(& request.guide_id)
                ),
            );
        let mut builder = reqwest::Client::default().patch(&url);
        builder = builder.header("x-sideko-sdk-language", "rust");
        builder = builder.header("content-type", "application/json");
        builder = builder
            .json(
                &crate::models::UpdateGuide {
                    content: request.content,
                    icon: request.icon,
                    nav_label: request.nav_label,
                    next_id: request.next_id,
                    prev_id: request.prev_id,
                    slug: request.slug,
                    table_of_contents: request.table_of_contents,
                },
            );
        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("PATCH", response).await?;
        crate::core::response::process_json::<crate::models::Guide>(response).await
    }
    /// Create a guide for a specific version of a documentation project
    ///
    /// POST /doc_project/{doc_name}/version/{doc_version}/guide
    pub async fn create(
        &mut self,
        request: super::request_types::CreateRequest,
    ) -> crate::SdkResult<crate::models::Guide> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version)
                ),
            );
        let mut builder = reqwest::Client::default().post(&url);
        builder = builder.header("x-sideko-sdk-language", "rust");
        builder = builder.header("content-type", "application/json");
        builder = builder
            .json(
                &crate::models::NewGuide {
                    icon: request.icon,
                    next_id: request.next_id,
                    parent_id: request.parent_id,
                    prev_id: request.prev_id,
                    table_of_contents: request.table_of_contents,
                    content: request.content,
                    is_parent: request.is_parent,
                    nav_label: request.nav_label,
                    slug: request.slug,
                },
            );
        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("POST", response).await?;
        crate::core::response::process_json::<crate::models::Guide>(response).await
    }
    /// Reorder guides for a specific version of a documentation project
    ///
    /// POST /doc_project/{doc_name}/version/{doc_version}/guide/reorder
    pub async fn reorder(
        &mut self,
        request: super::request_types::ReorderRequest,
    ) -> crate::SdkResult<Vec<crate::models::GuideWithChildren>> {
        let url = self
            .base_client
            .build_url(
                &format!(
                    "/doc_project/{}/version/{}/guide/reorder", crate
                    ::core::params::format_string_param(& request.doc_name), crate
                    ::core::params::format_string_param(& request.doc_version)
                ),
            );
        let mut builder = reqwest::Client::default().post(&url);
        builder = builder.header("x-sideko-sdk-language", "rust");
        builder = builder.header("content-type", "application/json");
        builder = builder.json(&request.data);
        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("POST", response).await?;
        crate::core::response::process_json::<
            Vec<crate::models::GuideWithChildren>,
        >(response)
            .await
    }
}
