use reqwest::Method;
use crate::api::{decode_response, ErrorKind};
use crate::client::Client;
use crate::error::Error;
use crate::models::conversion::EndTagResponse;
impl Client {
pub async fn end_conversion_log(
&self,
message_id: &str,
) -> Result<EndTagResponse, Error> {
let path = format!(
"ct/1/log/end/{}",
urlencoding(message_id)
);
let response = self.request(Method::POST, &path)?.send().await?;
decode_response(response, ErrorKind::Legacy).await
}
}
fn urlencoding(s: &str) -> String {
url::form_urlencoded::byte_serialize(s.as_bytes()).collect()
}