summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api/src')
-rw-r--r--rust/fatcat-api/src/client.rs106
-rw-r--r--rust/fatcat-api/src/lib.rs106
-rw-r--r--rust/fatcat-api/src/models.rs8
3 files changed, 110 insertions, 110 deletions
diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs
index f4b9e671..09b43e4b 100644
--- a/rust/fatcat-api/src/client.rs
+++ b/rust/fatcat-api/src/client.rs
@@ -185,21 +185,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerIdGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerIdGetResponse::GenericError(body))
}
@@ -248,21 +248,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerLookupGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerLookupGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerLookupGetResponse::GenericError(body))
}
@@ -313,21 +313,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerPostResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerPostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ContainerPostResponse::GenericError(body))
}
@@ -373,21 +373,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorIdGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorIdGetResponse::GenericError(body))
}
@@ -436,21 +436,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorLookupGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorLookupGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorLookupGetResponse::GenericError(body))
}
@@ -501,21 +501,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorPostResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorPostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(CreatorPostResponse::GenericError(body))
}
@@ -561,21 +561,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupIdAcceptPostResponse::Unmergable(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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupIdAcceptPostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupIdAcceptPostResponse::GenericError(body))
}
@@ -621,14 +621,14 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupIdGetResponse::GenericError(body))
}
@@ -674,14 +674,14 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupPostResponse::BadRequest(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditgroupPostResponse::GenericError(body))
}
@@ -731,14 +731,14 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditorUsernameChangelogGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditorUsernameChangelogGetResponse::GenericError(body))
}
@@ -788,14 +788,14 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditorUsernameGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(EditorUsernameGetResponse::GenericError(body))
}
@@ -841,21 +841,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileIdGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileIdGetResponse::GenericError(body))
}
@@ -904,21 +904,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileLookupGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileLookupGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FileLookupGetResponse::GenericError(body))
}
@@ -969,21 +969,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FilePostResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FilePostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(FilePostResponse::GenericError(body))
}
@@ -1029,21 +1029,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseIdGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseIdGetResponse::GenericError(body))
}
@@ -1092,21 +1092,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseLookupGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseLookupGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleaseLookupGetResponse::GenericError(body))
}
@@ -1157,21 +1157,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleasePostResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleasePostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(ReleasePostResponse::GenericError(body))
}
@@ -1217,21 +1217,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkIdGetResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkIdGetResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkIdGetResponse::GenericError(body))
}
@@ -1282,21 +1282,21 @@ impl Api for Client {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkPostResponse::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)))?;
- let body = serde_json::from_str::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkPostResponse::NotFound(body))
}
0 => {
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::<models::Error>(&buf)?;
+ let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
Ok(WorkPostResponse::GenericError(body))
}
diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs
index 17dd6c76..3696a1e2 100644
--- a/rust/fatcat-api/src/lib.rs
+++ b/rust/fatcat-api/src/lib.rs
@@ -37,11 +37,11 @@ pub enum ContainerIdGetResponse {
/// Found Entity
FoundEntity(models::ContainerEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -49,11 +49,11 @@ pub enum ContainerLookupGetResponse {
/// Found Entity
FoundEntity(models::ContainerEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -61,11 +61,11 @@ pub enum ContainerPostResponse {
/// Created Entity
CreatedEntity(models::EntityEdit),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -73,11 +73,11 @@ pub enum CreatorIdGetResponse {
/// Found Entity
FoundEntity(models::CreatorEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -85,11 +85,11 @@ pub enum CreatorLookupGetResponse {
/// Found Entity
FoundEntity(models::CreatorEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -97,11 +97,11 @@ pub enum CreatorPostResponse {
/// Created Entity
CreatedEntity(models::EntityEdit),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -109,11 +109,11 @@ pub enum EditgroupIdAcceptPostResponse {
/// Merged Successfully
MergedSuccessfully(models::Success),
/// Unmergable
- Unmergable(models::Error),
+ Unmergable(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -121,9 +121,9 @@ pub enum EditgroupIdGetResponse {
/// Found Editgroup
FoundEditgroup(models::Editgroup),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -131,9 +131,9 @@ pub enum EditgroupPostResponse {
/// Successfully Created
SuccessfullyCreated(models::Editgroup),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -141,9 +141,9 @@ pub enum EditorUsernameChangelogGetResponse {
/// Found Merged Changes
FoundMergedChanges(models::Changelogentry),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -151,9 +151,9 @@ pub enum EditorUsernameGetResponse {
/// Found Editor
FoundEditor(models::Editor),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -161,11 +161,11 @@ pub enum FileIdGetResponse {
/// Found Entity
FoundEntity(models::FileEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -173,11 +173,11 @@ pub enum FileLookupGetResponse {
/// Found Entity
FoundEntity(models::FileEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -185,11 +185,11 @@ pub enum FilePostResponse {
/// Created Entity
CreatedEntity(models::EntityEdit),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -197,11 +197,11 @@ pub enum ReleaseIdGetResponse {
/// Found Entity
FoundEntity(models::ReleaseEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -209,11 +209,11 @@ pub enum ReleaseLookupGetResponse {
/// Found Entity
FoundEntity(models::ReleaseEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -221,11 +221,11 @@ pub enum ReleasePostResponse {
/// Created Entity
CreatedEntity(models::EntityEdit),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -233,11 +233,11 @@ pub enum WorkIdGetResponse {
/// Found Entity
FoundEntity(models::WorkEntity),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
#[derive(Debug, PartialEq)]
@@ -245,11 +245,11 @@ pub enum WorkPostResponse {
/// Created Entity
CreatedEntity(models::EntityEdit),
/// Bad Request
- BadRequest(models::Error),
+ BadRequest(models::ErrorResponse),
/// Not Found
- NotFound(models::Error),
+ NotFound(models::ErrorResponse),
/// Generic Error
- GenericError(models::Error),
+ GenericError(models::ErrorResponse),
}
/// API
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index b6f450aa..2b187eaf 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -191,14 +191,14 @@ impl EntityEdit {
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
-pub struct Error {
+pub struct ErrorResponse {
#[serde(rename = "message")]
pub message: String,
}
-impl Error {
- pub fn new(message: String) -> Error {
- Error { message: message }
+impl ErrorResponse {
+ pub fn new(message: String) -> ErrorResponse {
+ ErrorResponse { message: message }
}
}