pub async fn create_bucket(
        &self,
        post_bucket_request: Option<PostBucketRequest>,
    ) -> Result<(), RequestError> {
        let create_bucket_url = format!("{}/api/v2/buckets", self.url);

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

        if !response.status().is_success() {
            let status = response.status();
            let text = response.text().await.context(ReqwestProcessing)?;
            Http { status, text }.fail()?;
        }

        Ok(())
    }
/// Create a new bucket in the organization specified by the 16-digit
/// hexadecimal `org_id` and with the bucket name `bucket`.
Create a new bucket in the organization specified by the 16-digit
hexadecimal `org_id` and with the bucket name `bucket`.
Create a new bucket in the organization specified by the 16 - digit hexadecimal ` org_id ` and with the bucket name ` bucket ` .
pub async fn create_bucket(
        &self,
        post_bucket_request: Option<PostBucketRequest>,
    ) -> Result<(), RequestError> {
        let create_bucket_url = format!("{}/api/v2/buckets", self.url);
        let response = self
            .request(Method::POST, &create_bucket_url)
            .body(
                serde_json::to_string(&post_bucket_request.unwrap_or_default())
                    .context(Serializing)?,
            )
            .send()
            .await
            .context(ReqwestProcessing)?;
        if !response.status().is_success() {
            let status = response.status();
            let text = response.text().await.context(ReqwestProcessing)?;
            Http { status, text }.fail()?;
        }
        Ok(())
    }
pub async fn create_bucket ( & self , post_bucket_request : Option < PostBucketRequest > , ) -> Result < ( ) , RequestError > { let create_bucket_url = format ! ( " " self url ) ; let response = self . request ( Method :: POST , & create_bucket_url ) . body ( serde_json :: to_string ( & post_bucket_request . unwrap_or_default ( ) ) . context ( Serializing ) ? , ) . send ( ) . await . context ( ReqwestProcessing ) ? ; if ! response . status ( ) . is_success ( ) { let status = response . status ( ) ; let text = response . text ( ) . await . context ( ReqwestProcessing ) ? ; Http { status , text } . fail ( ) ? ; } Ok ( ( ) ) }
Create a new bucket in the organization specified by the 16-digit
hexadecimal `org_id` and with the bucket name `bucket`.
Create a new bucket in the organization specified by the 16 - digit hexadecimal ` org_id ` and with the bucket name ` bucket ` .
&self
post_bucket_request
Option<PostBucketRequest>
&self
post_bucket_request
Option<PostBucketRequest>