pub fn update_user(configuration: &configuration::Configuration, username: &str, body: crate::models::User) -> Result<(), Error<UpdateUserError>> {

    let client = &configuration.client;

    let uri_str = format!("{}/user/{username}", configuration.base_path, username=crate::apis::urlencode(username));
    let mut req_builder = client.put(uri_str.as_str());

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&body);

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

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

    if status.is_success() {
        Ok(())
    } else {
        let entity: Option<UpdateUserError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
/// This can only be done by the logged in user.
This can only be done by the logged in user.
This can only be done by the logged in user .
pub fn update_user(configuration: &configuration::Configuration, username: &str, body: crate::models::User) -> Result<(), Error<UpdateUserError>> {
    let client = &configuration.client;
    let uri_str = format!("{}/user/{username}", configuration.base_path, username=crate::apis::urlencode(username));
    let mut req_builder = client.put(uri_str.as_str());
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&body);
    let req = req_builder.build()?;
    let mut resp = client.execute(req)?;
    let status = resp.status();
    let content = resp.text()?;
    if status.is_success() {
        Ok(())
    } else {
        let entity: Option<UpdateUserError> = serde_json::from_str(&content).ok();
        let error = ResponseContent { status, content, entity };
        Err(Error::ResponseError(error))
    }
}
pub fn update_user ( configuration : & configuration :: Configuration , username : & str , body : crate :: models :: User ) -> Result < ( ) , Error < UpdateUserError > > { let client = & configuration . client ; let uri_str = format ! ( " " configuration base_path username crate apis urlencode ( username ) ) ; let mut req_builder = client . put ( uri_str . as_str ( ) ) ; if let Some ( ref user_agent ) = configuration . user_agent { req_builder = req_builder . header ( reqwest :: header :: USER_AGENT , user_agent . clone ( ) ) ; } req_builder = req_builder . json ( & body ) ; let req = req_builder . build ( ) ? ; let mut resp = client . execute ( req ) ? ; let status = resp . status ( ) ; let content = resp . text ( ) ? ; if status . is_success ( ) { Ok ( ( ) ) } else { let entity : Option < UpdateUserError > = serde_json :: from_str ( & content ) . ok ( ) ; let error = ResponseContent { status , content , entity } ; Err ( Error :: ResponseError ( error ) ) } }
This can only be done by the logged in user.
This can only be done by the logged in user .
configuration
&configuration::Configuration
username
&str
body
crate::models::User
configuration
&configuration::Configuration
username
&str
body
crate::models::User