#[derive(Debug)]
pub struct OrgClient<'a> {
    base_client: &'a mut crate::core::base_client::BaseClient,
}
impl<'a> OrgClient<'a> {
    pub(crate) fn _new(
        base_client: &'a mut crate::core::base_client::BaseClient,
    ) -> Self {
        Self { base_client }
    }
    pub fn theme(
        &mut self,
    ) -> crate::resources::org::theme::resource_client::ThemeClient {
        crate::resources::org::theme::resource_client::ThemeClient::_new(
            self.base_client,
        )
    }
    /// Get Organization
    ///
    /// Retrieves the organization of the current authenticated user
    ///
    /// GET /organization
    pub async fn get(&mut self) -> crate::SdkResult<crate::models::Organization> {
        let url = self.base_client.build_url("/organization");
        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::Organization>(response)
            .await
    }
    /// Create a new organization
    ///
    /// POST /organization
    pub async fn create(
        &mut self,
        request: super::request_types::CreateRequest,
    ) -> crate::SdkResult<crate::models::OrganizationWithRedirect> {
        let url = self.base_client.build_url("/organization");
        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::NewOrganization {
                    name: request.name,
                    subdomain: request.subdomain,
                },
            );
        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::OrganizationWithRedirect,
        >(response)
            .await
    }
}
