cima_rs/endpoints/
supply_problems.rs1use crate::api_client::CimaClient;
2use crate::models::SupplyProblem;
3use anyhow::{Context, Result};
4
5impl CimaClient {
6 pub async fn get_all_supply_problems(
10 &self,
11 ) -> Result<crate::models::PaginatedResponse<SupplyProblem>> {
12 self.get("psuministro")
13 .await
14 .context("Failed to get all supply problems")
15 }
16
17 pub async fn get_supply_problems(
21 &self,
22 national_code: &str,
23 ) -> Result<crate::models::PaginatedResponse<SupplyProblem>> {
24 let endpoint = format!("psuministro/{}", national_code);
25 self.get(&endpoint)
26 .await
27 .context("Failed to get supply problems for national code")
28 }
29}