// Copyright (C) Call of Nil contributors
// SPDX-License-Identifier: AGPL-3.0-only

use super::Client;
use crate::error::Result;
use crate::http;
use nil_payload::request::battle::*;
use nil_payload::response::battle::*;

impl Client {
  pub async fn simulate_battle(
    &self,
    req: SimulateBattleRequest,
  ) -> Result<SimulateBattleResponse> {
    http::json_put("simulate-battle")
      .body(req)
      .server(self.server)
      .circuit_breaker(self.circuit_breaker())
      .retry(&self.retry)
      .user_agent(&self.user_agent)
      .send()
      .await
  }
}
