From a192b0b84e46179a8f28218dfcbb5eb4e28dbf9d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 9 Jan 2019 23:51:44 -0800 Subject: add a couple additional response types, for consistency --- rust/fatcat-api-spec/src/client.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'rust/fatcat-api-spec/src/client.rs') diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs index 5937b7f2..c5cf4297 100644 --- a/rust/fatcat-api-spec/src/client.rs +++ b/rust/fatcat-api-spec/src/client.rs @@ -2570,6 +2570,13 @@ impl Api for Client { Ok(CreateEditgroupResponse::Forbidden(body)) } + 404 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + Ok(CreateEditgroupResponse::NotFound(body)) + } 500 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2619,6 +2626,13 @@ impl Api for Client { Ok(GetChangelogResponse::Success(body)) } + 400 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + Ok(GetChangelogResponse::BadRequest(body)) + } 500 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2669,6 +2683,13 @@ impl Api for Client { Ok(GetChangelogEntryResponse::FoundChangelogEntry(body)) } + 400 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + Ok(GetChangelogEntryResponse::BadRequest(body)) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; -- cgit v1.2.3