pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec<String>) -> Result<Vec<crate::models::Pet>, Error<FindPetsByTagsError>> {

    let client = &configuration.client;

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

    req_builder = req_builder.query(&[("tags", &tags.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<FindPetsByTagsError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Multiple tags can be provided with comma separated strings . Use tag1 tag2 tag3 for testing .
pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec<String>) -> Result<Vec<crate::models::Pet>, Error<FindPetsByTagsError>> {
    let client = &configuration.client;
    let uri_str = format!("{}/pet/findByTags", configuration.base_path);
    let mut req_builder = client.get(uri_str.as_str());
    req_builder = req_builder.query(&[("tags", &tags.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<FindPetsByTagsError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
pub fn find_pets_by_tags ( configuration : & configuration :: Configuration , tags : Vec < String > ) -> Result < Vec < crate :: models :: Pet > , Error < FindPetsByTagsError > > { 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 ( & [ ( " " , & tags . 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 < FindPetsByTagsError > = serde_json :: from_str ( & content ) . ok ( ) ; let error = ResponseContent { status , content , entity } ; Err ( Error :: ResponseError ( error ) ) } }
Multiple tags can be provided with comma separated strings.
Multiple tags can be provided with comma separated strings .
configuration
&configuration::Configuration
tags
Vec<String>
configuration
&configuration::Configuration
tags
Vec<String>