#![allow(clippy::too_many_arguments)]
use crate::client::Client;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;
pub struct BulkReplies<'a> {
client: &'a Client,
}
impl<'a> BulkReplies<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
Self { client }
}
pub fn client(&self) -> &'a Client {
self.client
}
pub async fn create(
&self,
body: &BulkReplyRequestContent,
) -> Result<CreateBulkReplyResponseContent, Error> {
let mut operation = self.client.operation(&routes::CREATE_BULK_REPLY, &[]);
operation.json(body)?;
self.client.send(operation).await
}
pub async fn new_bulk_reply(
&self,
posting_ids: &str,
) -> Result<NewBulkReplyResponseContent, Error> {
let mut operation = self.client.operation(&routes::NEW_BULK_REPLY, &[]);
operation.query("posting_ids", posting_ids);
self.client.send(operation).await
}
}