pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>) -> Result<Vec<crate::models::Pet>, Error<FindPetsByStatusError>> {

    let client = &configuration.client;

    let uri_str = format!("{}/pet/findByStatus", configuration.base_path);
    let mut req_builder = client.get(uri_str.as_str());

    req_builder = req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]);
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    if let Some(ref token) = configuration.oauth_access_token {
        req_builder = req_builder.bearer_auth(token.to_owned());
    };

    let req = req_builder.build()?;
    let mut resp = client.execute(req)?;

    let status = resp.status();
    let content = resp.text()?;

    if status.is_success() {
        serde_json::from_str(&content).map_err(Error::from)
    } else {
        let entity: Option<FindPetsByStatusError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
/// Multiple status values can be provided with comma separated strings
Multiple status values can be provided with comma separated strings
Multiple status values can be provided with comma separated strings
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>) -> Result<Vec<crate::models::Pet>, Error<FindPetsByStatusError>> {
    let client = &configuration.client;
    let uri_str = format!("{}/pet/findByStatus", configuration.base_path);
    let mut req_builder = client.get(uri_str.as_str());
    req_builder = req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]);
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    if let Some(ref token) = configuration.oauth_access_token {
        req_builder = req_builder.bearer_auth(token.to_owned());
    };
    let req = req_builder.build()?;
    let mut resp = client.execute(req)?;
    let status = resp.status();
    let content = resp.text()?;
    if status.is_success() {
        serde_json::from_str(&content).map_err(Error::from)
    } else {
        let entity: Option<FindPetsByStatusError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
pub fn find_pets_by_status ( configuration : & configuration :: Configuration , status : Vec < String > ) -> Result < Vec < crate :: models :: Pet > , Error < FindPetsByStatusError > > { let client = & configuration . client ; let uri_str = format ! ( " " configuration base_path ) ; let mut req_builder = client . get ( uri_str . as_str ( ) ) ; req_builder = req_builder . query ( & [ ( " " , & status . into_iter ( ) . map ( | p | p . to_string ( ) ) . collect :: < Vec < String > > ( ) . join ( " " ) . to_string ( ) ) ] ) ; if let Some ( ref user_agent ) = configuration . user_agent { req_builder = req_builder . header ( reqwest :: header :: USER_AGENT , user_agent . clone ( ) ) ; } if let Some ( ref token ) = configuration . oauth_access_token { req_builder = req_builder . bearer_auth ( token . to_owned ( ) ) ; } ; let req = req_builder . build ( ) ? ; let mut resp = client . execute ( req ) ? ; let status = resp . status ( ) ; let content = resp . text ( ) ? ; if status . is_success ( ) { serde_json :: from_str ( & content ) . map_err ( Error :: from ) } else { let entity : Option < FindPetsByStatusError > = serde_json :: from_str ( & content ) . ok ( ) ; let error = ResponseContent { status , content , entity } ; Err ( Error :: ResponseError ( error ) ) } }
Multiple status values can be provided with comma separated strings
Multiple status values can be provided with comma separated strings
configuration
&configuration::Configuration
status
Vec<String>
configuration
&configuration::Configuration
status
Vec<String>