azure_storage_blobs/blob/operations/
break_lease.rsuse crate::prelude::*;
use azure_core::{headers::*, prelude::*, RequestId};
use time::OffsetDateTime;
operation! {
BreakLease,
client: BlobClient,
?lease_break_period: LeaseBreakPeriod,
?lease_id: LeaseId
}
impl BreakLeaseBuilder {
pub fn into_future(mut self) -> BreakLease {
Box::pin(async move {
let mut url = self.client.url()?;
url.query_pairs_mut().append_pair("comp", "lease");
let mut headers = Headers::new();
headers.insert(LEASE_ACTION, "break");
headers.add(self.lease_break_period);
headers.add(self.lease_id);
let mut request =
BlobClient::finalize_request(url, azure_core::Method::Put, headers, None)?;
let response = self.client.send(&mut self.context, &mut request).await?;
BreakLeaseResponse::from_headers(response.headers())
})
}
}
azure_storage::response_from_headers!(BreakLeaseResponse,
etag_from_headers => etag: String,
last_modified_from_headers => last_modified: OffsetDateTime,
lease_time_from_headers => lease_time: u8,
request_id_from_headers => request_id: RequestId,
date_from_headers => date: OffsetDateTime
);