aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api')
-rw-r--r--rust/fatcat-api/README.md2
-rw-r--r--rust/fatcat-api/api.yaml28
-rw-r--r--rust/fatcat-api/api/swagger.yaml139
-rw-r--r--rust/fatcat-api/examples/client.rs2
-rw-r--r--rust/fatcat-api/src/models.rs30
5 files changed, 136 insertions, 65 deletions
diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md
index 94d9f29b..39037531 100644
--- a/rust/fatcat-api/README.md
+++ b/rust/fatcat-api/README.md
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
- API version: 0.1.0
-- Build date: 2018-05-17T06:58:26.208Z
+- Build date: 2018-05-24T01:24:11.840Z
This autogenerated project defines an API crate `fatcat` which contains:
* An `Api` trait defining the API in Rust.
diff --git a/rust/fatcat-api/api.yaml b/rust/fatcat-api/api.yaml
index 57902a56..0ecb0285 100644
--- a/rust/fatcat-api/api.yaml
+++ b/rust/fatcat-api/api.yaml
@@ -7,7 +7,7 @@ info:
version: 0.1.0
schemes: [http]
basePath: /v0
-host: api.fatcat.wiki
+#host: api.fatcat.wiki
consumes:
- application/json
produces:
@@ -22,22 +22,30 @@ x-entity-props: &ENTITYPROPS
ident:
type: string
#format: uuid
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: integer
+ example: 42
redirect:
type: string
#format: uuid
- editgroup:
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
+ editgroup_id:
type: integer
+ example: 16
x-entity-edit-props: &ENTITYEDITPROPS
edit_id:
type: integer
+ example: 847
ident:
type: string
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: integer
+ example: 42
editgroup_id:
type: integer
+ example: 16
definitions:
@@ -48,6 +56,7 @@ definitions:
properties:
message:
type: string
+ example: "A really confusing, totally unexpected thing happened"
success:
type: object
required:
@@ -55,6 +64,7 @@ definitions:
properties:
message:
type: string
+ example: "The computers did the thing successfully!"
creator_entity:
type: object
required:
@@ -63,9 +73,11 @@ definitions:
<<: *ENTITYPROPS
name:
type: string
+ example: "Grace Hopper"
orcid:
type: string
#format: custom
+ example: "0000-0002-1825-0097"
container_entity:
type: object
required:
@@ -74,23 +86,29 @@ definitions:
<<: *ENTITYPROPS
name:
type: string
+ example: "Journal of Important Results"
publisher:
type: string
+ example: "Society of Curious Students"
issn:
type: string
#format: custom
+ example: "1234-5678"
file_entity:
type: object
properties:
<<: *ENTITYPROPS
size:
type: integer
+ example: 1048576
sha1:
type: string
#format: custom
+ example: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
url:
type: string
format: url
+ example: "https://example.edu/~frau/prcding.pdf"
release_entity:
type: object
required:
@@ -102,21 +120,26 @@ definitions:
type: string
work_id:
type: string
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
container_id:
type: string
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
release_type:
type: string
+ example: "preprint"
date:
type: date
doi:
type: string
#format: custom
+ example: "10.1234/abcde.789"
volume:
type: string
pages:
type: string
issue:
type: string
+ example: "12"
work_entity:
type: object
properties:
@@ -134,6 +157,7 @@ definitions:
properties:
username:
type: string
+ example: "zerocool93"
editgroup:
type: object
required:
diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml
index 629e599b..f5391925 100644
--- a/rust/fatcat-api/api/swagger.yaml
+++ b/rust/fatcat-api/api/swagger.yaml
@@ -5,7 +5,6 @@ info:
\ and file metadata"
version: "0.1.0"
title: "fatcat"
-host: "api.fatcat.wiki"
basePath: "/v0"
schemes:
- "http"
@@ -1006,6 +1005,7 @@ definitions:
properties:
message:
type: "string"
+ example: "A really confusing, totally unexpected thing happened"
upperCaseName: "ERROR_RESPONSE"
success:
type: "object"
@@ -1014,8 +1014,9 @@ definitions:
properties:
message:
type: "string"
+ example: "The computers did the thing successfully!"
example:
- message: "message"
+ message: "The computers did the thing successfully!"
upperCaseName: "SUCCESS"
creator_entity:
type: "object"
@@ -1024,16 +1025,22 @@ definitions:
properties:
orcid:
type: "string"
+ example: "0000-0002-1825-0097"
name:
type: "string"
- editgroup:
+ example: "Grace Hopper"
+ editgroup_id:
type: "integer"
+ example: 16
redirect:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
revision:
type: "integer"
+ example: 42
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
state:
type: "string"
enum:
@@ -1042,13 +1049,13 @@ definitions:
- "redirect"
- "deleted"
example:
- redirect: "redirect"
- editgroup: 0
- ident: "ident"
- name: "name"
- orcid: "orcid"
+ redirect: "f1f046a3-45c9-4b99-adce-000000000002"
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
+ name: "Grace Hopper"
+ editgroup_id: 16
+ orcid: "0000-0002-1825-0097"
state: "wip"
- revision: 6
+ revision: 42
upperCaseName: "CREATOR_ENTITY"
container_entity:
type: "object"
@@ -1057,10 +1064,13 @@ definitions:
properties:
issn:
type: "string"
+ example: "1234-5678"
publisher:
type: "string"
+ example: "Society of Curious Students"
name:
type: "string"
+ example: "Journal of Important Results"
state:
type: "string"
enum:
@@ -1070,21 +1080,25 @@ definitions:
- "deleted"
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: "integer"
+ example: 42
redirect:
type: "string"
- editgroup:
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
+ editgroup_id:
type: "integer"
+ example: 16
example:
- redirect: "redirect"
- editgroup: 6
- issn: "issn"
- ident: "ident"
- name: "name"
- publisher: "publisher"
+ redirect: "f1f046a3-45c9-4b99-adce-000000000002"
+ issn: "1234-5678"
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
+ name: "Journal of Important Results"
+ publisher: "Society of Curious Students"
+ editgroup_id: 16
state: "wip"
- revision: 0
+ revision: 42
upperCaseName: "CONTAINER_ENTITY"
file_entity:
type: "object"
@@ -1092,18 +1106,25 @@ definitions:
url:
type: "string"
format: "url"
+ example: "https://example.edu/~frau/prcding.pdf"
sha1:
type: "string"
+ example: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
size:
type: "integer"
- editgroup:
+ example: 1048576
+ editgroup_id:
type: "integer"
+ example: 16
redirect:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
revision:
type: "integer"
+ example: 42
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
state:
type: "string"
enum:
@@ -1112,14 +1133,14 @@ definitions:
- "redirect"
- "deleted"
example:
- sha1: "sha1"
- redirect: "redirect"
- editgroup: 6
- size: 0
- ident: "ident"
+ sha1: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
+ redirect: "f1f046a3-45c9-4b99-adce-000000000002"
+ size: 1048576
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
+ editgroup_id: 16
state: "wip"
- url: "http://example.com/aeiou"
- revision: 1
+ url: "https://example.edu/~frau/prcding.pdf"
+ revision: 42
upperCaseName: "FILE_ENTITY"
release_entity:
type: "object"
@@ -1129,18 +1150,23 @@ definitions:
properties:
issue:
type: "string"
+ example: "12"
pages:
type: "string"
volume:
type: "string"
doi:
type: "string"
+ example: "10.1234/abcde.789"
release_type:
type: "string"
+ example: "preprint"
container_id:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
work_id:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
title:
type: "string"
state:
@@ -1152,40 +1178,48 @@ definitions:
- "deleted"
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: "integer"
+ example: 42
redirect:
type: "string"
- editgroup:
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
+ editgroup_id:
type: "integer"
+ example: 16
example:
- redirect: "redirect"
- work_id: "work_id"
- editgroup: 6
- issue: "issue"
- ident: "ident"
- release_type: "release_type"
+ redirect: "f1f046a3-45c9-4b99-adce-000000000002"
+ work_id: "f1f046a3-45c9-4b99-adce-000000000001"
+ issue: "12"
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
+ release_type: "preprint"
title: "title"
- revision: 0
+ revision: 42
volume: "volume"
pages: "pages"
+ editgroup_id: 16
state: "wip"
- container_id: "container_id"
- doi: "doi"
+ container_id: "f1f046a3-45c9-4b99-adce-000000000001"
+ doi: "10.1234/abcde.789"
upperCaseName: "RELEASE_ENTITY"
work_entity:
type: "object"
properties:
work_type:
type: "string"
- editgroup:
+ editgroup_id:
type: "integer"
+ example: 16
redirect:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
revision:
type: "integer"
+ example: 42
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
state:
type: "string"
enum:
@@ -1194,29 +1228,33 @@ definitions:
- "redirect"
- "deleted"
example:
- redirect: "redirect"
- editgroup: 0
- ident: "ident"
+ redirect: "f1f046a3-45c9-4b99-adce-000000000002"
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
work_type: "work_type"
+ editgroup_id: 16
state: "wip"
- revision: 6
+ revision: 42
upperCaseName: "WORK_ENTITY"
entity_edit:
type: "object"
properties:
editgroup_id:
type: "integer"
+ example: 16
revision:
type: "integer"
+ example: 42
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
edit_id:
type: "integer"
+ example: 847
example:
- ident: "ident"
- edit_id: 1
- editgroup_id: 0
- revision: 6
+ ident: "f1f046a3-45c9-4b99-adce-000000000001"
+ edit_id: 847
+ editgroup_id: 16
+ revision: 42
upperCaseName: "ENTITY_EDIT"
editor:
type: "object"
@@ -1225,8 +1263,9 @@ definitions:
properties:
username:
type: "string"
+ example: "zerocool93"
example:
- username: "username"
+ username: "zerocool93"
upperCaseName: "EDITOR"
editgroup:
type: "object"
@@ -1273,21 +1312,29 @@ x-entity-props:
- "deleted"
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: "integer"
+ example: 42
redirect:
type: "string"
- editgroup:
+ example: "f1f046a3-45c9-4b99-adce-000000000002"
+ editgroup_id:
type: "integer"
+ example: 16
x-entity-edit-props:
edit_id:
type: "integer"
+ example: 847
ident:
type: "string"
+ example: "f1f046a3-45c9-4b99-adce-000000000001"
revision:
type: "integer"
+ example: 42
editgroup_id:
type: "integer"
+ example: 16
x-entity-responses:
400:
description: "Bad Request"
diff --git a/rust/fatcat-api/examples/client.rs b/rust/fatcat-api/examples/client.rs
index b2edead6..a818a5c7 100644
--- a/rust/fatcat-api/examples/client.rs
+++ b/rust/fatcat-api/examples/client.rs
@@ -41,7 +41,7 @@ fn main() {
.index(1),
)
.arg(Arg::with_name("https").long("https").help("Whether to use HTTPS or not"))
- .arg(Arg::with_name("host").long("host").takes_value(true).default_value("api.fatcat.wiki").help("Hostname to contact"))
+ .arg(Arg::with_name("host").long("host").takes_value(true).default_value("localhost").help("Hostname to contact"))
.arg(Arg::with_name("port").long("port").takes_value(true).default_value("8080").help("Port to contact"))
.get_matches();
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index 24c7ad34..784068e3 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -121,9 +121,9 @@ pub struct ContainerEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub redirect: Option<String>,
- #[serde(rename = "editgroup")]
+ #[serde(rename = "editgroup_id")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub editgroup: Option<isize>,
+ pub editgroup_id: Option<isize>,
}
impl ContainerEntity {
@@ -136,7 +136,7 @@ impl ContainerEntity {
ident: None,
revision: None,
redirect: None,
- editgroup: None,
+ editgroup_id: None,
}
}
}
@@ -150,9 +150,9 @@ pub struct CreatorEntity {
#[serde(rename = "name")]
pub name: String,
- #[serde(rename = "editgroup")]
+ #[serde(rename = "editgroup_id")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub editgroup: Option<isize>,
+ pub editgroup_id: Option<isize>,
#[serde(rename = "redirect")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -177,7 +177,7 @@ impl CreatorEntity {
CreatorEntity {
orcid: None,
name: name,
- editgroup: None,
+ editgroup_id: None,
redirect: None,
revision: None,
ident: None,
@@ -278,9 +278,9 @@ pub struct FileEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<isize>,
- #[serde(rename = "editgroup")]
+ #[serde(rename = "editgroup_id")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub editgroup: Option<isize>,
+ pub editgroup_id: Option<isize>,
#[serde(rename = "redirect")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -306,7 +306,7 @@ impl FileEntity {
url: None,
sha1: None,
size: None,
- editgroup: None,
+ editgroup_id: None,
redirect: None,
revision: None,
ident: None,
@@ -364,9 +364,9 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub redirect: Option<String>,
- #[serde(rename = "editgroup")]
+ #[serde(rename = "editgroup_id")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub editgroup: Option<isize>,
+ pub editgroup_id: Option<isize>,
}
impl ReleaseEntity {
@@ -384,7 +384,7 @@ impl ReleaseEntity {
ident: None,
revision: None,
redirect: None,
- editgroup: None,
+ editgroup_id: None,
}
}
}
@@ -407,9 +407,9 @@ pub struct WorkEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub work_type: Option<String>,
- #[serde(rename = "editgroup")]
+ #[serde(rename = "editgroup_id")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub editgroup: Option<isize>,
+ pub editgroup_id: Option<isize>,
#[serde(rename = "redirect")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -433,7 +433,7 @@ impl WorkEntity {
pub fn new() -> WorkEntity {
WorkEntity {
work_type: None,
- editgroup: None,
+ editgroup_id: None,
redirect: None,
revision: None,
ident: None,