#[derive(Debug)]
pub struct ConfigClient<'a> {
    base_client: &'a mut crate::core::base_client::BaseClient,
}
impl<'a> ConfigClient<'a> {
    pub(crate) fn _new(
        base_client: &'a mut crate::core::base_client::BaseClient,
    ) -> Self {
        Self { base_client }
    }
    /// Initialize an SDK configuration with all defaults applied
    ///
    /// Creates a sdk config with default configurations for the api/api version
    ///
    /// POST /sdk/config/init
    pub async fn init(
        &mut self,
        request: super::request_types::InitRequest,
    ) -> crate::SdkResult<crate::BinaryResponse> {
        let url = self.base_client.build_url("/sdk/config/init");
        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::InitSdkConfig {
                    api_version: request.api_version,
                    customizations: request.customizations,
                    api_name: request.api_name,
                },
            );
        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?;
        Ok(crate::BinaryResponse::new(response).await)
    }
    /// Sync an SDK configuration with the latest state of the API
    ///
    /// Updates provided config with missing default configurations for the api version
    ///
    /// POST /sdk/config/sync
    pub async fn sync(
        &mut self,
        request: super::request_types::SyncRequest,
    ) -> crate::SdkResult<crate::BinaryResponse> {
        let url = self.base_client.build_url("/sdk/config/sync");
        let mut builder = reqwest::Client::default().post(&url);
        builder = builder.header("x-sideko-sdk-language", "rust");
        let mut form_data = reqwest::multipart::Form::new();
        if let Some(val) = &request.api_version {
            form_data = form_data
                .part(
                    "api_version",
                    reqwest::multipart::Part::text(
                        crate::core::params::format_string_param(&val),
                    ),
                );
        }
        if let Some(val) = &request.customizations {
            form_data = form_data
                .part(
                    "customizations",
                    reqwest::multipart::Part::text(
                        crate::core::params::format_string_param(&val),
                    ),
                );
        }
        if let Some(val) = &request.openapi {
            form_data = form_data.part("openapi", reqwest::multipart::Part::from(val));
        }
        form_data = form_data
            .part("config", reqwest::multipart::Part::from(&request.config));
        builder = builder.multipart(form_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?;
        Ok(crate::BinaryResponse::new(response).await)
    }
}
