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 | 78 | ||||
-rw-r--r-- | rust/fatcat-api/api/swagger.yaml | 632 | ||||
-rw-r--r-- | rust/fatcat-api/examples/client.rs | 8 | ||||
-rw-r--r-- | rust/fatcat-api/examples/server_lib/server.rs | 16 | ||||
-rw-r--r-- | rust/fatcat-api/src/client.rs | 20 | ||||
-rw-r--r-- | rust/fatcat-api/src/lib.rs | 28 | ||||
-rw-r--r-- | rust/fatcat-api/src/models.rs | 42 | ||||
-rw-r--r-- | rust/fatcat-api/src/server.rs | 24 |
9 files changed, 419 insertions, 431 deletions
diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md index c693f229..5ef72265 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-07-01T01:27:53.353Z +- Build date: 2018-07-21T02:36:21.158Z 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 e1c44063..dde02734 100644 --- a/rust/fatcat-api/api.yaml +++ b/rust/fatcat-api/api.yaml @@ -21,20 +21,20 @@ x-entity-props: &ENTITYPROPS enum: ["wip", "active", "redirect", "deleted"] ident: type: string - #format: uuid - example: "00000000-0000-0000-adce-000000000001" + #format: custom + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: integer - example: 42 - format: int64 - redirect: type: string #format: uuid - example: "00000000-0000-0000-adce-000000000002" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + redirect: + type: string + #format: custom + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editgroup_id: - type: integer - example: 16 - format: int64 + type: string + #format: custom + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: object additionalProperties: {} @@ -135,10 +135,10 @@ definitions: type: string work_id: type: string - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" container_id: type: string - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" release_type: type: string example: "book" @@ -207,19 +207,18 @@ definitions: format: int64 ident: type: string - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: integer - example: 42 - format: int64 - redirect_ident: type: string - example: "00000000-0000-0000-adce-000000000002" #format: uuid + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + redirect_ident: + type: string + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + #format: ident editgroup_id: - type: integer - example: 16 - format: int64 + type: string + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: object additionalProperties: {} @@ -228,6 +227,9 @@ definitions: required: - username properties: + id: + type: string + example: "q3nouwy3nnbsvo3h5klxsx4a7y" username: type: string example: "zerocool93" @@ -237,11 +239,13 @@ definitions: - editor_id properties: id: - type: integer - format: int64 + type: string + #format: custom + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editor_id: - type: integer - format: int64 + type: string + #format: custon + example: "q3nouwy3nnbsvo3h5klxsx4a7y" description: type: string extra: @@ -281,8 +285,8 @@ definitions: type: integer format: int64 editgroup_id: - type: integer - format: int64 + type: string + example: "q3nouwy3nnbsvo3h5klxsx4a7y" timestamp: type: string format: date-time @@ -296,7 +300,7 @@ definitions: format: int64 target_release_id: type: string - #format: uuid + #format: ident raw: type: string key: @@ -319,7 +323,7 @@ definitions: format: int64 creator_id: type: string - #format: uuid + #format: ident raw: type: string role: @@ -795,9 +799,9 @@ paths: items: $ref: "#/definitions/release_entity" <<: *ENTITYRESPONSES - /editor/{username}: + /editor/{id}: parameters: - - name: username + - name: id in: path type: string required: true @@ -816,9 +820,9 @@ paths: description: Generic Error schema: $ref: "#/definitions/error_response" - /editor/{username}/changelog: + /editor/{id}/changelog: parameters: - - name: username + - name: id in: path type: string required: true @@ -865,8 +869,8 @@ paths: parameters: - name: id in: path - type: integer - format: int64 + type: string + #format: custom required: true get: operationId: "get_editgroup" @@ -891,8 +895,8 @@ paths: parameters: - name: id in: path - type: integer - format: int64 + type: string + #format: custom required: true post: operationId: "accept_editgroup" diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml index d376a078..75b65f4b 100644 --- a/rust/fatcat-api/api/swagger.yaml +++ b/rust/fatcat-api/api/swagger.yaml @@ -1543,16 +1543,16 @@ paths: path: "/work/:id/releases" HttpMethod: "Get" httpmethod: "get" - /editor/{username}: + /editor/{id}: get: operationId: "get_editor" parameters: - - name: "username" + - name: "id" in: "path" required: true type: "string" formatString: "\\\"{}\\\"" - example: "\"username_example\".to_string()" + example: "\"id_example\".to_string()" responses: 200: description: "Found Editor" @@ -1583,19 +1583,19 @@ paths: producesJson: true operation_id: "get_editor" uppercase_operation_id: "GET_EDITOR" - path: "/editor/:username" + path: "/editor/:id" HttpMethod: "Get" httpmethod: "get" - /editor/{username}/changelog: + /editor/{id}/changelog: get: operationId: "get_editor_changelog" parameters: - - name: "username" + - name: "id" in: "path" required: true type: "string" formatString: "\\\"{}\\\"" - example: "\"username_example\".to_string()" + example: "\"id_example\".to_string()" responses: 200: description: "Found Merged Changes" @@ -1628,7 +1628,7 @@ paths: producesJson: true operation_id: "get_editor_changelog" uppercase_operation_id: "GET_EDITOR_CHANGELOG" - path: "/editor/:username/changelog" + path: "/editor/:id/changelog" HttpMethod: "Get" httpmethod: "get" /editgroup: @@ -1688,10 +1688,9 @@ paths: - name: "id" in: "path" required: true - type: "integer" - format: "int64" - formatString: "{}" - example: "789" + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" responses: 200: description: "Found Entity" @@ -1741,10 +1740,9 @@ paths: - name: "id" in: "path" required: true - type: "integer" - format: "int64" - formatString: "{}" - example: "789" + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" responses: 200: description: "Merged Successfully" @@ -1944,19 +1942,17 @@ definitions: extra: type: "object" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" state: type: "string" enum: @@ -1965,17 +1961,17 @@ definitions: - "redirect" - "deleted" example: - redirect: "00000000-0000-0000-adce-000000000002" + redirect: "q3nouwy3nnbsvo3h5klxsx4a7y" coden: "coden" - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: "{}" name: "Journal of Important Results" publisher: "Society of Curious Students" - editgroup_id: 16 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" issnl: "1234-5678" abbrev: "abbrev" state: "wip" - revision: 42 + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" upperCaseName: "CONTAINER_ENTITY" creator_entity: type: "object" @@ -2001,31 +1997,29 @@ definitions: - "deleted" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: "object" example: - redirect: "00000000-0000-0000-adce-000000000002" + redirect: "q3nouwy3nnbsvo3h5klxsx4a7y" surname: "surname" - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: "{}" - editgroup_id: 16 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" orcid: "0000-0002-1825-0097" state: "wip" given_name: "given_name" display_name: "Grace Hopper" - revision: 42 + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" upperCaseName: "CREATOR_ENTITY" file_entity: type: "object" @@ -2057,19 +2051,17 @@ definitions: extra: type: "object" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" state: type: "string" enum: @@ -2078,18 +2070,18 @@ definitions: - "redirect" - "deleted" example: - redirect: "00000000-0000-0000-adce-000000000002" + redirect: "q3nouwy3nnbsvo3h5klxsx4a7y" sha256: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832" - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" url: "https://example.edu/~frau/prcding.pdf" releases: - "releases" - "releases" - revision: 42 + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" sha1: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8" size: 1048576 extra: "{}" - editgroup_id: 16 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" mimetype: "application/pdf" state: "wip" md5: "d41efcc592d1e40ac13905377399eb9b" @@ -2135,10 +2127,10 @@ definitions: example: "book" container_id: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" work_id: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" title: type: "string" state: @@ -2150,25 +2142,23 @@ definitions: - "deleted" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: "object" example: - redirect: "00000000-0000-0000-adce-000000000002" - work_id: "00000000-0000-0000-adce-000000000001" + redirect: "q3nouwy3nnbsvo3h5klxsx4a7y" + work_id: "q3nouwy3nnbsvo3h5klxsx4a7y" issue: "12" - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" release_type: "book" language: "language" title: "title" @@ -2182,7 +2172,7 @@ definitions: creator_id: "creator_id" index: 1 raw: "raw" - revision: 42 + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" volume: "volume" pages: "pages" refs: @@ -2206,9 +2196,9 @@ definitions: isbn13: "isbn13" extra: "{}" publisher: "publisher" - editgroup_id: 16 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" state: "wip" - container_id: "00000000-0000-0000-adce-000000000001" + container_id: "q3nouwy3nnbsvo3h5klxsx4a7y" doi: "10.1234/abcde.789" upperCaseName: "RELEASE_ENTITY" work_entity: @@ -2219,19 +2209,17 @@ definitions: extra: type: "object" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" state: type: "string" enum: @@ -2240,13 +2228,13 @@ definitions: - "redirect" - "deleted" example: - redirect: "00000000-0000-0000-adce-000000000002" - ident: "00000000-0000-0000-adce-000000000001" + redirect: "q3nouwy3nnbsvo3h5klxsx4a7y" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: "{}" work_type: "work_type" - editgroup_id: 16 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" state: "wip" - revision: 42 + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" upperCaseName: "WORK_ENTITY" entity_history_entry: type: "object" @@ -2266,154 +2254,154 @@ definitions: extra: "{}" edits: works: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" creators: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" files: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" containers: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" releases: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" description: "description" - editor_id: 6 - id: 0 + editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + id: "q3nouwy3nnbsvo3h5klxsx4a7y" edit: - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" changelog_entry: editgroup: extra: "{}" edits: works: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" creators: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" files: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" containers: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" releases: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" description: "description" - editor_id: 6 - id: 0 - index: 1 - editgroup_id: 5 + editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + id: "q3nouwy3nnbsvo3h5klxsx4a7y" + index: 0 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" timestamp: "2000-01-23T04:56:07.000+00:00" upperCaseName: "ENTITY_HISTORY_ENTRY" entity_edit: @@ -2429,37 +2417,39 @@ definitions: example: 847 ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - format: "int64" - example: 42 + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" redirect_ident: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editgroup_id: - type: "integer" - format: "int64" - example: 16 + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: "object" example: - ident: "00000000-0000-0000-adce-000000000001" + ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" upperCaseName: "ENTITY_EDIT" editor: type: "object" required: - "username" properties: + id: + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" username: type: "string" example: "zerocool93" example: + id: "q3nouwy3nnbsvo3h5klxsx4a7y" username: "zerocool93" upperCaseName: "EDITOR" editgroup: @@ -2468,11 +2458,11 @@ definitions: - "editor_id" properties: id: - type: "integer" - format: "int64" + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editor_id: - type: "integer" - format: "int64" + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" description: type: "string" extra: @@ -2483,73 +2473,73 @@ definitions: extra: "{}" edits: works: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" creators: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" files: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" containers: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" releases: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" description: "description" - editor_id: 6 - id: 0 + editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + id: "q3nouwy3nnbsvo3h5klxsx4a7y" upperCaseName: "EDITGROUP" changelog_entry: type: "object" @@ -2562,8 +2552,8 @@ definitions: type: "integer" format: "int64" editgroup_id: - type: "integer" - format: "int64" + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" timestamp: type: "string" format: "date-time" @@ -2574,75 +2564,75 @@ definitions: extra: "{}" edits: works: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" creators: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" files: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" containers: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" releases: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" description: "description" - editor_id: 6 - id: 0 - index: 1 - editgroup_id: 5 + editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + id: "q3nouwy3nnbsvo3h5klxsx4a7y" + index: 0 + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" timestamp: "2000-01-23T04:56:07.000+00:00" upperCaseName: "CHANGELOG_ENTRY" release_ref: @@ -2727,70 +2717,70 @@ definitions: $ref: "#/definitions/entity_edit" example: works: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" creators: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" files: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" containers: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" releases: - - ident: "00000000-0000-0000-adce-000000000001" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 - - ident: "00000000-0000-0000-adce-000000000001" + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" + - ident: "q3nouwy3nnbsvo3h5klxsx4a7y" edit_id: 847 extra: "{}" - redirect_ident: "00000000-0000-0000-adce-000000000002" - editgroup_id: 16 - revision: 42 + redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y" + editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y" + revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe" upperCaseName: "EDITGROUP_EDITS" x-entity-props: state: @@ -2802,18 +2792,16 @@ x-entity-props: - "deleted" ident: type: "string" - example: "00000000-0000-0000-adce-000000000001" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" revision: - type: "integer" - example: 42 - format: "int64" + type: "string" + example: "86daea5b-1b6b-432a-bb67-ea97795f80fe" redirect: type: "string" - example: "00000000-0000-0000-adce-000000000002" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" editgroup_id: - type: "integer" - example: 16 - format: "int64" + type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" extra: type: "object" additionalProperties: {} diff --git a/rust/fatcat-api/examples/client.rs b/rust/fatcat-api/examples/client.rs index c79110d9..3fa6508e 100644 --- a/rust/fatcat-api/examples/client.rs +++ b/rust/fatcat-api/examples/client.rs @@ -83,7 +83,7 @@ fn main() { match matches.value_of("operation") { Some("AcceptEditgroup") => { - let result = client.accept_editgroup(789).wait(); + let result = client.accept_editgroup("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } @@ -179,17 +179,17 @@ fn main() { } Some("GetEditgroup") => { - let result = client.get_editgroup(789).wait(); + let result = client.get_editgroup("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } Some("GetEditor") => { - let result = client.get_editor("username_example".to_string()).wait(); + let result = client.get_editor("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } Some("GetEditorChangelog") => { - let result = client.get_editor_changelog("username_example".to_string()).wait(); + let result = client.get_editor_changelog("id_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/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs index 76d7d13c..608d715f 100644 --- a/rust/fatcat-api/examples/server_lib/server.rs +++ b/rust/fatcat-api/examples/server_lib/server.rs @@ -20,9 +20,9 @@ use fatcat::{AcceptEditgroupResponse, Api, ApiError, Context, CreateContainerBat pub struct Server; impl Api for Server { - fn accept_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { + fn accept_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("accept_editgroup({}) - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("accept_editgroup(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } @@ -148,21 +148,21 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } - fn get_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { + fn get_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editgroup({}) - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editgroup(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } - fn get_editor(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { + fn get_editor(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editor(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editor(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } - fn get_editor_changelog(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { + fn get_editor_changelog(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editor_changelog(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editor_changelog(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs index b68c43d2..b785adab 100644 --- a/rust/fatcat-api/src/client.rs +++ b/rust/fatcat-api/src/client.rs @@ -163,7 +163,7 @@ impl Client { } impl Api for Client { - fn accept_editgroup(&self, param_id: i64, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { + fn accept_editgroup(&self, param_id: String, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { let url = format!("{}/v0/editgroup/{id}/accept", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); @@ -1349,7 +1349,7 @@ impl Api for Client { Box::new(futures::done(result)) } - fn get_editgroup(&self, param_id: i64, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { + fn get_editgroup(&self, param_id: String, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { let url = format!("{}/v0/editgroup/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); @@ -1409,12 +1409,8 @@ impl Api for Client { Box::new(futures::done(result)) } - fn get_editor(&self, param_username: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { - let url = format!( - "{}/v0/editor/{username}", - self.base_path, - username = utf8_percent_encode(¶m_username.to_string(), PATH_SEGMENT_ENCODE_SET) - ); + fn get_editor(&self, param_id: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { + let url = format!("{}/v0/editor/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); let request = hyper_client.request(hyper::method::Method::Get, &url); @@ -1466,12 +1462,8 @@ impl Api for Client { Box::new(futures::done(result)) } - fn get_editor_changelog(&self, param_username: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { - let url = format!( - "{}/v0/editor/{username}/changelog", - self.base_path, - username = utf8_percent_encode(¶m_username.to_string(), PATH_SEGMENT_ENCODE_SET) - ); + fn get_editor_changelog(&self, param_id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { + let url = format!("{}/v0/editor/{id}/changelog", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); let request = hyper_client.request(hyper::method::Method::Get, &url); diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs index ce5674cd..47d23d04 100644 --- a/rust/fatcat-api/src/lib.rs +++ b/rust/fatcat-api/src/lib.rs @@ -438,7 +438,7 @@ pub enum LookupReleaseResponse { /// API pub trait Api { - fn accept_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>; + fn accept_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>; fn create_container(&self, entity: models::ContainerEntity, context: &Context) -> Box<Future<Item = CreateContainerResponse, Error = ApiError> + Send>; @@ -476,11 +476,11 @@ pub trait Api { fn get_creator_releases(&self, id: String, context: &Context) -> Box<Future<Item = GetCreatorReleasesResponse, Error = ApiError> + Send>; - fn get_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send>; + fn get_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send>; - fn get_editor(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>; + fn get_editor(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>; - fn get_editor_changelog(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>; + fn get_editor_changelog(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>; fn get_file(&self, id: String, context: &Context) -> Box<Future<Item = GetFileResponse, Error = ApiError> + Send>; @@ -511,7 +511,7 @@ pub trait Api { /// API without a `Context` pub trait ApiNoContext { - fn accept_editgroup(&self, id: i64) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>; + fn accept_editgroup(&self, id: String) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>; fn create_container(&self, entity: models::ContainerEntity) -> Box<Future<Item = CreateContainerResponse, Error = ApiError> + Send>; @@ -549,11 +549,11 @@ pub trait ApiNoContext { fn get_creator_releases(&self, id: String) -> Box<Future<Item = GetCreatorReleasesResponse, Error = ApiError> + Send>; - fn get_editgroup(&self, id: i64) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send>; + fn get_editgroup(&self, id: String) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send>; - fn get_editor(&self, username: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>; + fn get_editor(&self, id: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>; - fn get_editor_changelog(&self, username: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>; + fn get_editor_changelog(&self, id: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>; fn get_file(&self, id: String) -> Box<Future<Item = GetFileResponse, Error = ApiError> + Send>; @@ -598,7 +598,7 @@ impl<'a, T: Api + Sized> ContextWrapperExt<'a> for T { } impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { - fn accept_editgroup(&self, id: i64) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { + fn accept_editgroup(&self, id: String) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { self.api().accept_editgroup(id, &self.context()) } @@ -674,16 +674,16 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_creator_releases(id, &self.context()) } - fn get_editgroup(&self, id: i64) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { + fn get_editgroup(&self, id: String) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { self.api().get_editgroup(id, &self.context()) } - fn get_editor(&self, username: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { - self.api().get_editor(username, &self.context()) + fn get_editor(&self, id: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { + self.api().get_editor(id, &self.context()) } - fn get_editor_changelog(&self, username: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { - self.api().get_editor_changelog(username, &self.context()) + fn get_editor_changelog(&self, id: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { + self.api().get_editor_changelog(id, &self.context()) } fn get_file(&self, id: String) -> Box<Future<Item = GetFileResponse, Error = ApiError> + Send> { diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index cd18469c..4ecc180c 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -15,7 +15,7 @@ pub struct ChangelogEntry { pub index: i64, #[serde(rename = "editgroup_id")] - pub editgroup_id: i64, + pub editgroup_id: String, #[serde(rename = "timestamp")] pub timestamp: chrono::DateTime<chrono::Utc>, @@ -26,7 +26,7 @@ pub struct ChangelogEntry { } impl ChangelogEntry { - pub fn new(index: i64, editgroup_id: i64, timestamp: chrono::DateTime<chrono::Utc>) -> ChangelogEntry { + pub fn new(index: i64, editgroup_id: String, timestamp: chrono::DateTime<chrono::Utc>) -> ChangelogEntry { ChangelogEntry { index: index, editgroup_id: editgroup_id, @@ -63,7 +63,7 @@ pub struct ContainerEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option<i64>, + pub editgroup_id: Option<String>, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -71,7 +71,7 @@ pub struct ContainerEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] @@ -129,7 +129,7 @@ pub struct CreatorEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -137,7 +137,7 @@ pub struct CreatorEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option<i64>, + pub editgroup_id: Option<String>, #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] @@ -165,10 +165,10 @@ impl CreatorEntity { pub struct Editgroup { #[serde(rename = "id")] #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, + pub id: Option<String>, #[serde(rename = "editor_id")] - pub editor_id: i64, + pub editor_id: String, #[serde(rename = "description")] #[serde(skip_serializing_if = "Option::is_none")] @@ -184,7 +184,7 @@ pub struct Editgroup { } impl Editgroup { - pub fn new(editor_id: i64) -> Editgroup { + pub fn new(editor_id: String) -> Editgroup { Editgroup { id: None, editor_id: editor_id, @@ -232,13 +232,17 @@ impl EditgroupEdits { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Editor { + #[serde(rename = "id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "username")] pub username: String, } impl Editor { pub fn new(username: String) -> Editor { - Editor { username: username } + Editor { id: None, username: username } } } @@ -252,14 +256,14 @@ pub struct EntityEdit { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "redirect_ident")] #[serde(skip_serializing_if = "Option::is_none")] pub redirect_ident: Option<String>, #[serde(rename = "editgroup_id")] - pub editgroup_id: i64, + pub editgroup_id: String, #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] @@ -267,7 +271,7 @@ pub struct EntityEdit { } impl EntityEdit { - pub fn new(edit_id: i64, ident: String, editgroup_id: i64) -> EntityEdit { + pub fn new(edit_id: i64, ident: String, editgroup_id: String) -> EntityEdit { EntityEdit { edit_id: edit_id, ident: ident, @@ -349,7 +353,7 @@ pub struct FileEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option<i64>, + pub editgroup_id: Option<String>, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -357,7 +361,7 @@ pub struct FileEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] @@ -492,7 +496,7 @@ pub struct ReleaseEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -500,7 +504,7 @@ pub struct ReleaseEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option<i64>, + pub editgroup_id: Option<String>, #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] @@ -622,7 +626,7 @@ pub struct WorkEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option<i64>, + pub editgroup_id: Option<String>, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -630,7 +634,7 @@ pub struct WorkEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, + pub revision: Option<String>, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] diff --git a/rust/fatcat-api/src/server.rs b/rust/fatcat-api/src/server.rs index 35b31691..e4e0bc1d 100644 --- a/rust/fatcat-api/src/server.rs +++ b/rust/fatcat-api/src/server.rs @@ -2002,7 +2002,7 @@ where let api_clone = api.clone(); router.get( - "/v0/editor/:username", + "/v0/editor/:id", move |req: &mut Request| { let mut context = Context::default(); @@ -2016,20 +2016,20 @@ where context.authorization = req.extensions.remove::<Authorization>(); // Path parameters - let param_username = { + let param_id = { let param = req.extensions .get::<Router>() .ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? - .find("username") - .ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter username".to_string())))?; + .find("id") + .ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter id".to_string())))?; percent_decode(param.as_bytes()) .decode_utf8() .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? .parse() - .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter username: {}", e))))? + .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; - match api.get_editor(param_username, context).wait() { + match api.get_editor(param_id, context).wait() { Ok(rsp) => match rsp { GetEditorResponse::FoundEditor(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2080,7 +2080,7 @@ where let api_clone = api.clone(); router.get( - "/v0/editor/:username/changelog", + "/v0/editor/:id/changelog", move |req: &mut Request| { let mut context = Context::default(); @@ -2094,20 +2094,20 @@ where context.authorization = req.extensions.remove::<Authorization>(); // Path parameters - let param_username = { + let param_id = { let param = req.extensions .get::<Router>() .ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? - .find("username") - .ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter username".to_string())))?; + .find("id") + .ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter id".to_string())))?; percent_decode(param.as_bytes()) .decode_utf8() .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? .parse() - .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter username: {}", e))))? + .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; - match api.get_editor_changelog(param_username, context).wait() { + match api.get_editor_changelog(param_id, context).wait() { Ok(rsp) => match rsp { GetEditorChangelogResponse::FoundMergedChanges(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); |