pub async fn list_cards_for_user(&self, user_id: &str) -> Result<Vec<Card>, APIError> {
        // Build the request.
        let request = self.request(Method::GET, "cards", (), Some(vec![("user_id".to_string(), user_id.to_string())]));

        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                })
            }
        };

        // Try to deserialize the response.
        let r: Cards = resp.json().await.unwrap();
        Ok(r.data)
    }
/// List cards for a user.
List cards for a user.
List cards for a user .
pub async fn list_cards_for_user(&self, user_id: &str) -> Result<Vec<Card>, APIError> {
        // Build the request.
        let request = self.request(Method::GET, "cards", (), Some(vec![("user_id".to_string(), user_id.to_string())]));
        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                })
            }
        };
        // Try to deserialize the response.
        let r: Cards = resp.json().await.unwrap();
        Ok(r.data)
    }
pub async fn list_cards_for_user ( & self , user_id : & str ) -> Result < Vec < Card > , APIError > { // Build the request. let request = self . request ( Method :: GET , " " , ( ) , Some ( vec ! [ ( " " to_string ( ) user_id to_string ( ) ) ] ) ) ; let resp = self . client . execute ( request ) . await . unwrap ( ) ; match resp . status ( ) { StatusCode :: OK => ( ) , s => { return Err ( APIError { status_code : s , body : resp . text ( ) . await . unwrap ( ) , } ) } } ; // Try to deserialize the response. let r : Cards = resp . json ( ) . await . unwrap ( ) ; Ok ( r . data ) }
List cards for a user.
List cards for a user .
&self
user_id
&str
&self
user_id
&str