diff options
Diffstat (limited to 'rust/fatcat-api')
-rw-r--r-- | rust/fatcat-api/README.md | 2 | ||||
-rw-r--r-- | rust/fatcat-api/api.yaml | 96 | ||||
-rw-r--r-- | rust/fatcat-api/api/swagger.yaml | 175 | ||||
-rw-r--r-- | rust/fatcat-api/src/models.rs | 107 |
4 files changed, 339 insertions, 41 deletions
diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md index 48c3aeeb..98eb45fe 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-25T05:25:40.149Z +- Build date: 2018-05-25T20:55:51.247Z 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 14c94f35..30e0f44d 100644 --- a/rust/fatcat-api/api.yaml +++ b/rust/fatcat-api/api.yaml @@ -152,6 +152,16 @@ definitions: issue: type: string example: "12" + contribs: + type: array + items: + type: string + #$ref: "#/definitions/release_contrib" + refs: + type: array + items: + type: string + #$ref: "#/definitions/release_ref" work_entity: type: object properties: @@ -186,45 +196,29 @@ definitions: extra: type: object additionalProperties: {} -# container_edits: -# type: array -# item: -# type: integer -# format: int64 -# properties: -# edit_id: -# type: integer -# example: 847 -# format: int64 -# type: array -# items: -# type: object -# proposeties: -# <<: *ENTITYEDITPROPS -# creators: -# type: array -# items: -# type: object -# proposeties: -# <<: *ENTITYEDITPROPS -# files: -# type: array -# items: -# type: object -# proposeties: -# <<: *ENTITYEDITPROPS -# releases: -# type: array -# items: -# type: object -# proposeties: -# <<: *ENTITYEDITPROPS -# works: -# type: array -# items: -# type: object -# proposeties: -# <<: *ENTITYEDITPROPS + edits: + type: object + properties: + containers: + type: array + items: + $ref: "#/definitions/entity_edit" + creators: + type: array + items: + $ref: "#/definitions/entity_edit" + files: + type: array + items: + $ref: "#/definitions/entity_edit" + releases: + type: array + items: + $ref: "#/definitions/entity_edit" + works: + type: array + items: + $ref: "#/definitions/entity_edit" changelogentries: type: array items: @@ -243,6 +237,30 @@ definitions: timestamp: type: string format: date-time + release_ref: + type: object + properties: + index: + type: integer + format: int64 + target_release_id: + type: string + #format: uuid + stub: + type: string + release_contrib: + type: object + properties: + index: + type: integer + format: int64 + creator_id: + type: string + #format: uuid + creator_stub: + type: string + contrib_type: + type: string x-entity-responses: &ENTITYRESPONSES 400: diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml index 993df05c..f173c53d 100644 --- a/rust/fatcat-api/api/swagger.yaml +++ b/rust/fatcat-api/api/swagger.yaml @@ -1166,6 +1166,14 @@ definitions: - "title" - "work_id" properties: + refs: + type: "array" + items: + type: "string" + contribs: + type: "array" + items: + type: "string" issue: type: "string" example: "12" @@ -1217,9 +1225,15 @@ definitions: ident: "f1f046a3-45c9-4b99-adce-000000000001" release_type: "preprint" title: "title" + contribs: + - "contribs" + - "contribs" revision: 42 volume: "volume" pages: "pages" + refs: + - "refs" + - "refs" extra: "{}" editgroup_id: 16 state: "wip" @@ -1316,8 +1330,66 @@ definitions: type: "string" extra: type: "object" + edits: + $ref: "#/definitions/editgroup_edits" example: extra: "{}" + edits: + works: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + creators: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + files: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + containers: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + releases: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 description: "description" editor_id: 6 id: 0 @@ -1327,6 +1399,109 @@ definitions: items: $ref: "#/definitions/changelogentries_inner" upperCaseName: "CHANGELOGENTRIES" + release_ref: + type: "object" + properties: + index: + type: "integer" + format: "int64" + target_release_id: + type: "string" + stub: + type: "string" + upperCaseName: "RELEASE_REF" + release_contrib: + type: "object" + properties: + index: + type: "integer" + format: "int64" + creator_id: + type: "string" + creator_stub: + type: "string" + contrib_type: + type: "string" + upperCaseName: "RELEASE_CONTRIB" + editgroup_edits: + properties: + containers: + type: "array" + items: + $ref: "#/definitions/entity_edit" + creators: + type: "array" + items: + $ref: "#/definitions/entity_edit" + files: + type: "array" + items: + $ref: "#/definitions/entity_edit" + releases: + type: "array" + items: + $ref: "#/definitions/entity_edit" + works: + type: "array" + items: + $ref: "#/definitions/entity_edit" + example: + works: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + creators: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + files: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + containers: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + releases: + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + - ident: "f1f046a3-45c9-4b99-adce-000000000001" + extra: "{}" + edit_id: 847 + editgroup_id: 16 + revision: 42 + upperCaseName: "EDITGROUP_EDITS" changelogentries_inner: required: - "editgroup_id" diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index 6c13e091..5118872f 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -1,7 +1,7 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; extern crate serde_json; +extern crate uuid; use serde::ser::Serializer; @@ -213,6 +213,10 @@ pub struct Editgroup { #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] pub extra: Option<serde_json::Value>, + + #[serde(rename = "edits")] + #[serde(skip_serializing_if = "Option::is_none")] + pub edits: Option<models::EditgroupEdits>, } impl Editgroup { @@ -222,6 +226,42 @@ impl Editgroup { editor_id: editor_id, description: None, extra: None, + edits: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct EditgroupEdits { + #[serde(rename = "containers")] + #[serde(skip_serializing_if = "Option::is_none")] + pub containers: Option<Vec<models::EntityEdit>>, + + #[serde(rename = "creators")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creators: Option<Vec<models::EntityEdit>>, + + #[serde(rename = "files")] + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<Vec<models::EntityEdit>>, + + #[serde(rename = "releases")] + #[serde(skip_serializing_if = "Option::is_none")] + pub releases: Option<Vec<models::EntityEdit>>, + + #[serde(rename = "works")] + #[serde(skip_serializing_if = "Option::is_none")] + pub works: Option<Vec<models::EntityEdit>>, +} + +impl EditgroupEdits { + pub fn new() -> EditgroupEdits { + EditgroupEdits { + containers: None, + creators: None, + files: None, + releases: None, + works: None, } } } @@ -342,7 +382,45 @@ impl FileEntity { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ReleaseContrib { + #[serde(rename = "index")] + #[serde(skip_serializing_if = "Option::is_none")] + pub index: Option<i64>, + + #[serde(rename = "creator_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creator_id: Option<String>, + + #[serde(rename = "creator_stub")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creator_stub: Option<String>, + + #[serde(rename = "contrib_type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub contrib_type: Option<String>, +} + +impl ReleaseContrib { + pub fn new() -> ReleaseContrib { + ReleaseContrib { + index: None, + creator_id: None, + creator_stub: None, + contrib_type: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ReleaseEntity { + #[serde(rename = "refs")] + #[serde(skip_serializing_if = "Option::is_none")] + pub refs: Option<Vec<String>>, + + #[serde(rename = "contribs")] + #[serde(skip_serializing_if = "Option::is_none")] + pub contribs: Option<Vec<String>>, + #[serde(rename = "issue")] #[serde(skip_serializing_if = "Option::is_none")] pub issue: Option<String>, @@ -402,6 +480,8 @@ pub struct ReleaseEntity { impl ReleaseEntity { pub fn new(work_id: String, title: String) -> ReleaseEntity { ReleaseEntity { + refs: None, + contribs: None, issue: None, pages: None, volume: None, @@ -421,6 +501,31 @@ impl ReleaseEntity { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ReleaseRef { + #[serde(rename = "index")] + #[serde(skip_serializing_if = "Option::is_none")] + pub index: Option<i64>, + + #[serde(rename = "target_release_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub target_release_id: Option<String>, + + #[serde(rename = "stub")] + #[serde(skip_serializing_if = "Option::is_none")] + pub stub: Option<String>, +} + +impl ReleaseRef { + pub fn new() -> ReleaseRef { + ReleaseRef { + index: None, + target_release_id: None, + stub: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Success { #[serde(rename = "message")] pub message: String, |