use super::CharacterAsset;
use crate::{get_authenticated_paged, Esi, EsiResult, Paged, Response};

impl Esi {
  /**
   * Requires the following scope: esi-assets.read_assets.v1
   * Return a list of the characters assets
   * esi: https://esi.evetech.net/latest/characters/{character_id}/assets/
   */
  pub async fn get_character_assets(
    &self,
    character_id: i32,
    access_token: &str,
    page: Option<i32>,
    etag: Option<&str>,
  ) -> EsiResult<Response<Paged<Vec<CharacterAsset>>>> {
    let result = get_authenticated_paged(
      access_token,
      &format!("characters/{}/assets", character_id),
      self,
      Some(
        vec![("page", page.unwrap_or(1).to_string())]
          .into_iter()
          .collect(),
      ),
      etag,
    )
    .await?;
    Ok(result)
  }
}
