From 2842422bb04d176b7f41888e6eed10cd4b81bbac Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 18 Sep 2018 11:12:47 -0700 Subject: first attempt at auth in API spec --- fatcat-openapi2.yml | 37 + rust/fatcat-api-spec/README.md | 2 +- rust/fatcat-api-spec/api.yaml | 37 + rust/fatcat-api-spec/api/swagger.yaml | 984 +++++++++++++++++++++++++++ rust/fatcat-api-spec/src/client.rs | 1185 +++++++++++++++++++++++++++++++++ rust/fatcat-api-spec/src/lib.rs | 158 +++++ rust/fatcat-api-spec/src/mimetypes.rs | 316 +++++++++ rust/fatcat-api-spec/src/server.rs | 1109 +++++++++++++++++++++++++++++- 8 files changed, 3823 insertions(+), 5 deletions(-) diff --git a/fatcat-openapi2.yml b/fatcat-openapi2.yml index 0f52a8b6..713cb116 100644 --- a/fatcat-openapi2.yml +++ b/fatcat-openapi2.yml @@ -13,6 +13,12 @@ consumes: produces: - application/json +securityDefinitions: + Bearer: + type: apiKey + name: Authorization + in: header + tags: # TAGLINE - name: containers # TAGLINE descriptions: "Container entities: such as journals, conferences, book series" # TAGLINE @@ -548,6 +554,13 @@ x-entity-responses: &ENTITYRESPONSES description: Bad Request schema: $ref: "#/definitions/error_response" + 401: + description: Not Authorized # "Authentication information is missing or invalid" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: string 404: description: Not Found schema: @@ -573,6 +586,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -602,6 +617,8 @@ paths: type: array items: $ref: "#/definitions/container_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -651,6 +668,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -666,6 +685,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity @@ -816,6 +837,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -845,6 +868,8 @@ paths: type: array items: $ref: "#/definitions/creator_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -894,6 +919,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -909,6 +936,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity @@ -1082,6 +1111,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -1111,6 +1142,8 @@ paths: type: array items: $ref: "#/definitions/file_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -1160,6 +1193,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -1175,6 +1210,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity diff --git a/rust/fatcat-api-spec/README.md b/rust/fatcat-api-spec/README.md index d6f09b7a..41f4ae5e 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: 2018-12-27T07:23:47.225Z +- Build date: 2018-12-27T07:31:49.807Z 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 0f52a8b6..713cb116 100644 --- a/rust/fatcat-api-spec/api.yaml +++ b/rust/fatcat-api-spec/api.yaml @@ -13,6 +13,12 @@ consumes: produces: - application/json +securityDefinitions: + Bearer: + type: apiKey + name: Authorization + in: header + tags: # TAGLINE - name: containers # TAGLINE descriptions: "Container entities: such as journals, conferences, book series" # TAGLINE @@ -548,6 +554,13 @@ x-entity-responses: &ENTITYRESPONSES description: Bad Request schema: $ref: "#/definitions/error_response" + 401: + description: Not Authorized # "Authentication information is missing or invalid" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: string 404: description: Not Found schema: @@ -573,6 +586,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -602,6 +617,8 @@ paths: type: array items: $ref: "#/definitions/container_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -651,6 +668,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -666,6 +685,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity @@ -816,6 +837,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -845,6 +868,8 @@ paths: type: array items: $ref: "#/definitions/creator_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -894,6 +919,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -909,6 +936,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity @@ -1082,6 +1111,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 201: description: Created Entity @@ -1111,6 +1142,8 @@ paths: type: array items: $ref: "#/definitions/file_entity" + security: + - Bearer: [] responses: 201: description: Created Entities @@ -1160,6 +1193,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Updated Entity @@ -1175,6 +1210,8 @@ paths: in: query required: false type: string + security: + - Bearer: [] responses: 200: description: Deleted Entity diff --git a/rust/fatcat-api-spec/api/swagger.yaml b/rust/fatcat-api-spec/api/swagger.yaml index 3ad51b8a..7e5508b9 100644 --- a/rust/fatcat-api-spec/api/swagger.yaml +++ b/rust/fatcat-api-spec/api/swagger.yaml @@ -64,6 +64,18 @@ paths: uppercase_operation_id: "CREATE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_CONTAINER" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -82,6 +94,8 @@ paths: uppercase_operation_id: "CREATE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_container" uppercase_operation_id: "CREATE_CONTAINER" path: "/container" @@ -143,6 +157,18 @@ paths: uppercase_operation_id: "CREATE_CONTAINER_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_CONTAINER_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -161,6 +187,8 @@ paths: uppercase_operation_id: "CREATE_CONTAINER_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_container_batch" uppercase_operation_id: "CREATE_CONTAINER_BATCH" path: "/container/batch" @@ -213,6 +241,18 @@ paths: uppercase_operation_id: "GET_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CONTAINER" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -284,6 +324,18 @@ paths: uppercase_operation_id: "UPDATE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_CONTAINER" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -302,6 +354,8 @@ paths: uppercase_operation_id: "UPDATE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "update_container" uppercase_operation_id: "UPDATE_CONTAINER" path: "/container/:ident" @@ -344,6 +398,18 @@ paths: uppercase_operation_id: "DELETE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_CONTAINER" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -362,6 +428,8 @@ paths: uppercase_operation_id: "DELETE_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "delete_container" uppercase_operation_id: "DELETE_CONTAINER" path: "/container/:ident" @@ -418,6 +486,18 @@ paths: uppercase_operation_id: "GET_CONTAINER_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CONTAINER_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -481,6 +561,18 @@ paths: uppercase_operation_id: "GET_CONTAINER_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CONTAINER_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -537,6 +629,18 @@ paths: uppercase_operation_id: "GET_CONTAINER_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -614,6 +718,18 @@ paths: uppercase_operation_id: "LOOKUP_CONTAINER" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "LOOKUP_CONTAINER" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -672,6 +788,18 @@ paths: uppercase_operation_id: "GET_CONTAINER_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -729,6 +857,18 @@ paths: uppercase_operation_id: "DELETE_CONTAINER_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -795,6 +935,18 @@ paths: uppercase_operation_id: "CREATE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_CREATOR" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -813,6 +965,8 @@ paths: uppercase_operation_id: "CREATE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_creator" uppercase_operation_id: "CREATE_CREATOR" path: "/creator" @@ -874,6 +1028,18 @@ paths: uppercase_operation_id: "CREATE_CREATOR_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_CREATOR_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -892,6 +1058,8 @@ paths: uppercase_operation_id: "CREATE_CREATOR_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_creator_batch" uppercase_operation_id: "CREATE_CREATOR_BATCH" path: "/creator/batch" @@ -944,6 +1112,18 @@ paths: uppercase_operation_id: "GET_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1015,6 +1195,18 @@ paths: uppercase_operation_id: "UPDATE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_CREATOR" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1033,6 +1225,8 @@ paths: uppercase_operation_id: "UPDATE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "update_creator" uppercase_operation_id: "UPDATE_CREATOR" path: "/creator/:ident" @@ -1075,6 +1269,18 @@ paths: uppercase_operation_id: "DELETE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_CREATOR" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1093,6 +1299,8 @@ paths: uppercase_operation_id: "DELETE_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "delete_creator" uppercase_operation_id: "DELETE_CREATOR" path: "/creator/:ident" @@ -1149,6 +1357,18 @@ paths: uppercase_operation_id: "GET_CREATOR_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1212,6 +1432,18 @@ paths: uppercase_operation_id: "GET_CREATOR_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1276,6 +1508,18 @@ paths: uppercase_operation_id: "GET_CREATOR_RELEASES" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR_RELEASES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1332,6 +1576,18 @@ paths: uppercase_operation_id: "GET_CREATOR_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1409,6 +1665,18 @@ paths: uppercase_operation_id: "LOOKUP_CREATOR" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "LOOKUP_CREATOR" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1467,6 +1735,18 @@ paths: uppercase_operation_id: "GET_CREATOR_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1524,6 +1804,18 @@ paths: uppercase_operation_id: "DELETE_CREATOR_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1590,6 +1882,18 @@ paths: uppercase_operation_id: "CREATE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_FILE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1608,6 +1912,8 @@ paths: uppercase_operation_id: "CREATE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_file" uppercase_operation_id: "CREATE_FILE" path: "/file" @@ -1669,6 +1975,18 @@ paths: uppercase_operation_id: "CREATE_FILE_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_FILE_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1687,6 +2005,8 @@ paths: uppercase_operation_id: "CREATE_FILE_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "create_file_batch" uppercase_operation_id: "CREATE_FILE_BATCH" path: "/file/batch" @@ -1739,6 +2059,18 @@ paths: uppercase_operation_id: "GET_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1810,6 +2142,18 @@ paths: uppercase_operation_id: "UPDATE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_FILE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1828,6 +2172,8 @@ paths: uppercase_operation_id: "UPDATE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "update_file" uppercase_operation_id: "UPDATE_FILE" path: "/file/:ident" @@ -1870,6 +2216,18 @@ paths: uppercase_operation_id: "DELETE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_FILE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -1888,6 +2246,8 @@ paths: uppercase_operation_id: "DELETE_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + security: + - Bearer: [] operation_id: "delete_file" uppercase_operation_id: "DELETE_FILE" path: "/file/:ident" @@ -1944,6 +2304,18 @@ paths: uppercase_operation_id: "GET_FILE_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2007,6 +2379,18 @@ paths: uppercase_operation_id: "GET_FILE_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILE_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2063,6 +2447,18 @@ paths: uppercase_operation_id: "GET_FILE_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2153,6 +2549,18 @@ paths: uppercase_operation_id: "LOOKUP_FILE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "LOOKUP_FILE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2211,6 +2619,18 @@ paths: uppercase_operation_id: "GET_FILE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2268,6 +2688,18 @@ paths: uppercase_operation_id: "DELETE_FILE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2334,6 +2766,18 @@ paths: uppercase_operation_id: "CREATE_FILESET" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_FILESET" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2413,6 +2857,18 @@ paths: uppercase_operation_id: "CREATE_FILESET_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_FILESET_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2483,6 +2939,18 @@ paths: uppercase_operation_id: "GET_FILESET" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILESET" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2554,6 +3022,18 @@ paths: uppercase_operation_id: "UPDATE_FILESET" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_FILESET" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2614,6 +3094,18 @@ paths: uppercase_operation_id: "DELETE_FILESET" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_FILESET" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2688,6 +3180,18 @@ paths: uppercase_operation_id: "GET_FILESET_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILESET_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2751,6 +3255,18 @@ paths: uppercase_operation_id: "GET_FILESET_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILESET_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2807,6 +3323,18 @@ paths: uppercase_operation_id: "GET_FILESET_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILESET_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2865,6 +3393,18 @@ paths: uppercase_operation_id: "GET_FILESET_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_FILESET_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2922,6 +3462,18 @@ paths: uppercase_operation_id: "DELETE_FILESET_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_FILESET_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -2988,6 +3540,18 @@ paths: uppercase_operation_id: "CREATE_WEBCAPTURE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_WEBCAPTURE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3067,6 +3631,18 @@ paths: uppercase_operation_id: "CREATE_WEBCAPTURE_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_WEBCAPTURE_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3137,6 +3713,18 @@ paths: uppercase_operation_id: "GET_WEBCAPTURE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WEBCAPTURE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3208,6 +3796,18 @@ paths: uppercase_operation_id: "UPDATE_WEBCAPTURE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_WEBCAPTURE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3268,6 +3868,18 @@ paths: uppercase_operation_id: "DELETE_WEBCAPTURE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_WEBCAPTURE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3342,6 +3954,18 @@ paths: uppercase_operation_id: "GET_WEBCAPTURE_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WEBCAPTURE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3405,6 +4029,18 @@ paths: uppercase_operation_id: "GET_WEBCAPTURE_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WEBCAPTURE_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3461,6 +4097,18 @@ paths: uppercase_operation_id: "GET_WEBCAPTURE_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WEBCAPTURE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3519,6 +4167,18 @@ paths: uppercase_operation_id: "GET_WEBCAPTURE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WEBCAPTURE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3576,6 +4236,18 @@ paths: uppercase_operation_id: "DELETE_WEBCAPTURE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_WEBCAPTURE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3642,6 +4314,18 @@ paths: uppercase_operation_id: "CREATE_RELEASE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3721,6 +4405,18 @@ paths: uppercase_operation_id: "CREATE_RELEASE_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_RELEASE_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3791,6 +4487,18 @@ paths: uppercase_operation_id: "GET_RELEASE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3862,6 +4570,18 @@ paths: uppercase_operation_id: "UPDATE_RELEASE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3922,6 +4642,18 @@ paths: uppercase_operation_id: "DELETE_RELEASE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -3996,6 +4728,18 @@ paths: uppercase_operation_id: "GET_RELEASE_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4059,6 +4803,18 @@ paths: uppercase_operation_id: "GET_RELEASE_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4123,6 +4879,18 @@ paths: uppercase_operation_id: "GET_RELEASE_FILES" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4187,6 +4955,18 @@ paths: uppercase_operation_id: "GET_RELEASE_FILESETS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_FILESETS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4251,6 +5031,18 @@ paths: uppercase_operation_id: "GET_RELEASE_WEBCAPTURES" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_WEBCAPTURES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4307,6 +5099,18 @@ paths: uppercase_operation_id: "GET_RELEASE_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4406,6 +5210,18 @@ paths: uppercase_operation_id: "LOOKUP_RELEASE" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4464,6 +5280,18 @@ paths: uppercase_operation_id: "GET_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_RELEASE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4521,6 +5349,18 @@ paths: uppercase_operation_id: "DELETE_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_RELEASE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4587,6 +5427,18 @@ paths: uppercase_operation_id: "CREATE_WORK" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_WORK" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4666,6 +5518,18 @@ paths: uppercase_operation_id: "CREATE_WORK_BATCH" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "CREATE_WORK_BATCH" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4736,6 +5600,18 @@ paths: uppercase_operation_id: "GET_WORK" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4807,6 +5683,18 @@ paths: uppercase_operation_id: "UPDATE_WORK" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "UPDATE_WORK" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4867,6 +5755,18 @@ paths: uppercase_operation_id: "DELETE_WORK" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_WORK" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -4941,6 +5841,18 @@ paths: uppercase_operation_id: "GET_WORK_REVISION" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5004,6 +5916,18 @@ paths: uppercase_operation_id: "GET_WORK_HISTORY" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK_HISTORY" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5060,6 +5984,18 @@ paths: uppercase_operation_id: "GET_WORK_REDIRECTS" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5124,6 +6060,18 @@ paths: uppercase_operation_id: "GET_WORK_RELEASES" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK_RELEASES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5182,6 +6130,18 @@ paths: uppercase_operation_id: "GET_WORK_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "GET_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5239,6 +6199,18 @@ paths: uppercase_operation_id: "DELETE_WORK_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" + x-responseId: "NotAuthorized" + x-uppercaseResponseId: "NOT_AUTHORIZED" + uppercase_operation_id: "DELETE_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true 404: description: "Not Found" schema: @@ -5630,6 +6602,11 @@ paths: path: "/changelog/:index" HttpMethod: "Get" httpmethod: "get" +securityDefinitions: + Bearer: + type: "apiKey" + name: "Authorization" + in: "header" definitions: error_response: type: "object" @@ -7494,6 +8471,13 @@ x-entity-responses: description: "Bad Request" schema: $ref: "#/definitions/error_response" + 401: + description: "Not Authorized" + schema: + $ref: "#/definitions/error_response" + headers: + WWW_Authenticate: + type: "string" 404: description: "Not Found" schema: diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs index 0ef2742e..1e889092 100644 --- a/rust/fatcat-api-spec/src/client.rs +++ b/rust/fatcat-api-spec/src/client.rs @@ -212,6 +212,21 @@ impl Api for Client { Ok(CreateContainerResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateContainerResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -292,6 +307,21 @@ impl Api for Client { Ok(CreateContainerBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateContainerBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -360,6 +390,21 @@ impl Api for Client { Ok(DeleteContainerResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteContainerResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -424,6 +469,21 @@ impl Api for Client { Ok(DeleteContainerEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteContainerEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -494,6 +554,21 @@ impl Api for Client { Ok(GetContainerResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetContainerResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -558,6 +633,21 @@ impl Api for Client { Ok(GetContainerEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetContainerEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -626,6 +716,21 @@ impl Api for Client { Ok(GetContainerHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetContainerHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -690,6 +795,21 @@ impl Api for Client { Ok(GetContainerRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetContainerRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -766,6 +886,21 @@ impl Api for Client { Ok(GetContainerRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetContainerRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -846,6 +981,21 @@ impl Api for Client { Ok(LookupContainerResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(LookupContainerResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -925,6 +1075,21 @@ impl Api for Client { Ok(UpdateContainerResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateContainerResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -997,6 +1162,21 @@ impl Api for Client { Ok(CreateCreatorResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateCreatorResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1077,6 +1257,21 @@ impl Api for Client { Ok(CreateCreatorBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateCreatorBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1145,6 +1340,21 @@ impl Api for Client { Ok(DeleteCreatorResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteCreatorResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1209,6 +1419,21 @@ impl Api for Client { Ok(DeleteCreatorEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteCreatorEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1279,6 +1504,21 @@ impl Api for Client { Ok(GetCreatorResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1343,6 +1583,21 @@ impl Api for Client { Ok(GetCreatorEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1411,6 +1666,21 @@ impl Api for Client { Ok(GetCreatorHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1475,6 +1745,21 @@ impl Api for Client { Ok(GetCreatorRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1543,6 +1828,21 @@ impl Api for Client { Ok(GetCreatorReleasesResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorReleasesResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1619,6 +1919,21 @@ impl Api for Client { Ok(GetCreatorRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetCreatorRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1699,6 +2014,21 @@ impl Api for Client { Ok(LookupCreatorResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(LookupCreatorResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -1778,6 +2108,21 @@ impl Api for Client { Ok(UpdateCreatorResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateCreatorResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2273,6 +2618,21 @@ impl Api for Client { Ok(CreateFileResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateFileResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2353,6 +2713,21 @@ impl Api for Client { Ok(CreateFileBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateFileBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2421,6 +2796,21 @@ impl Api for Client { Ok(DeleteFileResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteFileResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2485,6 +2875,21 @@ impl Api for Client { Ok(DeleteFileEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteFileEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2555,6 +2960,21 @@ impl Api for Client { Ok(GetFileResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFileResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2619,6 +3039,21 @@ impl Api for Client { Ok(GetFileEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFileEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2687,6 +3122,21 @@ impl Api for Client { Ok(GetFileHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFileHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2751,6 +3201,21 @@ impl Api for Client { Ok(GetFileRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFileRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2827,6 +3292,21 @@ impl Api for Client { Ok(GetFileRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFileRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2910,6 +3390,21 @@ impl Api for Client { Ok(LookupFileResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(LookupFileResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2989,6 +3484,21 @@ impl Api for Client { Ok(UpdateFileResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateFileResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3061,6 +3571,21 @@ impl Api for Client { Ok(CreateFilesetResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateFilesetResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3141,6 +3666,21 @@ impl Api for Client { Ok(CreateFilesetBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateFilesetBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3209,6 +3749,21 @@ impl Api for Client { Ok(DeleteFilesetResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteFilesetResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3273,6 +3828,21 @@ impl Api for Client { Ok(DeleteFilesetEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteFilesetEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3343,6 +3913,21 @@ impl Api for Client { Ok(GetFilesetResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFilesetResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3407,6 +3992,21 @@ impl Api for Client { Ok(GetFilesetEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFilesetEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3475,6 +4075,21 @@ impl Api for Client { Ok(GetFilesetHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFilesetHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3539,6 +4154,21 @@ impl Api for Client { Ok(GetFilesetRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFilesetRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3615,6 +4245,21 @@ impl Api for Client { Ok(GetFilesetRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetFilesetRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3694,6 +4339,21 @@ impl Api for Client { Ok(UpdateFilesetResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateFilesetResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3766,6 +4426,21 @@ impl Api for Client { Ok(CreateReleaseResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateReleaseResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3846,6 +4521,21 @@ impl Api for Client { Ok(CreateReleaseBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateReleaseBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3914,6 +4604,21 @@ impl Api for Client { Ok(CreateWorkResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateWorkResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -3982,6 +4687,21 @@ impl Api for Client { Ok(DeleteReleaseResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteReleaseResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4046,6 +4766,21 @@ impl Api for Client { Ok(DeleteReleaseEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteReleaseEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4116,6 +4851,21 @@ impl Api for Client { Ok(GetReleaseResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4180,6 +4930,21 @@ impl Api for Client { Ok(GetReleaseEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4248,6 +5013,21 @@ impl Api for Client { Ok(GetReleaseFilesResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseFilesResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4316,6 +5096,21 @@ impl Api for Client { Ok(GetReleaseFilesetsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseFilesetsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4384,6 +5179,21 @@ impl Api for Client { Ok(GetReleaseHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4448,6 +5258,21 @@ impl Api for Client { Ok(GetReleaseRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4524,6 +5349,21 @@ impl Api for Client { Ok(GetReleaseRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4592,6 +5432,21 @@ impl Api for Client { Ok(GetReleaseWebcapturesResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetReleaseWebcapturesResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4684,6 +5539,21 @@ impl Api for Client { Ok(LookupReleaseResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(LookupReleaseResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4763,6 +5633,21 @@ impl Api for Client { Ok(UpdateReleaseResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateReleaseResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4840,6 +5725,21 @@ impl Api for Client { Ok(CreateWebcaptureResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateWebcaptureResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4920,6 +5820,21 @@ impl Api for Client { Ok(CreateWebcaptureBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateWebcaptureBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -4988,6 +5903,21 @@ impl Api for Client { Ok(DeleteWebcaptureResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteWebcaptureResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5052,6 +5982,21 @@ impl Api for Client { Ok(DeleteWebcaptureEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteWebcaptureEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5122,6 +6067,21 @@ impl Api for Client { Ok(GetWebcaptureResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWebcaptureResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5186,6 +6146,21 @@ impl Api for Client { Ok(GetWebcaptureEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWebcaptureEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5254,6 +6229,21 @@ impl Api for Client { Ok(GetWebcaptureHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWebcaptureHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5318,6 +6308,21 @@ impl Api for Client { Ok(GetWebcaptureRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWebcaptureRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5394,6 +6399,21 @@ impl Api for Client { Ok(GetWebcaptureRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWebcaptureRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5473,6 +6493,21 @@ impl Api for Client { Ok(UpdateWebcaptureResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateWebcaptureResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5553,6 +6588,21 @@ impl Api for Client { Ok(CreateWorkBatchResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(CreateWorkBatchResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5621,6 +6671,21 @@ impl Api for Client { Ok(DeleteWorkResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteWorkResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5685,6 +6750,21 @@ impl Api for Client { Ok(DeleteWorkEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(DeleteWorkEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5755,6 +6835,21 @@ impl Api for Client { Ok(GetWorkResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5819,6 +6914,21 @@ impl Api for Client { Ok(GetWorkEditResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkEditResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5887,6 +6997,21 @@ impl Api for Client { Ok(GetWorkHistoryResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkHistoryResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -5951,6 +7076,21 @@ impl Api for Client { Ok(GetWorkRedirectsResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkRedirectsResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -6019,6 +7159,21 @@ impl Api for Client { Ok(GetWorkReleasesResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkReleasesResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -6095,6 +7250,21 @@ impl Api for Client { Ok(GetWorkRevisionResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(GetWorkRevisionResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -6174,6 +7344,21 @@ impl Api for Client { Ok(UpdateWorkResponse::BadRequest(body)) } + 401 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + let response_www_authenticate = response + .headers + .get::() + .ok_or_else(|| "Required response header WWW_Authenticate for response 401 was not found.")?; + + Ok(UpdateWorkResponse::NotAuthorized { + body: body, + www_authenticate: response_www_authenticate.0.clone(), + }) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs index c54e91ae..16b40999 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -38,6 +38,8 @@ pub enum CreateContainerResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -50,6 +52,8 @@ pub enum CreateContainerBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -62,6 +66,8 @@ pub enum DeleteContainerResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -74,6 +80,8 @@ pub enum DeleteContainerEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -86,6 +94,8 @@ pub enum GetContainerResponse { FoundEntity(models::ContainerEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -98,6 +108,8 @@ pub enum GetContainerEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -110,6 +122,8 @@ pub enum GetContainerHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -122,6 +136,8 @@ pub enum GetContainerRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -134,6 +150,8 @@ pub enum GetContainerRevisionResponse { FoundEntityRevision(models::ContainerEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -146,6 +164,8 @@ pub enum LookupContainerResponse { FoundEntity(models::ContainerEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -158,6 +178,8 @@ pub enum UpdateContainerResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -170,6 +192,8 @@ pub enum CreateCreatorResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -182,6 +206,8 @@ pub enum CreateCreatorBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -194,6 +220,8 @@ pub enum DeleteCreatorResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -206,6 +234,8 @@ pub enum DeleteCreatorEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -218,6 +248,8 @@ pub enum GetCreatorResponse { FoundEntity(models::CreatorEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -230,6 +262,8 @@ pub enum GetCreatorEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -242,6 +276,8 @@ pub enum GetCreatorHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -254,6 +290,8 @@ pub enum GetCreatorRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -266,6 +304,8 @@ pub enum GetCreatorReleasesResponse { Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -278,6 +318,8 @@ pub enum GetCreatorRevisionResponse { FoundEntityRevision(models::CreatorEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -290,6 +332,8 @@ pub enum LookupCreatorResponse { FoundEntity(models::CreatorEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -302,6 +346,8 @@ pub enum UpdateCreatorResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -392,6 +438,8 @@ pub enum CreateFileResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -404,6 +452,8 @@ pub enum CreateFileBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -416,6 +466,8 @@ pub enum DeleteFileResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -428,6 +480,8 @@ pub enum DeleteFileEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -440,6 +494,8 @@ pub enum GetFileResponse { FoundEntity(models::FileEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -452,6 +508,8 @@ pub enum GetFileEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -464,6 +522,8 @@ pub enum GetFileHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -476,6 +536,8 @@ pub enum GetFileRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -488,6 +550,8 @@ pub enum GetFileRevisionResponse { FoundEntityRevision(models::FileEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -500,6 +564,8 @@ pub enum LookupFileResponse { FoundEntity(models::FileEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -512,6 +578,8 @@ pub enum UpdateFileResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -524,6 +592,8 @@ pub enum CreateFilesetResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -536,6 +606,8 @@ pub enum CreateFilesetBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -548,6 +620,8 @@ pub enum DeleteFilesetResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -560,6 +634,8 @@ pub enum DeleteFilesetEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -572,6 +648,8 @@ pub enum GetFilesetResponse { FoundEntity(models::FilesetEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -584,6 +662,8 @@ pub enum GetFilesetEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -596,6 +676,8 @@ pub enum GetFilesetHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -608,6 +690,8 @@ pub enum GetFilesetRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -620,6 +704,8 @@ pub enum GetFilesetRevisionResponse { FoundEntityRevision(models::FilesetEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -632,6 +718,8 @@ pub enum UpdateFilesetResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -644,6 +732,8 @@ pub enum CreateReleaseResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -656,6 +746,8 @@ pub enum CreateReleaseBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -668,6 +760,8 @@ pub enum CreateWorkResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -680,6 +774,8 @@ pub enum DeleteReleaseResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -692,6 +788,8 @@ pub enum DeleteReleaseEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -704,6 +802,8 @@ pub enum GetReleaseResponse { FoundEntity(models::ReleaseEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -716,6 +816,8 @@ pub enum GetReleaseEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -728,6 +830,8 @@ pub enum GetReleaseFilesResponse { Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -740,6 +844,8 @@ pub enum GetReleaseFilesetsResponse { Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -752,6 +858,8 @@ pub enum GetReleaseHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -764,6 +872,8 @@ pub enum GetReleaseRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -776,6 +886,8 @@ pub enum GetReleaseRevisionResponse { FoundEntityRevision(models::ReleaseEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -788,6 +900,8 @@ pub enum GetReleaseWebcapturesResponse { Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -800,6 +914,8 @@ pub enum LookupReleaseResponse { FoundEntity(models::ReleaseEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -812,6 +928,8 @@ pub enum UpdateReleaseResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -824,6 +942,8 @@ pub enum CreateWebcaptureResponse { CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -836,6 +956,8 @@ pub enum CreateWebcaptureBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -848,6 +970,8 @@ pub enum DeleteWebcaptureResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -860,6 +984,8 @@ pub enum DeleteWebcaptureEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -872,6 +998,8 @@ pub enum GetWebcaptureResponse { FoundEntity(models::WebcaptureEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -884,6 +1012,8 @@ pub enum GetWebcaptureEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -896,6 +1026,8 @@ pub enum GetWebcaptureHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -908,6 +1040,8 @@ pub enum GetWebcaptureRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -920,6 +1054,8 @@ pub enum GetWebcaptureRevisionResponse { FoundEntityRevision(models::WebcaptureEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -932,6 +1068,8 @@ pub enum UpdateWebcaptureResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -944,6 +1082,8 @@ pub enum CreateWorkBatchResponse { CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -956,6 +1096,8 @@ pub enum DeleteWorkResponse { DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -968,6 +1110,8 @@ pub enum DeleteWorkEditResponse { DeletedEdit(models::Success), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -980,6 +1124,8 @@ pub enum GetWorkResponse { FoundEntity(models::WorkEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -992,6 +1138,8 @@ pub enum GetWorkEditResponse { FoundEdit(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -1004,6 +1152,8 @@ pub enum GetWorkHistoryResponse { FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -1016,6 +1166,8 @@ pub enum GetWorkRedirectsResponse { FoundEntityRedirects(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -1028,6 +1180,8 @@ pub enum GetWorkReleasesResponse { Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -1040,6 +1194,8 @@ pub enum GetWorkRevisionResponse { FoundEntityRevision(models::WorkEntity), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -1052,6 +1208,8 @@ pub enum UpdateWorkResponse { UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, /// Not Found NotFound(models::ErrorResponse), /// Generic Error diff --git a/rust/fatcat-api-spec/src/mimetypes.rs b/rust/fatcat-api-spec/src/mimetypes.rs index e0683dbb..772a1066 100644 --- a/rust/fatcat-api-spec/src/mimetypes.rs +++ b/rust/fatcat-api-spec/src/mimetypes.rs @@ -13,6 +13,10 @@ pub mod responses { pub static ref CREATE_CONTAINER_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateContainer + lazy_static! { + pub static ref CREATE_CONTAINER_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateContainer lazy_static! { pub static ref CREATE_CONTAINER_NOT_FOUND: Mime = mime!(Application / Json); } @@ -29,6 +33,10 @@ pub mod responses { pub static ref CREATE_CONTAINER_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateContainerBatch + lazy_static! { + pub static ref CREATE_CONTAINER_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateContainerBatch lazy_static! { pub static ref CREATE_CONTAINER_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -45,6 +53,10 @@ pub mod responses { pub static ref DELETE_CONTAINER_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteContainer + lazy_static! { + pub static ref DELETE_CONTAINER_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteContainer lazy_static! { pub static ref DELETE_CONTAINER_NOT_FOUND: Mime = mime!(Application / Json); } @@ -61,6 +73,10 @@ pub mod responses { pub static ref DELETE_CONTAINER_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteContainerEdit + lazy_static! { + pub static ref DELETE_CONTAINER_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteContainerEdit lazy_static! { pub static ref DELETE_CONTAINER_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -77,6 +93,10 @@ pub mod responses { pub static ref GET_CONTAINER_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetContainer + lazy_static! { + pub static ref GET_CONTAINER_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetContainer lazy_static! { pub static ref GET_CONTAINER_NOT_FOUND: Mime = mime!(Application / Json); } @@ -93,6 +113,10 @@ pub mod responses { pub static ref GET_CONTAINER_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetContainerEdit + lazy_static! { + pub static ref GET_CONTAINER_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetContainerEdit lazy_static! { pub static ref GET_CONTAINER_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -109,6 +133,10 @@ pub mod responses { pub static ref GET_CONTAINER_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetContainerHistory + lazy_static! { + pub static ref GET_CONTAINER_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetContainerHistory lazy_static! { pub static ref GET_CONTAINER_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -125,6 +153,10 @@ pub mod responses { pub static ref GET_CONTAINER_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetContainerRedirects + lazy_static! { + pub static ref GET_CONTAINER_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetContainerRedirects lazy_static! { pub static ref GET_CONTAINER_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -141,6 +173,10 @@ pub mod responses { pub static ref GET_CONTAINER_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetContainerRevision + lazy_static! { + pub static ref GET_CONTAINER_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetContainerRevision lazy_static! { pub static ref GET_CONTAINER_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -157,6 +193,10 @@ pub mod responses { pub static ref LOOKUP_CONTAINER_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for LookupContainer + lazy_static! { + pub static ref LOOKUP_CONTAINER_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for LookupContainer lazy_static! { pub static ref LOOKUP_CONTAINER_NOT_FOUND: Mime = mime!(Application / Json); } @@ -173,6 +213,10 @@ pub mod responses { pub static ref UPDATE_CONTAINER_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateContainer + lazy_static! { + pub static ref UPDATE_CONTAINER_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateContainer lazy_static! { pub static ref UPDATE_CONTAINER_NOT_FOUND: Mime = mime!(Application / Json); } @@ -189,6 +233,10 @@ pub mod responses { pub static ref CREATE_CREATOR_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateCreator + lazy_static! { + pub static ref CREATE_CREATOR_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateCreator lazy_static! { pub static ref CREATE_CREATOR_NOT_FOUND: Mime = mime!(Application / Json); } @@ -205,6 +253,10 @@ pub mod responses { pub static ref CREATE_CREATOR_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateCreatorBatch + lazy_static! { + pub static ref CREATE_CREATOR_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateCreatorBatch lazy_static! { pub static ref CREATE_CREATOR_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -221,6 +273,10 @@ pub mod responses { pub static ref DELETE_CREATOR_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteCreator + lazy_static! { + pub static ref DELETE_CREATOR_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteCreator lazy_static! { pub static ref DELETE_CREATOR_NOT_FOUND: Mime = mime!(Application / Json); } @@ -237,6 +293,10 @@ pub mod responses { pub static ref DELETE_CREATOR_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteCreatorEdit + lazy_static! { + pub static ref DELETE_CREATOR_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteCreatorEdit lazy_static! { pub static ref DELETE_CREATOR_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -253,6 +313,10 @@ pub mod responses { pub static ref GET_CREATOR_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreator + lazy_static! { + pub static ref GET_CREATOR_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreator lazy_static! { pub static ref GET_CREATOR_NOT_FOUND: Mime = mime!(Application / Json); } @@ -269,6 +333,10 @@ pub mod responses { pub static ref GET_CREATOR_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreatorEdit + lazy_static! { + pub static ref GET_CREATOR_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreatorEdit lazy_static! { pub static ref GET_CREATOR_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -285,6 +353,10 @@ pub mod responses { pub static ref GET_CREATOR_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreatorHistory + lazy_static! { + pub static ref GET_CREATOR_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreatorHistory lazy_static! { pub static ref GET_CREATOR_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -301,6 +373,10 @@ pub mod responses { pub static ref GET_CREATOR_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreatorRedirects + lazy_static! { + pub static ref GET_CREATOR_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreatorRedirects lazy_static! { pub static ref GET_CREATOR_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -317,6 +393,10 @@ pub mod responses { pub static ref GET_CREATOR_RELEASES_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreatorReleases + lazy_static! { + pub static ref GET_CREATOR_RELEASES_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreatorReleases lazy_static! { pub static ref GET_CREATOR_RELEASES_NOT_FOUND: Mime = mime!(Application / Json); } @@ -333,6 +413,10 @@ pub mod responses { pub static ref GET_CREATOR_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetCreatorRevision + lazy_static! { + pub static ref GET_CREATOR_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetCreatorRevision lazy_static! { pub static ref GET_CREATOR_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -349,6 +433,10 @@ pub mod responses { pub static ref LOOKUP_CREATOR_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for LookupCreator + lazy_static! { + pub static ref LOOKUP_CREATOR_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for LookupCreator lazy_static! { pub static ref LOOKUP_CREATOR_NOT_FOUND: Mime = mime!(Application / Json); } @@ -365,6 +453,10 @@ pub mod responses { pub static ref UPDATE_CREATOR_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateCreator + lazy_static! { + pub static ref UPDATE_CREATOR_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateCreator lazy_static! { pub static ref UPDATE_CREATOR_NOT_FOUND: Mime = mime!(Application / Json); } @@ -481,6 +573,10 @@ pub mod responses { pub static ref CREATE_FILE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateFile + lazy_static! { + pub static ref CREATE_FILE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateFile lazy_static! { pub static ref CREATE_FILE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -497,6 +593,10 @@ pub mod responses { pub static ref CREATE_FILE_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateFileBatch + lazy_static! { + pub static ref CREATE_FILE_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateFileBatch lazy_static! { pub static ref CREATE_FILE_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -513,6 +613,10 @@ pub mod responses { pub static ref DELETE_FILE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteFile + lazy_static! { + pub static ref DELETE_FILE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteFile lazy_static! { pub static ref DELETE_FILE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -529,6 +633,10 @@ pub mod responses { pub static ref DELETE_FILE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteFileEdit + lazy_static! { + pub static ref DELETE_FILE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteFileEdit lazy_static! { pub static ref DELETE_FILE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -545,6 +653,10 @@ pub mod responses { pub static ref GET_FILE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFile + lazy_static! { + pub static ref GET_FILE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFile lazy_static! { pub static ref GET_FILE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -561,6 +673,10 @@ pub mod responses { pub static ref GET_FILE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFileEdit + lazy_static! { + pub static ref GET_FILE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFileEdit lazy_static! { pub static ref GET_FILE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -577,6 +693,10 @@ pub mod responses { pub static ref GET_FILE_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFileHistory + lazy_static! { + pub static ref GET_FILE_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFileHistory lazy_static! { pub static ref GET_FILE_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -593,6 +713,10 @@ pub mod responses { pub static ref GET_FILE_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFileRedirects + lazy_static! { + pub static ref GET_FILE_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFileRedirects lazy_static! { pub static ref GET_FILE_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -609,6 +733,10 @@ pub mod responses { pub static ref GET_FILE_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFileRevision + lazy_static! { + pub static ref GET_FILE_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFileRevision lazy_static! { pub static ref GET_FILE_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -625,6 +753,10 @@ pub mod responses { pub static ref LOOKUP_FILE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for LookupFile + lazy_static! { + pub static ref LOOKUP_FILE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for LookupFile lazy_static! { pub static ref LOOKUP_FILE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -641,6 +773,10 @@ pub mod responses { pub static ref UPDATE_FILE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateFile + lazy_static! { + pub static ref UPDATE_FILE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateFile lazy_static! { pub static ref UPDATE_FILE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -657,6 +793,10 @@ pub mod responses { pub static ref CREATE_FILESET_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateFileset + lazy_static! { + pub static ref CREATE_FILESET_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateFileset lazy_static! { pub static ref CREATE_FILESET_NOT_FOUND: Mime = mime!(Application / Json); } @@ -673,6 +813,10 @@ pub mod responses { pub static ref CREATE_FILESET_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateFilesetBatch + lazy_static! { + pub static ref CREATE_FILESET_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateFilesetBatch lazy_static! { pub static ref CREATE_FILESET_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -689,6 +833,10 @@ pub mod responses { pub static ref DELETE_FILESET_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteFileset + lazy_static! { + pub static ref DELETE_FILESET_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteFileset lazy_static! { pub static ref DELETE_FILESET_NOT_FOUND: Mime = mime!(Application / Json); } @@ -705,6 +853,10 @@ pub mod responses { pub static ref DELETE_FILESET_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteFilesetEdit + lazy_static! { + pub static ref DELETE_FILESET_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteFilesetEdit lazy_static! { pub static ref DELETE_FILESET_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -721,6 +873,10 @@ pub mod responses { pub static ref GET_FILESET_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFileset + lazy_static! { + pub static ref GET_FILESET_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFileset lazy_static! { pub static ref GET_FILESET_NOT_FOUND: Mime = mime!(Application / Json); } @@ -737,6 +893,10 @@ pub mod responses { pub static ref GET_FILESET_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFilesetEdit + lazy_static! { + pub static ref GET_FILESET_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFilesetEdit lazy_static! { pub static ref GET_FILESET_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -753,6 +913,10 @@ pub mod responses { pub static ref GET_FILESET_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFilesetHistory + lazy_static! { + pub static ref GET_FILESET_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFilesetHistory lazy_static! { pub static ref GET_FILESET_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -769,6 +933,10 @@ pub mod responses { pub static ref GET_FILESET_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFilesetRedirects + lazy_static! { + pub static ref GET_FILESET_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFilesetRedirects lazy_static! { pub static ref GET_FILESET_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -785,6 +953,10 @@ pub mod responses { pub static ref GET_FILESET_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetFilesetRevision + lazy_static! { + pub static ref GET_FILESET_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetFilesetRevision lazy_static! { pub static ref GET_FILESET_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -801,6 +973,10 @@ pub mod responses { pub static ref UPDATE_FILESET_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateFileset + lazy_static! { + pub static ref UPDATE_FILESET_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateFileset lazy_static! { pub static ref UPDATE_FILESET_NOT_FOUND: Mime = mime!(Application / Json); } @@ -817,6 +993,10 @@ pub mod responses { pub static ref CREATE_RELEASE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateRelease + lazy_static! { + pub static ref CREATE_RELEASE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateRelease lazy_static! { pub static ref CREATE_RELEASE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -833,6 +1013,10 @@ pub mod responses { pub static ref CREATE_RELEASE_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateReleaseBatch + lazy_static! { + pub static ref CREATE_RELEASE_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateReleaseBatch lazy_static! { pub static ref CREATE_RELEASE_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -849,6 +1033,10 @@ pub mod responses { pub static ref CREATE_WORK_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateWork + lazy_static! { + pub static ref CREATE_WORK_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateWork lazy_static! { pub static ref CREATE_WORK_NOT_FOUND: Mime = mime!(Application / Json); } @@ -865,6 +1053,10 @@ pub mod responses { pub static ref DELETE_RELEASE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteRelease + lazy_static! { + pub static ref DELETE_RELEASE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteRelease lazy_static! { pub static ref DELETE_RELEASE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -881,6 +1073,10 @@ pub mod responses { pub static ref DELETE_RELEASE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteReleaseEdit + lazy_static! { + pub static ref DELETE_RELEASE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteReleaseEdit lazy_static! { pub static ref DELETE_RELEASE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -897,6 +1093,10 @@ pub mod responses { pub static ref GET_RELEASE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetRelease + lazy_static! { + pub static ref GET_RELEASE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetRelease lazy_static! { pub static ref GET_RELEASE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -913,6 +1113,10 @@ pub mod responses { pub static ref GET_RELEASE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseEdit + lazy_static! { + pub static ref GET_RELEASE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseEdit lazy_static! { pub static ref GET_RELEASE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -929,6 +1133,10 @@ pub mod responses { pub static ref GET_RELEASE_FILES_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseFiles + lazy_static! { + pub static ref GET_RELEASE_FILES_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseFiles lazy_static! { pub static ref GET_RELEASE_FILES_NOT_FOUND: Mime = mime!(Application / Json); } @@ -945,6 +1153,10 @@ pub mod responses { pub static ref GET_RELEASE_FILESETS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseFilesets + lazy_static! { + pub static ref GET_RELEASE_FILESETS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseFilesets lazy_static! { pub static ref GET_RELEASE_FILESETS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -961,6 +1173,10 @@ pub mod responses { pub static ref GET_RELEASE_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseHistory + lazy_static! { + pub static ref GET_RELEASE_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseHistory lazy_static! { pub static ref GET_RELEASE_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -977,6 +1193,10 @@ pub mod responses { pub static ref GET_RELEASE_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseRedirects + lazy_static! { + pub static ref GET_RELEASE_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseRedirects lazy_static! { pub static ref GET_RELEASE_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -993,6 +1213,10 @@ pub mod responses { pub static ref GET_RELEASE_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseRevision + lazy_static! { + pub static ref GET_RELEASE_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseRevision lazy_static! { pub static ref GET_RELEASE_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1009,6 +1233,10 @@ pub mod responses { pub static ref GET_RELEASE_WEBCAPTURES_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetReleaseWebcaptures + lazy_static! { + pub static ref GET_RELEASE_WEBCAPTURES_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetReleaseWebcaptures lazy_static! { pub static ref GET_RELEASE_WEBCAPTURES_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1025,6 +1253,10 @@ pub mod responses { pub static ref LOOKUP_RELEASE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for LookupRelease + lazy_static! { + pub static ref LOOKUP_RELEASE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for LookupRelease lazy_static! { pub static ref LOOKUP_RELEASE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1041,6 +1273,10 @@ pub mod responses { pub static ref UPDATE_RELEASE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateRelease + lazy_static! { + pub static ref UPDATE_RELEASE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateRelease lazy_static! { pub static ref UPDATE_RELEASE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1057,6 +1293,10 @@ pub mod responses { pub static ref CREATE_WEBCAPTURE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateWebcapture + lazy_static! { + pub static ref CREATE_WEBCAPTURE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateWebcapture lazy_static! { pub static ref CREATE_WEBCAPTURE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1073,6 +1313,10 @@ pub mod responses { pub static ref CREATE_WEBCAPTURE_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateWebcaptureBatch + lazy_static! { + pub static ref CREATE_WEBCAPTURE_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateWebcaptureBatch lazy_static! { pub static ref CREATE_WEBCAPTURE_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1089,6 +1333,10 @@ pub mod responses { pub static ref DELETE_WEBCAPTURE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteWebcapture + lazy_static! { + pub static ref DELETE_WEBCAPTURE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteWebcapture lazy_static! { pub static ref DELETE_WEBCAPTURE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1105,6 +1353,10 @@ pub mod responses { pub static ref DELETE_WEBCAPTURE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteWebcaptureEdit + lazy_static! { + pub static ref DELETE_WEBCAPTURE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteWebcaptureEdit lazy_static! { pub static ref DELETE_WEBCAPTURE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1121,6 +1373,10 @@ pub mod responses { pub static ref GET_WEBCAPTURE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWebcapture + lazy_static! { + pub static ref GET_WEBCAPTURE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWebcapture lazy_static! { pub static ref GET_WEBCAPTURE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1137,6 +1393,10 @@ pub mod responses { pub static ref GET_WEBCAPTURE_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWebcaptureEdit + lazy_static! { + pub static ref GET_WEBCAPTURE_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWebcaptureEdit lazy_static! { pub static ref GET_WEBCAPTURE_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1153,6 +1413,10 @@ pub mod responses { pub static ref GET_WEBCAPTURE_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWebcaptureHistory + lazy_static! { + pub static ref GET_WEBCAPTURE_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWebcaptureHistory lazy_static! { pub static ref GET_WEBCAPTURE_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1169,6 +1433,10 @@ pub mod responses { pub static ref GET_WEBCAPTURE_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWebcaptureRedirects + lazy_static! { + pub static ref GET_WEBCAPTURE_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWebcaptureRedirects lazy_static! { pub static ref GET_WEBCAPTURE_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1185,6 +1453,10 @@ pub mod responses { pub static ref GET_WEBCAPTURE_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWebcaptureRevision + lazy_static! { + pub static ref GET_WEBCAPTURE_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWebcaptureRevision lazy_static! { pub static ref GET_WEBCAPTURE_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1201,6 +1473,10 @@ pub mod responses { pub static ref UPDATE_WEBCAPTURE_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateWebcapture + lazy_static! { + pub static ref UPDATE_WEBCAPTURE_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateWebcapture lazy_static! { pub static ref UPDATE_WEBCAPTURE_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1217,6 +1493,10 @@ pub mod responses { pub static ref CREATE_WORK_BATCH_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for CreateWorkBatch + lazy_static! { + pub static ref CREATE_WORK_BATCH_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for CreateWorkBatch lazy_static! { pub static ref CREATE_WORK_BATCH_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1233,6 +1513,10 @@ pub mod responses { pub static ref DELETE_WORK_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteWork + lazy_static! { + pub static ref DELETE_WORK_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteWork lazy_static! { pub static ref DELETE_WORK_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1249,6 +1533,10 @@ pub mod responses { pub static ref DELETE_WORK_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for DeleteWorkEdit + lazy_static! { + pub static ref DELETE_WORK_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for DeleteWorkEdit lazy_static! { pub static ref DELETE_WORK_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1265,6 +1553,10 @@ pub mod responses { pub static ref GET_WORK_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWork + lazy_static! { + pub static ref GET_WORK_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWork lazy_static! { pub static ref GET_WORK_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1281,6 +1573,10 @@ pub mod responses { pub static ref GET_WORK_EDIT_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWorkEdit + lazy_static! { + pub static ref GET_WORK_EDIT_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWorkEdit lazy_static! { pub static ref GET_WORK_EDIT_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1297,6 +1593,10 @@ pub mod responses { pub static ref GET_WORK_HISTORY_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWorkHistory + lazy_static! { + pub static ref GET_WORK_HISTORY_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWorkHistory lazy_static! { pub static ref GET_WORK_HISTORY_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1313,6 +1613,10 @@ pub mod responses { pub static ref GET_WORK_REDIRECTS_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWorkRedirects + lazy_static! { + pub static ref GET_WORK_REDIRECTS_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWorkRedirects lazy_static! { pub static ref GET_WORK_REDIRECTS_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1329,6 +1633,10 @@ pub mod responses { pub static ref GET_WORK_RELEASES_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWorkReleases + lazy_static! { + pub static ref GET_WORK_RELEASES_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWorkReleases lazy_static! { pub static ref GET_WORK_RELEASES_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1345,6 +1653,10 @@ pub mod responses { pub static ref GET_WORK_REVISION_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for GetWorkRevision + lazy_static! { + pub static ref GET_WORK_REVISION_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for GetWorkRevision lazy_static! { pub static ref GET_WORK_REVISION_NOT_FOUND: Mime = mime!(Application / Json); } @@ -1361,6 +1673,10 @@ pub mod responses { pub static ref UPDATE_WORK_BAD_REQUEST: Mime = mime!(Application / Json); } /// Create Mime objects for the response content types for UpdateWork + lazy_static! { + pub static ref UPDATE_WORK_NOT_AUTHORIZED: Mime = mime!(Application / Json); + } + /// Create Mime objects for the response content types for UpdateWork lazy_static! { pub static ref UPDATE_WORK_NOT_FOUND: Mime = mime!(Application / Json); } diff --git a/rust/fatcat-api-spec/src/server.rs b/rust/fatcat-api-spec/src/server.rs index 0576bfc7..076652bb 100644 --- a/rust/fatcat-api-spec/src/server.rs +++ b/rust/fatcat-api-spec/src/server.rs @@ -111,6 +111,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -166,6 +168,21 @@ where } Ok(response) } + CreateContainerResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_CONTAINER_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateContainerResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -222,6 +239,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -278,6 +297,21 @@ where } Ok(response) } + CreateContainerBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_CONTAINER_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateContainerBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -334,6 +368,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -375,6 +411,19 @@ where Ok(response) } + DeleteContainerResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_CONTAINER_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteContainerResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -464,6 +513,19 @@ where Ok(response) } + DeleteContainerEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_CONTAINER_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteContainerEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -558,6 +620,19 @@ where Ok(response) } + GetContainerResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetContainerResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -647,6 +722,19 @@ where Ok(response) } + GetContainerEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetContainerEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -740,6 +828,19 @@ where Ok(response) } + GetContainerHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetContainerHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -829,6 +930,19 @@ where Ok(response) } + GetContainerRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetContainerRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -923,6 +1037,19 @@ where Ok(response) } + GetContainerRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetContainerRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1004,6 +1131,19 @@ where Ok(response) } + LookupContainerResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::LOOKUP_CONTAINER_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } LookupContainerResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1056,6 +1196,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -1126,6 +1268,21 @@ where } Ok(response) } + UpdateContainerResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_CONTAINER_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateContainerResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1182,6 +1339,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -1237,6 +1396,21 @@ where } Ok(response) } + CreateCreatorResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_CREATOR_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateCreatorResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1293,6 +1467,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -1349,6 +1525,21 @@ where } Ok(response) } + CreateCreatorBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_CREATOR_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateCreatorBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1405,6 +1596,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -1446,6 +1639,19 @@ where Ok(response) } + DeleteCreatorResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_CREATOR_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteCreatorResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1535,6 +1741,19 @@ where Ok(response) } + DeleteCreatorEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_CREATOR_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteCreatorEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1629,6 +1848,19 @@ where Ok(response) } + GetCreatorResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1718,6 +1950,19 @@ where Ok(response) } + GetCreatorEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1811,6 +2056,19 @@ where Ok(response) } + GetCreatorHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1900,6 +2158,19 @@ where Ok(response) } + GetCreatorRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1993,6 +2264,19 @@ where Ok(response) } + GetCreatorReleasesResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_RELEASES_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorReleasesResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2087,6 +2371,19 @@ where Ok(response) } + GetCreatorRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetCreatorRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2168,6 +2465,19 @@ where Ok(response) } + LookupCreatorResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::LOOKUP_CREATOR_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } LookupCreatorResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2220,6 +2530,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -2290,6 +2602,21 @@ where } Ok(response) } + UpdateCreatorResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_CREATOR_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateCreatorResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2944,6 +3271,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -2999,6 +3328,21 @@ where } Ok(response) } + CreateFileResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_FILE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateFileResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3055,6 +3399,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // 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::().unwrap_or_default(); let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); @@ -3111,6 +3457,21 @@ where } Ok(response) } + CreateFileBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_FILE_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateFileBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3167,6 +3528,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -3208,6 +3571,19 @@ where Ok(response) } + DeleteFileResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_FILE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteFileResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3297,6 +3673,19 @@ where Ok(response) } + DeleteFileEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_FILE_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteFileEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3391,6 +3780,19 @@ where Ok(response) } + GetFileResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFileResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3480,17 +3882,30 @@ where Ok(response) } - GetFileEditResponse::NotFound(body) => { + GetFileEditResponse::NotAuthorized { body, www_authenticate } => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); - let mut response = Response::with((status::Status::from_u16(404), body_string)); - response.headers.set(ContentType(mimetypes::responses::GET_FILE_EDIT_NOT_FOUND.clone())); + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILE_EDIT_NOT_AUTHORIZED.clone())); context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); Ok(response) } - GetFileEditResponse::GenericError(body) => { + GetFileEditResponse::NotFound(body) => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(404), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_FILE_EDIT_NOT_FOUND.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } + GetFileEditResponse::GenericError(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); let mut response = Response::with((status::Status::from_u16(500), body_string)); @@ -3573,6 +3988,19 @@ where Ok(response) } + GetFileHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILE_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFileHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3662,6 +4090,19 @@ where Ok(response) } + GetFileRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILE_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFileRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3756,6 +4197,19 @@ where Ok(response) } + GetFileRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILE_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFileRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3838,6 +4292,19 @@ where Ok(response) } + LookupFileResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::LOOKUP_FILE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } LookupFileResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3890,6 +4357,8 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + let authorization = context.authorization.as_ref().ok_or_else(|| Response::with((status::Forbidden, "Unauthenticated".to_string())))?; + // Path parameters let param_ident = { let param = req @@ -3960,6 +4429,21 @@ where } Ok(response) } + UpdateFileResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_FILE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateFileResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4071,6 +4555,21 @@ where } Ok(response) } + CreateFilesetResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_FILESET_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateFilesetResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4183,6 +4682,21 @@ where } Ok(response) } + CreateFilesetBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_FILESET_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateFilesetBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4280,6 +4794,19 @@ where Ok(response) } + DeleteFilesetResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_FILESET_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteFilesetResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4369,6 +4896,19 @@ where Ok(response) } + DeleteFilesetEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_FILESET_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteFilesetEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4463,6 +5003,19 @@ where Ok(response) } + GetFilesetResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILESET_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFilesetResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4552,6 +5105,19 @@ where Ok(response) } + GetFilesetEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILESET_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFilesetEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4645,6 +5211,19 @@ where Ok(response) } + GetFilesetHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILESET_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFilesetHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4734,6 +5313,19 @@ where Ok(response) } + GetFilesetRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILESET_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFilesetRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4828,6 +5420,19 @@ where Ok(response) } + GetFilesetRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_FILESET_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetFilesetRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4950,6 +5555,21 @@ where } Ok(response) } + UpdateFilesetResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_FILESET_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateFilesetResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5061,6 +5681,21 @@ where } Ok(response) } + CreateReleaseResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_RELEASE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateReleaseResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5173,6 +5808,21 @@ where } Ok(response) } + CreateReleaseBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_RELEASE_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateReleaseBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5284,6 +5934,21 @@ where } Ok(response) } + CreateWorkResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_WORK_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateWorkResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5381,6 +6046,19 @@ where Ok(response) } + DeleteReleaseResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_RELEASE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteReleaseResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5470,6 +6148,19 @@ where Ok(response) } + DeleteReleaseEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_RELEASE_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteReleaseEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5564,6 +6255,19 @@ where Ok(response) } + GetReleaseResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5653,6 +6357,19 @@ where Ok(response) } + GetReleaseEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5746,6 +6463,19 @@ where Ok(response) } + GetReleaseFilesResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_FILES_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseFilesResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5839,6 +6569,19 @@ where Ok(response) } + GetReleaseFilesetsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_FILESETS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseFilesetsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5932,6 +6675,19 @@ where Ok(response) } + GetReleaseHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6021,6 +6777,19 @@ where Ok(response) } + GetReleaseRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6115,6 +6884,19 @@ where Ok(response) } + GetReleaseRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6208,6 +6990,19 @@ where Ok(response) } + GetReleaseWebcapturesResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_WEBCAPTURES_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetReleaseWebcapturesResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6296,6 +7091,19 @@ where Ok(response) } + LookupReleaseResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::LOOKUP_RELEASE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } LookupReleaseResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6418,6 +7226,21 @@ where } Ok(response) } + UpdateReleaseResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_RELEASE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateReleaseResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6529,6 +7352,21 @@ where } Ok(response) } + CreateWebcaptureResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_WEBCAPTURE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateWebcaptureResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6641,6 +7479,21 @@ where } Ok(response) } + CreateWebcaptureBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_WEBCAPTURE_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateWebcaptureBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6738,6 +7591,19 @@ where Ok(response) } + DeleteWebcaptureResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_WEBCAPTURE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteWebcaptureResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6827,6 +7693,19 @@ where Ok(response) } + DeleteWebcaptureEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_WEBCAPTURE_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteWebcaptureEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6921,6 +7800,19 @@ where Ok(response) } + GetWebcaptureResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WEBCAPTURE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWebcaptureResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7010,6 +7902,19 @@ where Ok(response) } + GetWebcaptureEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WEBCAPTURE_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWebcaptureEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7103,6 +8008,19 @@ where Ok(response) } + GetWebcaptureHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WEBCAPTURE_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWebcaptureHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7192,6 +8110,19 @@ where Ok(response) } + GetWebcaptureRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WEBCAPTURE_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWebcaptureRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7286,6 +8217,19 @@ where Ok(response) } + GetWebcaptureRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WEBCAPTURE_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWebcaptureRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7408,6 +8352,21 @@ where } Ok(response) } + UpdateWebcaptureResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_WEBCAPTURE_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateWebcaptureResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7520,6 +8479,21 @@ where } Ok(response) } + CreateWorkBatchResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::CREATE_WORK_BATCH_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } CreateWorkBatchResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7617,6 +8591,19 @@ where Ok(response) } + DeleteWorkResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_WORK_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteWorkResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7706,6 +8693,19 @@ where Ok(response) } + DeleteWorkEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::DELETE_WORK_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } DeleteWorkEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7800,6 +8800,19 @@ where Ok(response) } + GetWorkResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7889,6 +8902,19 @@ where Ok(response) } + GetWorkEditResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_EDIT_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkEditResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7982,6 +9008,19 @@ where Ok(response) } + GetWorkHistoryResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_HISTORY_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkHistoryResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -8071,6 +9110,19 @@ where Ok(response) } + GetWorkRedirectsResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_REDIRECTS_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkRedirectsResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -8164,6 +9216,19 @@ where Ok(response) } + GetWorkReleasesResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_RELEASES_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkReleasesResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -8258,6 +9323,19 @@ where Ok(response) } + GetWorkRevisionResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::GET_WORK_REVISION_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + } GetWorkRevisionResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -8380,6 +9458,21 @@ where } Ok(response) } + UpdateWorkResponse::NotAuthorized { body, www_authenticate } => { + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(401), body_string)); + header! { (ResponseWwwAuthenticate, "WWW_Authenticate") => [String] } + response.headers.set(ResponseWwwAuthenticate(www_authenticate)); + + response.headers.set(ContentType(mimetypes::responses::UPDATE_WORK_NOT_AUTHORIZED.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + } UpdateWorkResponse::NotFound(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -8427,6 +9520,14 @@ pub struct ExtractAuthData; impl BeforeMiddleware for ExtractAuthData { fn before(&self, req: &mut Request) -> IronResult<()> { + { + header! { (ApiKey1, "Authorization") => [String] } + if let Some(header) = req.headers.get::() { + req.extensions.insert::(AuthData::ApiKey(header.0.clone())); + return Ok(()); + } + } + Ok(()) } } -- cgit v1.2.3