pub async fn onboarding(
        &self,
        username: &str,
        org: &str,
        bucket: &str,
        password: Option<String>,
        retention_period_hrs: Option<i32>,
        retention_period_seconds: Option<i32>,
    ) -> Result<OnboardingResponse, RequestError> {
        let setup_init_url = format!("{}/api/v2/setup", self.url);

        let body = OnboardingRequest {
            username: username.into(),
            org: org.into(),
            bucket: bucket.into(),
            password,
            retention_period_hrs,
            retention_period_seconds,
        };

        let response = self
            .request(Method::POST, &setup_init_url)
            .body(serde_json::to_string(&body).context(Serializing)?)
            .send()
            .await
            .context(ReqwestProcessing)?;

        match response.status() {
            StatusCode::CREATED => Ok(response
                .json::<OnboardingResponse>()
                .await
                .context(ReqwestProcessing)?),
            status => {
                let text = response.text().await.context(ReqwestProcessing)?;
                Http { status, text }.fail()?
            }
        }
    }
/// Set up initial user, org and bucket
Set up initial user, org and bucket
Set up initial user org and bucket
pub async fn onboarding(
        &self,
        username: &str,
        org: &str,
        bucket: &str,
        password: Option<String>,
        retention_period_hrs: Option<i32>,
        retention_period_seconds: Option<i32>,
    ) -> Result<OnboardingResponse, RequestError> {
        let setup_init_url = format!("{}/api/v2/setup", self.url);
        let body = OnboardingRequest {
            username: username.into(),
            org: org.into(),
            bucket: bucket.into(),
            password,
            retention_period_hrs,
            retention_period_seconds,
        };
        let response = self
            .request(Method::POST, &setup_init_url)
            .body(serde_json::to_string(&body).context(Serializing)?)
            .send()
            .await
            .context(ReqwestProcessing)?;
        match response.status() {
            StatusCode::CREATED => Ok(response
                .json::<OnboardingResponse>()
                .await
                .context(ReqwestProcessing)?),
            status => {
                let text = response.text().await.context(ReqwestProcessing)?;
                Http { status, text }.fail()?
            }
        }
    }
pub async fn onboarding ( & self , username : & str , org : & str , bucket : & str , password : Option < String > , retention_period_hrs : Option < i32 > , retention_period_seconds : Option < i32 > , ) -> Result < OnboardingResponse , RequestError > { let setup_init_url = format ! ( " " self url ) ; let body = OnboardingRequest { username : username . into ( ) , org : org . into ( ) , bucket : bucket . into ( ) , password , retention_period_hrs , retention_period_seconds , } ; let response = self . request ( Method :: POST , & setup_init_url ) . body ( serde_json :: to_string ( & body ) . context ( Serializing ) ? ) . send ( ) . await . context ( ReqwestProcessing ) ? ; match response . status ( ) { StatusCode :: CREATED => Ok ( response . json :: < OnboardingResponse > ( ) . await . context ( ReqwestProcessing ) ? ) , status => { let text = response . text ( ) . await . context ( ReqwestProcessing ) ? ; Http { status , text } . fail ( ) ? } } }
Set up initial user, org and bucket
Set up initial user org and bucket
&self
username
&str
org
&str
bucket
&str
password
Option<String>
retention_period_hrs
Option<i32>
retention_period_seconds
Option<i32>
&self
username
&str
org
&str
bucket
&str
password
Option<String>
retention_period_hrs
Option<i32>
retention_period_seconds
Option<i32>