pub async fn delete(bucket: &str, file_name: &str) -> Result<(), Error> {
        let url = format!(
            "{}/b/{}/o/{}",
            crate::BASE_URL,
            percent_encode(bucket),
            percent_encode(file_name),
        );
        let response = crate::CLIENT
            .delete(&url)
            .headers(crate::get_headers().await?)
            .send()
            .await?;
        if response.status().is_success() {
            Ok(())
        } else {
            Err(Error::Google(response.json().await?))
        }
    }
/// Deletes a single object with the specified name in the specified bucket.
/// ### Example
/// ```no_run
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use cloud_storage::Object;
///
/// Object::delete("my_bucket", "path/to/my/file.png").await?;
/// # Ok(())
/// # }
/// ```
Deletes a single object with the specified name in the specified bucket.
Deletes a single object with the specified name in the specified bucket .
pub async fn delete(bucket: &str, file_name: &str) -> Result<(), Error> {
        let url = format!(
            "{}/b/{}/o/{}",
            crate::BASE_URL,
            percent_encode(bucket),
            percent_encode(file_name),
        );
        let response = crate::CLIENT
            .delete(&url)
            .headers(crate::get_headers().await?)
            .send()
            .await?;
        if response.status().is_success() {
            Ok(())
        } else {
            Err(Error::Google(response.json().await?))
        }
    }
pub async fn delete ( bucket : & str , file_name : & str ) -> Result < ( ) , Error > { let url = format ! ( " " crate BASE_URL percent_encode ( bucket ) percent_encode ( file_name ) ) ; let response = crate :: CLIENT . delete ( & url ) . headers ( crate :: get_headers ( ) . await ? ) . send ( ) . await ? ; if response . status ( ) . is_success ( ) { Ok ( ( ) ) } else { Err ( Error :: Google ( response . json ( ) . await ? ) ) } }
Deletes a single object with the specified name in the specified bucket.
Deletes a single object with the specified name in the specified bucket .
bucket
&str
file_name
&str
example
None
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
use cloud_storage::Object.

:delete("my_bucket", "path/to/my/file.png").await?.
use cloud_storage :: Object . : delete ( " my_bucket " " path / to / my / file . png " ) . await? .
ok(())
None
}
None