use super::{
ListQueuesResponse, QueueItem, QueueMessage, QueueServiceProperties, SignedIdentifiers,
};
use async_trait::async_trait;
use azure_core::{
http::{pager::Page, RequestContent, XmlFormat},
xml::to_xml,
Result,
};
#[async_trait]
impl Page for ListQueuesResponse {
type Item = QueueItem;
type IntoIter = <Vec<QueueItem> as IntoIterator>::IntoIter;
async fn into_items(self) -> Result<Self::IntoIter> {
Ok(self.queue_items.into_iter())
}
}
impl TryFrom<QueueMessage> for RequestContent<QueueMessage, XmlFormat> {
type Error = azure_core::Error;
fn try_from(value: QueueMessage) -> Result<Self> {
Ok(to_xml(&value)?.into())
}
}
impl TryFrom<QueueServiceProperties> for RequestContent<QueueServiceProperties, XmlFormat> {
type Error = azure_core::Error;
fn try_from(value: QueueServiceProperties) -> Result<Self> {
Ok(to_xml(&value)?.into())
}
}
impl TryFrom<SignedIdentifiers> for RequestContent<SignedIdentifiers, XmlFormat> {
type Error = azure_core::Error;
fn try_from(value: SignedIdentifiers) -> Result<Self> {
Ok(to_xml(&value)?.into())
}
}