aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api-spec')
-rw-r--r--rust/fatcat-api-spec/README.md2
-rw-r--r--rust/fatcat-api-spec/api.yaml103
-rw-r--r--rust/fatcat-api-spec/api/swagger.yaml168
-rw-r--r--rust/fatcat-api-spec/examples/client.rs72
-rw-r--r--rust/fatcat-api-spec/examples/server_lib/server.rs48
-rw-r--r--rust/fatcat-api-spec/src/client.rs78
-rw-r--r--rust/fatcat-api-spec/src/lib.rs93
-rw-r--r--rust/fatcat-api-spec/src/models.rs62
-rw-r--r--rust/fatcat-api-spec/src/server.rs240
9 files changed, 739 insertions, 127 deletions
diff --git a/rust/fatcat-api-spec/README.md b/rust/fatcat-api-spec/README.md
index ee031f66..cacded6a 100644
--- a/rust/fatcat-api-spec/README.md
+++ b/rust/fatcat-api-spec/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: 2019-01-11T23:46:50.303Z
+- Build date: 2019-01-23T05:30:23.378Z
This autogenerated project defines an API crate `fatcat` which contains:
* An `Api` trait defining the API in Rust.
diff --git a/rust/fatcat-api-spec/api.yaml b/rust/fatcat-api-spec/api.yaml
index 70a27b76..14b70c39 100644
--- a/rust/fatcat-api-spec/api.yaml
+++ b/rust/fatcat-api-spec/api.yaml
@@ -26,6 +26,10 @@ tags: # TAGLINE
descriptions: "Creator entities: such as authors" # TAGLINE
- name: files # TAGLINE
descriptions: "File entities" # TAGLINE
+ - name: filesets # TAGLINE
+ descriptions: "Fileset entities" # TAGLINE
+ - name: webcaptures # TAGLINE
+ descriptions: "Webcapture entities" # TAGLINE
- name: releases # TAGLINE
descriptions: "Release entities: individual articles, pre-prints, books" # TAGLINE
- name: works # TAGLINE
@@ -132,6 +136,9 @@ definitions:
type: string
example: "Journal of Important Results"
description: "Required for valid entities"
+ container_type:
+ type: string
+ description: "Eg, 'journal'"
publisher:
type: string
example: "Society of Curious Students"
@@ -139,10 +146,6 @@ definitions:
<<: *FATCATISSN
wikidata_qid:
type: string
- abbrev:
- type: string
- coden:
- type: string
creator_entity:
type: object
# required for creation: display_name
@@ -249,7 +252,7 @@ definitions:
properties:
<<: *ENTITYPROPS
cdx:
- # limit of 200 CDX lines, at least to start
+ # limit of 200 CDX lines, at least to start?
type: array
items:
type: object
@@ -264,7 +267,9 @@ definitions:
example: "org,asheesh)/apus/ch1/node15.html"
timestamp:
type: string
- example: "20020429162520"
+ format: date-time
+ example: "2016-09-19T17:20:24Z"
+ description: "UTC, 'Z'-terminated, second (or better) precision"
url:
type: string
# NOTE: not format:url to allow alternatives
@@ -302,6 +307,7 @@ definitions:
timestamp:
type: string
format: date-time
+ description: "same format as CDX line timestamp (UTC, etc). Corresponds to the overall capture timestamp. Can be the earliest or average of CDX timestamps if that makes sense."
release_ids:
type: array
items:
@@ -313,7 +319,10 @@ definitions:
<<: *ENTITYPROPS
title:
type: string
- description: "Required for valid entities"
+ description: "Required for valid entities. The title used in citations and for display; usually English"
+ original_title:
+ type: string
+ description: "Title in original language (or, the language of the full text of this release)"
work_id:
type: string
example: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -343,7 +352,7 @@ definitions:
example: "book"
release_status:
type: string
- example: "preprint"
+ example: "preprint, retracted"
release_date:
type: string
format: date
@@ -367,6 +376,10 @@ definitions:
core_id:
type: string
#format: custom
+ arxiv_id:
+ type: string
+ jstor_id:
+ type: string
volume:
type: string
issue:
@@ -379,6 +392,9 @@ definitions:
language:
description: "Two-letter RFC1766/ISO639-1 language code, with extensions"
type: string
+ license_slug:
+ type: string
+ description: "Short version of license name. Eg, 'CC-BY'"
contribs:
type: array
items:
@@ -588,11 +604,14 @@ definitions:
description: "Optional; GET-only"
raw_name:
type: string
+ role:
+ type: string
+ raw_affiliation:
+ type: string
+ description: "Raw affiliation string as displayed in text"
extra:
type: object
additionalProperties: {}
- role:
- type: string
auth_oidc:
type: object
required:
@@ -687,6 +706,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -945,6 +972,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -1226,6 +1261,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -1489,6 +1532,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -1718,6 +1769,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -1947,6 +2006,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
@@ -2201,6 +2268,14 @@ paths:
in: query
type: string
required: false
+ - name: arxiv_id
+ in: query
+ type: string
+ required: false
+ - name: jstor_id
+ in: query
+ type: string
+ required: false
- name: expand
in: query
type: string
@@ -2291,6 +2366,14 @@ paths:
type: string
required: false
description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
+ - name: description
+ in: query
+ type: string
+ required: false
+ - name: extra
+ in: query
+ type: string
+ required: false
- name: entity_list
in: body
required: true
diff --git a/rust/fatcat-api-spec/api/swagger.yaml b/rust/fatcat-api-spec/api/swagger.yaml
index 7a1c2755..927bb941 100644
--- a/rust/fatcat-api-spec/api/swagger.yaml
+++ b/rust/fatcat-api-spec/api/swagger.yaml
@@ -11,6 +11,8 @@ tags:
- name: "containers"
- name: "creators"
- name: "files"
+- name: "filesets"
+- name: "webcaptures"
- name: "releases"
- name: "works"
- name: "edit-lifecycle"
@@ -133,6 +135,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -979,6 +993,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -1889,6 +1915,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -2748,6 +2786,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -3517,6 +3567,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -4286,6 +4348,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -5039,6 +5113,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"core_id_example\".to_string())"
+ - name: "arxiv_id"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"arxiv_id_example\".to_string())"
+ - name: "jstor_id"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"jstor_id_example\".to_string())"
- name: "expand"
in: "query"
description: "List of sub-entities to expand in response."
@@ -5346,6 +5432,18 @@ paths:
type: "string"
formatString: "{:?}"
example: "Some(\"editgroup_id_example\".to_string())"
+ - name: "description"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"description_example\".to_string())"
+ - name: "extra"
+ in: "query"
+ required: false
+ type: "string"
+ formatString: "{:?}"
+ example: "Some(\"extra_example\".to_string())"
- in: "body"
name: "entity_list"
required: true
@@ -7273,10 +7371,6 @@ definitions:
container_entity:
type: "object"
properties:
- coden:
- type: "string"
- abbrev:
- type: "string"
wikidata_qid:
type: "string"
issnl:
@@ -7288,6 +7382,9 @@ definitions:
publisher:
type: "string"
example: "Society of Curious Students"
+ container_type:
+ type: "string"
+ description: "Eg, 'journal'"
name:
type: "string"
example: "Journal of Important Results"
@@ -7326,13 +7423,12 @@ definitions:
- "deleted"
example:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
- coden: "coden"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
+ container_type: "container_type"
name: "Journal of Important Results"
publisher: "Society of Curious Students"
issnl: "1234-5678"
- abbrev: "abbrev"
wikidata_qid: "wikidata_qid"
state: "wip"
edit_extra: "{}"
@@ -7592,6 +7688,9 @@ definitions:
timestamp:
type: "string"
format: "date-time"
+ description: "same format as CDX line timestamp (UTC, etc). Corresponds to\
+ \ the overall capture timestamp. Can be the earliest or average of CDX timestamps\
+ \ if that makes sense."
original_url:
type: "string"
format: "url"
@@ -7651,14 +7750,14 @@ definitions:
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
- sha1: "e9dd75237c94b209dc3ccd52722de6931a310ba3"
surt: "org,asheesh)/apus/ch1/node15.html"
status_code: 200
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
state: "wip"
@@ -7684,6 +7783,9 @@ definitions:
type: "array"
items:
$ref: "#/definitions/release_contrib"
+ license_slug:
+ type: "string"
+ description: "Short version of license name. Eg, 'CC-BY'"
language:
type: "string"
description: "Two-letter RFC1766/ISO639-1 language code, with extensions"
@@ -7696,6 +7798,10 @@ definitions:
example: "12"
volume:
type: "string"
+ jstor_id:
+ type: "string"
+ arxiv_id:
+ type: "string"
core_id:
type: "string"
pmcid:
@@ -7718,7 +7824,7 @@ definitions:
format: "date"
release_status:
type: "string"
- example: "preprint"
+ example: "preprint, retracted"
release_type:
type: "string"
example: "book"
@@ -7746,9 +7852,14 @@ definitions:
work_id:
type: "string"
example: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ original_title:
+ type: "string"
+ description: "Title in original language (or, the language of the full text\
+ \ of this release)"
title:
type: "string"
- description: "Required for valid entities"
+ description: "Required for valid entities. The title used in citations and\
+ \ for display; usually English"
state:
type: "string"
enum:
@@ -7784,13 +7895,12 @@ definitions:
example:
container:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
- coden: "coden"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
+ container_type: "container_type"
name: "Journal of Important Results"
publisher: "Society of Curious Students"
issnl: "1234-5678"
- abbrev: "abbrev"
wikidata_qid: "wikidata_qid"
state: "wip"
edit_extra: "{}"
@@ -7810,14 +7920,14 @@ definitions:
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
- sha1: "e9dd75237c94b209dc3ccd52722de6931a310ba3"
surt: "org,asheesh)/apus/ch1/node15.html"
status_code: 200
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
state: "wip"
@@ -7841,14 +7951,14 @@ definitions:
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
- sha1: "e9dd75237c94b209dc3ccd52722de6931a310ba3"
surt: "org,asheesh)/apus/ch1/node15.html"
status_code: 200
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
state: "wip"
@@ -7862,7 +7972,8 @@ definitions:
language: "language"
title: "title"
contribs:
- - creator:
+ - raw_affiliation: "raw_affiliation"
+ creator:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
surname: "surname"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -7879,7 +7990,8 @@ definitions:
extra: "{}"
creator_id: "creator_id"
index: 1
- - creator:
+ - raw_affiliation: "raw_affiliation"
+ creator:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
surname: "surname"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -7901,9 +8013,11 @@ definitions:
extra: "{}"
state: "wip"
edit_extra: "{}"
+ jstor_id: "jstor_id"
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
work_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
issue: "12"
+ original_title: "original_title"
abstracts:
- sha1: "e9dd75237c94b209dc3ccd52722de6931a310ba3"
mimetype: "application/xml+jats"
@@ -7917,9 +8031,10 @@ definitions:
release_type: "book"
wikidata_qid: "wikidata_qid"
pmid: "pmid"
- release_status: "preprint"
+ release_status: "preprint, retracted"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
volume: "volume"
+ license_slug: "license_slug"
refs:
- target_release_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
container_name: "container_name"
@@ -7979,6 +8094,7 @@ definitions:
- "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_extra: "{}"
md5: "1b39813549077b2347c0f370c3864b40"
+ arxiv_id: "arxiv_id"
filesets:
- redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
urls:
@@ -8929,11 +9045,15 @@ definitions:
$ref: "#/definitions/creator_entity"
raw_name:
type: "string"
- extra:
- type: "object"
role:
type: "string"
+ raw_affiliation:
+ type: "string"
+ description: "Raw affiliation string as displayed in text"
+ extra:
+ type: "object"
example:
+ raw_affiliation: "raw_affiliation"
creator:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
surname: "surname"
@@ -9072,7 +9192,9 @@ definitions:
example: "org,asheesh)/apus/ch1/node15.html"
timestamp:
type: "string"
- example: "20020429162520"
+ format: "date-time"
+ example: "2016-09-19T17:20:24Z"
+ description: "UTC, 'Z'-terminated, second (or better) precision"
url:
type: "string"
example: "http://www.asheesh.org:80/APUS/ch1/node15.html"
@@ -9102,7 +9224,7 @@ definitions:
sha256: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
mimetype: "text/html"
url: "http://www.asheesh.org:80/APUS/ch1/node15.html"
- timestamp: "20020429162520"
+ timestamp: "2016-09-19T17:20:24Z"
upperCaseName: "WEBCAPTURE_ENTITY_CDX"
release_entity_abstracts:
properties:
diff --git a/rust/fatcat-api-spec/examples/client.rs b/rust/fatcat-api-spec/examples/client.rs
index b4d90719..40a5a3ab 100644
--- a/rust/fatcat-api-spec/examples/client.rs
+++ b/rust/fatcat-api-spec/examples/client.rs
@@ -144,7 +144,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateContainerBatch") => {
- let result = client.create_container_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_container_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -211,7 +219,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateCreatorBatch") => {
- let result = client.create_creator_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_creator_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -359,7 +375,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateFileBatch") => {
- let result = client.create_file_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_file_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -427,7 +451,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateFilesetBatch") => {
- let result = client.create_fileset_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_fileset_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -482,7 +514,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateReleaseBatch") => {
- let result = client.create_release_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_release_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -554,6 +594,8 @@ fn main() {
Some("pmid_example".to_string()),
Some("pmcid_example".to_string()),
Some("core_id_example".to_string()),
+ Some("arxiv_id_example".to_string()),
+ Some("jstor_id_example".to_string()),
Some("expand_example".to_string()),
Some("hide_example".to_string()),
)
@@ -573,7 +615,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateWebcaptureBatch") => {
- let result = client.create_webcapture_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_webcapture_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -622,7 +672,15 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateWorkBatch") => {
- let result = client.create_work_batch(&Vec::new(), Some(true), Some("editgroup_id_example".to_string())).wait();
+ let result = client
+ .create_work_batch(
+ &Vec::new(),
+ Some(true),
+ Some("editgroup_id_example".to_string()),
+ Some("description_example".to_string()),
+ Some("extra_example".to_string()),
+ )
+ .wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
diff --git a/rust/fatcat-api-spec/examples/server_lib/server.rs b/rust/fatcat-api-spec/examples/server_lib/server.rs
index 3c37106a..98f31485 100644
--- a/rust/fatcat-api-spec/examples/server_lib/server.rs
+++ b/rust/fatcat-api-spec/examples/server_lib/server.rs
@@ -46,14 +46,18 @@ impl Api for Server {
entity_list: &Vec<models::ContainerEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_container_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_container_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -171,14 +175,18 @@ impl Api for Server {
entity_list: &Vec<models::CreatorEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_creator_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_creator_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -465,14 +473,18 @@ impl Api for Server {
entity_list: &Vec<models::FileEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_file_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_file_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -592,14 +604,18 @@ impl Api for Server {
entity_list: &Vec<models::FilesetEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_fileset_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_fileset_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -697,14 +713,18 @@ impl Api for Server {
entity_list: &Vec<models::ReleaseEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_release_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_release_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -826,19 +846,23 @@ impl Api for Server {
pmid: Option<String>,
pmcid: Option<String>,
core_id: Option<String>,
+ arxiv_id: Option<String>,
+ jstor_id: Option<String>,
expand: Option<String>,
hide: Option<String>,
context: &Context,
) -> Box<Future<Item = LookupReleaseResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "lookup_release({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "lookup_release({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
doi,
wikidata_qid,
isbn13,
pmid,
pmcid,
core_id,
+ arxiv_id,
+ jstor_id,
expand,
hide,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
@@ -874,14 +898,18 @@ impl Api for Server {
entity_list: &Vec<models::WebcaptureEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_webcapture_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_webcapture_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -968,14 +996,18 @@ impl Api for Server {
entity_list: &Vec<models::WorkEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_work_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_work_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs
index a3e97fb3..6d654146 100644
--- a/rust/fatcat-api-spec/src/client.rs
+++ b/rust/fatcat-api-spec/src/client.rs
@@ -272,17 +272,23 @@ impl Api for Client {
param_entity_list: &Vec<models::ContainerEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/container/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/container/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -1167,17 +1173,23 @@ impl Api for Client {
param_entity_list: &Vec<models::CreatorEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/creator/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/creator/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -3364,17 +3376,23 @@ impl Api for Client {
param_entity_list: &Vec<models::FileEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/file/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/file/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -4256,17 +4274,23 @@ impl Api for Client {
param_entity_list: &Vec<models::FilesetEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/fileset/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/fileset/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -5071,17 +5095,23 @@ impl Api for Client {
param_entity_list: &Vec<models::ReleaseEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/release/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/release/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -5988,6 +6018,8 @@ impl Api for Client {
param_pmid: Option<String>,
param_pmcid: Option<String>,
param_core_id: Option<String>,
+ param_arxiv_id: Option<String>,
+ param_jstor_id: Option<String>,
param_expand: Option<String>,
param_hide: Option<String>,
context: &Context,
@@ -5999,11 +6031,13 @@ impl Api for Client {
let query_pmid = param_pmid.map_or_else(String::new, |query| format!("pmid={pmid}&", pmid = query.to_string()));
let query_pmcid = param_pmcid.map_or_else(String::new, |query| format!("pmcid={pmcid}&", pmcid = query.to_string()));
let query_core_id = param_core_id.map_or_else(String::new, |query| format!("core_id={core_id}&", core_id = query.to_string()));
+ let query_arxiv_id = param_arxiv_id.map_or_else(String::new, |query| format!("arxiv_id={arxiv_id}&", arxiv_id = query.to_string()));
+ let query_jstor_id = param_jstor_id.map_or_else(String::new, |query| format!("jstor_id={jstor_id}&", jstor_id = query.to_string()));
let query_expand = param_expand.map_or_else(String::new, |query| format!("expand={expand}&", expand = query.to_string()));
let query_hide = param_hide.map_or_else(String::new, |query| format!("hide={hide}&", hide = query.to_string()));
let url = format!(
- "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core_id}{expand}{hide}",
+ "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core_id}{arxiv_id}{jstor_id}{expand}{hide}",
self.base_path,
doi = utf8_percent_encode(&query_doi, QUERY_ENCODE_SET),
wikidata_qid = utf8_percent_encode(&query_wikidata_qid, QUERY_ENCODE_SET),
@@ -6011,6 +6045,8 @@ impl Api for Client {
pmid = utf8_percent_encode(&query_pmid, QUERY_ENCODE_SET),
pmcid = utf8_percent_encode(&query_pmcid, QUERY_ENCODE_SET),
core_id = utf8_percent_encode(&query_core_id, QUERY_ENCODE_SET),
+ arxiv_id = utf8_percent_encode(&query_arxiv_id, QUERY_ENCODE_SET),
+ jstor_id = utf8_percent_encode(&query_jstor_id, QUERY_ENCODE_SET),
expand = utf8_percent_encode(&query_expand, QUERY_ENCODE_SET),
hide = utf8_percent_encode(&query_hide, QUERY_ENCODE_SET)
);
@@ -6272,17 +6308,23 @@ impl Api for Client {
param_entity_list: &Vec<models::WebcaptureEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/webcapture/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/webcapture/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
@@ -6993,17 +7035,23 @@ impl Api for Client {
param_entity_list: &Vec<models::WorkEntity>,
param_autoaccept: Option<bool>,
param_editgroup_id: Option<String>,
+ param_description: Option<String>,
+ param_extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
// Query parameters
let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string()));
let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string()));
+ let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string()));
+ let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string()));
let url = format!(
- "{}/v0/work/batch?{autoaccept}{editgroup_id}",
+ "{}/v0/work/batch?{autoaccept}{editgroup_id}{description}{extra}",
self.base_path,
autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET),
- editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET)
+ editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET),
+ description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET),
+ extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET)
);
let body = serde_json::to_string(&param_entity_list).expect("impossible to fail to serialize");
diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs
index 9585f1c0..59129869 100644
--- a/rust/fatcat-api-spec/src/lib.rs
+++ b/rust/fatcat-api-spec/src/lib.rs
@@ -1345,6 +1345,8 @@ pub trait Api {
entity_list: &Vec<models::ContainerEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send>;
@@ -1380,6 +1382,8 @@ pub trait Api {
entity_list: &Vec<models::CreatorEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send>;
@@ -1473,6 +1477,8 @@ pub trait Api {
entity_list: &Vec<models::FileEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>;
@@ -1509,6 +1515,8 @@ pub trait Api {
entity_list: &Vec<models::FilesetEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send>;
@@ -1535,6 +1543,8 @@ pub trait Api {
entity_list: &Vec<models::ReleaseEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send>;
@@ -1568,6 +1578,8 @@ pub trait Api {
pmid: Option<String>,
pmcid: Option<String>,
core_id: Option<String>,
+ arxiv_id: Option<String>,
+ jstor_id: Option<String>,
expand: Option<String>,
hide: Option<String>,
context: &Context,
@@ -1582,6 +1594,8 @@ pub trait Api {
entity_list: &Vec<models::WebcaptureEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send>;
@@ -1606,6 +1620,8 @@ pub trait Api {
entity_list: &Vec<models::WorkEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>;
@@ -1637,6 +1653,8 @@ pub trait ApiNoContext {
entity_list: &Vec<models::ContainerEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send>;
fn delete_container(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteContainerResponse, Error = ApiError> + Send>;
@@ -1670,6 +1688,8 @@ pub trait ApiNoContext {
entity_list: &Vec<models::CreatorEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send>;
fn delete_creator(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteCreatorResponse, Error = ApiError> + Send>;
@@ -1742,7 +1762,14 @@ pub trait ApiNoContext {
fn create_file(&self, entity: models::FileEntity, editgroup_id: String) -> Box<Future<Item = CreateFileResponse, Error = ApiError> + Send>;
- fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>;
+ fn create_file_batch(
+ &self,
+ entity_list: &Vec<models::FileEntity>,
+ autoaccept: Option<bool>,
+ editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
+ ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>;
fn delete_file(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFileResponse, Error = ApiError> + Send>;
@@ -1776,6 +1803,8 @@ pub trait ApiNoContext {
entity_list: &Vec<models::FilesetEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send>;
fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFilesetResponse, Error = ApiError> + Send>;
@@ -1801,6 +1830,8 @@ pub trait ApiNoContext {
entity_list: &Vec<models::ReleaseEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send>;
fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box<Future<Item = CreateWorkResponse, Error = ApiError> + Send>;
@@ -1833,6 +1864,8 @@ pub trait ApiNoContext {
pmid: Option<String>,
pmcid: Option<String>,
core_id: Option<String>,
+ arxiv_id: Option<String>,
+ jstor_id: Option<String>,
expand: Option<String>,
hide: Option<String>,
) -> Box<Future<Item = LookupReleaseResponse, Error = ApiError> + Send>;
@@ -1846,6 +1879,8 @@ pub trait ApiNoContext {
entity_list: &Vec<models::WebcaptureEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send>;
fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWebcaptureResponse, Error = ApiError> + Send>;
@@ -1864,7 +1899,14 @@ pub trait ApiNoContext {
fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String) -> Box<Future<Item = UpdateWebcaptureResponse, Error = ApiError> + Send>;
- fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>;
+ fn create_work_batch(
+ &self,
+ entity_list: &Vec<models::WorkEntity>,
+ autoaccept: Option<bool>,
+ editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
+ ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>;
fn delete_work(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWorkResponse, Error = ApiError> + Send>;
@@ -1910,8 +1952,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
entity_list: &Vec<models::ContainerEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> {
- self.api().create_container_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ self.api().create_container_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_container(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteContainerResponse, Error = ApiError> + Send> {
@@ -1965,8 +2009,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
entity_list: &Vec<models::CreatorEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
- self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_creator(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteCreatorResponse, Error = ApiError> + Send> {
@@ -2091,8 +2137,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
self.api().create_file(entity, editgroup_id, &self.context())
}
- fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
- self.api().create_file_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ fn create_file_batch(
+ &self,
+ entity_list: &Vec<models::FileEntity>,
+ autoaccept: Option<bool>,
+ editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
+ ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
+ self.api().create_file_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_file(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFileResponse, Error = ApiError> + Send> {
@@ -2147,8 +2200,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
entity_list: &Vec<models::FilesetEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> {
- self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFilesetResponse, Error = ApiError> + Send> {
@@ -2192,8 +2247,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
entity_list: &Vec<models::ReleaseEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
- self.api().create_release_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ self.api().create_release_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box<Future<Item = CreateWorkResponse, Error = ApiError> + Send> {
@@ -2248,10 +2305,13 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
pmid: Option<String>,
pmcid: Option<String>,
core_id: Option<String>,
+ arxiv_id: Option<String>,
+ jstor_id: Option<String>,
expand: Option<String>,
hide: Option<String>,
) -> Box<Future<Item = LookupReleaseResponse, Error = ApiError> + Send> {
- self.api().lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core_id, expand, hide, &self.context())
+ self.api()
+ .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core_id, arxiv_id, jstor_id, expand, hide, &self.context())
}
fn update_release(&self, ident: String, entity: models::ReleaseEntity, editgroup_id: String) -> Box<Future<Item = UpdateReleaseResponse, Error = ApiError> + Send> {
@@ -2267,8 +2327,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
entity_list: &Vec<models::WebcaptureEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> {
- self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWebcaptureResponse, Error = ApiError> + Send> {
@@ -2303,8 +2365,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
self.api().update_webcapture(ident, entity, editgroup_id, &self.context())
}
- fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
- self.api().create_work_batch(entity_list, autoaccept, editgroup_id, &self.context())
+ fn create_work_batch(
+ &self,
+ entity_list: &Vec<models::WorkEntity>,
+ autoaccept: Option<bool>,
+ editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
+ ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
+ self.api().create_work_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context())
}
fn delete_work(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWorkResponse, Error = ApiError> + Send> {
diff --git a/rust/fatcat-api-spec/src/models.rs b/rust/fatcat-api-spec/src/models.rs
index 5d05b737..d6e6e07f 100644
--- a/rust/fatcat-api-spec/src/models.rs
+++ b/rust/fatcat-api-spec/src/models.rs
@@ -79,14 +79,6 @@ impl ChangelogEntry {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ContainerEntity {
- #[serde(rename = "coden")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub coden: Option<String>,
-
- #[serde(rename = "abbrev")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub abbrev: Option<String>,
-
#[serde(rename = "wikidata_qid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub wikidata_qid: Option<String>,
@@ -99,6 +91,11 @@ pub struct ContainerEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub publisher: Option<String>,
+ /// Eg, 'journal'
+ #[serde(rename = "container_type")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub container_type: Option<String>,
+
/// Required for valid entities
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -136,11 +133,10 @@ pub struct ContainerEntity {
impl ContainerEntity {
pub fn new() -> ContainerEntity {
ContainerEntity {
- coden: None,
- abbrev: None,
wikidata_qid: None,
issnl: None,
publisher: None,
+ container_type: None,
name: None,
edit_extra: None,
extra: None,
@@ -709,13 +705,18 @@ pub struct ReleaseContrib {
#[serde(skip_serializing_if = "Option::is_none")]
pub raw_name: Option<String>,
- #[serde(rename = "extra")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub extra: Option<serde_json::Value>,
-
#[serde(rename = "role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
+
+ /// Raw affiliation string as displayed in text
+ #[serde(rename = "raw_affiliation")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub raw_affiliation: Option<String>,
+
+ #[serde(rename = "extra")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub extra: Option<serde_json::Value>,
}
impl ReleaseContrib {
@@ -725,8 +726,9 @@ impl ReleaseContrib {
creator_id: None,
creator: None,
raw_name: None,
- extra: None,
role: None,
+ raw_affiliation: None,
+ extra: None,
}
}
}
@@ -745,6 +747,11 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub contribs: Option<Vec<models::ReleaseContrib>>,
+ /// Short version of license name. Eg, 'CC-BY'
+ #[serde(rename = "license_slug")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub license_slug: Option<String>,
+
/// Two-letter RFC1766/ISO639-1 language code, with extensions
#[serde(rename = "language")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -766,6 +773,14 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub volume: Option<String>,
+ #[serde(rename = "jstor_id")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub jstor_id: Option<String>,
+
+ #[serde(rename = "arxiv_id")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub arxiv_id: Option<String>,
+
#[serde(rename = "core_id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub core_id: Option<String>,
@@ -834,7 +849,12 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub work_id: Option<String>,
- /// Required for valid entities
+ /// Title in original language (or, the language of the full text of this release)
+ #[serde(rename = "original_title")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub original_title: Option<String>,
+
+ /// Required for valid entities. The title used in citations and for display; usually English
#[serde(rename = "title")]
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
@@ -874,11 +894,14 @@ impl ReleaseEntity {
abstracts: None,
refs: None,
contribs: None,
+ license_slug: None,
language: None,
publisher: None,
pages: None,
issue: None,
volume: None,
+ jstor_id: None,
+ arxiv_id: None,
core_id: None,
pmcid: None,
pmid: None,
@@ -895,6 +918,7 @@ impl ReleaseEntity {
files: None,
container: None,
work_id: None,
+ original_title: None,
title: None,
state: None,
ident: None,
@@ -1008,6 +1032,7 @@ pub struct WebcaptureEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub release_ids: Option<Vec<String>>,
+ /// same format as CDX line timestamp (UTC, etc). Corresponds to the overall capture timestamp. Can be the earliest or average of CDX timestamps if that makes sense.
#[serde(rename = "timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<chrono::DateTime<chrono::Utc>>,
@@ -1091,8 +1116,9 @@ pub struct WebcaptureEntityCdx {
#[serde(rename = "surt")]
pub surt: String,
+ /// UTC, 'Z'-terminated, second (or better) precision
#[serde(rename = "timestamp")]
- pub timestamp: String,
+ pub timestamp: chrono::DateTime<chrono::Utc>,
#[serde(rename = "url")]
pub url: String,
@@ -1114,7 +1140,7 @@ pub struct WebcaptureEntityCdx {
}
impl WebcaptureEntityCdx {
- pub fn new(surt: String, timestamp: String, url: String, sha1: String) -> WebcaptureEntityCdx {
+ pub fn new(surt: String, timestamp: chrono::DateTime<chrono::Utc>, url: String, sha1: String) -> WebcaptureEntityCdx {
WebcaptureEntityCdx {
surt: surt,
timestamp: timestamp,
diff --git a/rust/fatcat-api-spec/src/server.rs b/rust/fatcat-api-spec/src/server.rs
index 8b616959..af13948e 100644
--- a/rust/fatcat-api-spec/src/server.rs
+++ b/rust/fatcat-api-spec/src/server.rs
@@ -262,8 +262,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -290,7 +297,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_container_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_container_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateContainerBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -837,7 +847,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_container_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -1488,8 +1503,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -1516,7 +1538,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_creator_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_creator_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateCreatorBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -2063,7 +2088,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_creator_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -2901,9 +2931,24 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
let param_expand = query_params.get("expand").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
- let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
- let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
+ let param_before = query_params
+ .get("before")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
+ let param_since = query_params
+ .get("since")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
match api.get_editgroups_reviewable(param_expand, param_limit, param_before, param_since, context).wait() {
Ok(rsp) => match rsp {
@@ -3085,9 +3130,24 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
- let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
- let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
+ let param_before = query_params
+ .get("before")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
+ let param_since = query_params
+ .get("since")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
match api.get_editor_editgroups(param_editor_id, param_limit, param_before, param_since, context).wait() {
Ok(rsp) => match rsp {
@@ -3182,7 +3242,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_submit = query_params.get("submit").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_submit = query_params
+ .get("submit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -3882,7 +3947,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_changelog(param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -4261,9 +4331,24 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
- let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
- let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
+ let param_before = query_params
+ .get("before")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
+ let param_since = query_params
+ .get("since")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?;
match api.get_editor_annotations(param_editor_id, param_limit, param_before, param_since, context).wait() {
Ok(rsp) => match rsp {
@@ -4512,8 +4597,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -4540,7 +4632,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_file_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_file_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateFileBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -5087,7 +5182,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_file_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -5739,8 +5839,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -5767,7 +5874,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_fileset_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_fileset_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateFilesetBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -6314,7 +6424,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_fileset_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -6884,8 +6999,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -6912,7 +7034,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_release_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_release_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateReleaseBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -7791,7 +7916,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_release_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -8151,11 +8281,25 @@ where
let param_pmid = query_params.get("pmid").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
let param_pmcid = query_params.get("pmcid").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
let param_core_id = query_params.get("core_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_arxiv_id = query_params.get("arxiv_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_jstor_id = query_params.get("jstor_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
let param_expand = query_params.get("expand").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
let param_hide = query_params.get("hide").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
match api
- .lookup_release(param_doi, param_wikidata_qid, param_isbn13, param_pmid, param_pmcid, param_core_id, param_expand, param_hide, context)
+ .lookup_release(
+ param_doi,
+ param_wikidata_qid,
+ param_isbn13,
+ param_pmid,
+ param_pmcid,
+ param_core_id,
+ param_arxiv_id,
+ param_jstor_id,
+ param_expand,
+ param_hide,
+ context,
+ )
.wait()
{
Ok(rsp) => match rsp {
@@ -8542,8 +8686,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -8570,7 +8721,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_webcapture_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_webcapture_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateWebcaptureBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -9117,7 +9271,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_webcapture_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {
@@ -9541,8 +9700,15 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok());
+ let param_autoaccept = query_params
+ .get("autoaccept")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.to_lowercase().parse::<bool>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?;
let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
+ let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok());
// Body parameters (note that non-required body parameters will ignore garbage
// values, rather than causing a 400 response). Produce warning header and logs for
@@ -9569,7 +9735,10 @@ where
};
let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?;
- match api.create_work_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() {
+ match api
+ .create_work_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context)
+ .wait()
+ {
Ok(rsp) => match rsp {
CreateWorkBatchResponse::CreatedEntities(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
@@ -10116,7 +10285,12 @@ where
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default();
- let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok());
+ let param_limit = query_params
+ .get("limit")
+ .and_then(|list| list.first())
+ .and_then(|x| Some(x.parse::<i64>()))
+ .map_or_else(|| Ok(None), |x| x.map(|v| Some(v)))
+ .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?;
match api.get_work_history(param_ident, param_limit, context).wait() {
Ok(rsp) => match rsp {