#![allow(
clippy::too_many_arguments,
clippy::wildcard_imports,
clippy::doc_markdown
)]
use crate::client::AccountClient;
use crate::error::Error;
use crate::generated::routes;
#[allow(unused_imports)]
use crate::generated::types::*;
#[derive(Debug, Clone, Copy)]
pub struct LineupService<'a> {
client: &'a AccountClient,
}
impl<'a> LineupService<'a> {
pub(crate) fn new(client: &'a AccountClient) -> Self {
Self { client }
}
pub fn client(&self) -> &'a AccountClient {
self.client
}
pub async fn create(
&self,
body: &CreateLineupMarkerRequestContent,
) -> Result<CreateLineupMarkerResponseContent, Error> {
let mut operation = self.client.operation(&routes::CREATE_LINEUP_MARKER, &[]);
operation.json(body)?;
self.client.send(operation).await
}
pub async fn delete(&self, marker_id: i64) -> Result<(), Error> {
let operation = self
.client
.operation(&routes::DELETE_LINEUP_MARKER, &[&marker_id]);
self.client.send_unit(operation).await
}
pub async fn list_lineup_markers(&self) -> Result<ListLineupMarkersResponseContent, Error> {
let operation = self.client.operation(&routes::LIST_LINEUP_MARKERS, &[]);
self.client.send(operation).await
}
pub async fn update(
&self,
marker_id: i64,
body: &UpdateLineupMarkerRequestContent,
) -> Result<UpdateLineupMarkerResponseContent, Error> {
let mut operation = self
.client
.operation(&routes::UPDATE_LINEUP_MARKER, &[&marker_id]);
operation.json(body)?;
self.client.send(operation).await
}
}