diff --git a/packages/swift-client/Sources/CrateClient/GeneratedSources/Client.swift b/packages/swift-client/Sources/CrateClient/GeneratedSources/Client.swift new file mode 100644 index 0000000..11bc210 --- /dev/null +++ b/packages/swift-client/Sources/CrateClient/GeneratedSources/Client.swift @@ -0,0 +1,4114 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) public import OpenAPIRuntime +#if os(Linux) +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data +@preconcurrency public import struct Foundation.Date +#else +public import struct Foundation.URL +public import struct Foundation.Data +public import struct Foundation.Date +#endif +import HTTPTypes +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } + /// - Remark: HTTP `POST /oauth/login`. + /// - Remark: Generated from `#/paths//oauth/login/post(login)`. + public func login(_ input: Operations.login.Input) async throws -> Operations.login.Output { + try await client.send( + input: input, + forOperation: Operations.login.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/oauth/login", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.login.Output.Ok.Headers = .init(SET_hyphen_COOKIE: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "SET-COOKIE", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.LoginOutput.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.login.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /api/v1/session`. + /// - Remark: Generated from `#/paths//api/v1/session/get(session)`. + public func session(_ input: Operations.session.Input) async throws -> Operations.session.Output { + try await client.send( + input: input, + forOperation: Operations.session.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/session", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Session.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.session.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/logout`. + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)`. + public func logout(_ input: Operations.logout.Input) async throws -> Operations.logout.Output { + try await client.send( + input: input, + forOperation: Operations.logout.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/logout", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + let headers: Operations.logout.Output.NoContent.Headers = .init(SET_hyphen_COOKIE: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "SET-COOKIE", + as: Swift.String.self + )) + return .noContent(.init(headers: headers)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.logout.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)`. + public func listFiles(_ input: Operations.listFiles.Input) async throws -> Operations.listFiles.Output { + try await client.send( + input: input, + forOperation: Operations.listFiles.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "parentId", + value: input.query.parentId + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "trash", + value: input.query.trash + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileList.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listFiles.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)`. + public func createFile(_ input: Operations.createFile.Input) async throws -> Operations.createFile.Output { + try await client.send( + input: input, + forOperation: Operations.createFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.createFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)`. + public func getFile(_ input: Operations.getFile.Input) async throws -> Operations.getFile.Output { + try await client.send( + input: input, + forOperation: Operations.getFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.getFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `PUT /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)`. + public func updateFile(_ input: Operations.updateFile.Input) async throws -> Operations.updateFile.Output { + try await client.send( + input: input, + forOperation: Operations.updateFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.updateFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/duplicate`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)`. + public func duplicateFile(_ input: Operations.duplicateFile.Input) async throws -> Operations.duplicateFile.Output { + try await client.send( + input: input, + forOperation: Operations.duplicateFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/duplicate", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.duplicateFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/trash`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)`. + public func trashFile(_ input: Operations.trashFile.Input) async throws -> Operations.trashFile.Output { + try await client.send( + input: input, + forOperation: Operations.trashFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/trash", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.trashFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)`. + public func restoreFile(_ input: Operations.restoreFile.Input) async throws -> Operations.restoreFile.Output { + try await client.send( + input: input, + forOperation: Operations.restoreFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/restore", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /api/v1/files/{id}/versions`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)`. + public func listVersions(_ input: Operations.listVersions.Input) async throws -> Operations.listVersions.Output { + try await client.send( + input: input, + forOperation: Operations.listVersions.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/versions", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.VersionList.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.listVersions.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/versions/{versionId}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)`. + public func restoreVersion(_ input: Operations.restoreVersion.Input) async throws -> Operations.restoreVersion.Output { + try await client.send( + input: input, + forOperation: Operations.restoreVersion.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/versions/{}/restore", + parameters: [ + input.path.id, + input.path.versionId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .application_json_charset_utf_hyphen_8(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.restoreVersion.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /api/v1/files/upload`. + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)`. + public func uploadFile(_ input: Operations.uploadFile.Input) async throws -> Operations.uploadFile.Output { + try await client.send( + input: input, + forOperation: Operations.uploadFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/upload", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "name", + value: input.query.name + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "parentId", + value: input.query.parentId + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "mimeType", + value: input.query.mimeType + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .binary(value): + body = try converter.setRequiredRequestBodyAsBinary( + value, + headerFields: &request.headerFields, + contentType: "application/octet-stream" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.uploadFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)`. + public func downloadFile(_ input: Operations.downloadFile.Input) async throws -> Operations.downloadFile.Output { + try await client.send( + input: input, + forOperation: Operations.downloadFile.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/content", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setHeaderFieldAsURI( + in: &request.headerFields, + name: "Range", + value: input.headers.Range + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.downloadFile.Output.Ok.Headers = .init( + CONTENT_hyphen_DISPOSITION: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "CONTENT-DISPOSITION", + as: Swift.String.self + ), + ETAG: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "ETAG", + as: Swift.String.self + ) + ) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/octet-stream" + ] + ) + switch chosenContentType { + case "application/octet-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .binary(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 206: + let headers: Operations.downloadFile.Output.PartialContent.Headers = .init( + CONTENT_hyphen_DISPOSITION: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "CONTENT-DISPOSITION", + as: Swift.String.self + ), + ETAG: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "ETAG", + as: Swift.String.self + ), + CONTENT_hyphen_RANGE: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "CONTENT-RANGE", + as: Swift.String.self + ) + ) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.PartialContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/octet-stream" + ] + ) + switch chosenContentType { + case "application/octet-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .binary(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .partialContent(.init( + headers: headers, + body: body + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 416: + let headers: Operations.downloadFile.Output.RangeNotSatisfiable.Headers = .init(CONTENT_hyphen_RANGE: try converter.getRequiredHeaderFieldAsURI( + in: response.headerFields, + name: "CONTENT-RANGE", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.RangeNotSatisfiable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .rangeNotSatisfiable(.init( + headers: headers, + body: body + )) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.downloadFile.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `PUT /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)`. + public func replaceContent(_ input: Operations.replaceContent.Input) async throws -> Operations.replaceContent.Output { + try await client.send( + input: input, + forOperation: Operations.replaceContent.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/api/v1/files/{}/content", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "revision", + value: input.query.revision + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "mimeType", + value: input.query.mimeType + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .binary(value): + body = try converter.setRequiredRequestBodyAsBinary( + value, + headerFields: &request.headerFields, + contentType: "application/octet-stream" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.FileEntry.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 502: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.BadGateway.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badGateway(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.replaceContent.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json; charset=utf-8" + ] + ) + switch chosenContentType { + case "application/json; charset=utf-8": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ErrorBody.self, + from: responseBody, + transforming: { value in + .application_json_charset_utf_hyphen_8(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/packages/swift-client/Sources/CrateClient/GeneratedSources/Types+Operations.swift b/packages/swift-client/Sources/CrateClient/GeneratedSources/Types+Operations.swift new file mode 100644 index 0000000..583fbd1 --- /dev/null +++ b/packages/swift-client/Sources/CrateClient/GeneratedSources/Types+Operations.swift @@ -0,0 +1,9056 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) public import OpenAPIRuntime +#if os(Linux) +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data +@preconcurrency public import struct Foundation.Date +#else +public import struct Foundation.URL +public import struct Foundation.Data +public import struct Foundation.Date +#endif +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// - Remark: HTTP `POST /oauth/login`. + /// - Remark: Generated from `#/paths//oauth/login/post(login)`. + public enum login { + public static let id: Swift.String = "login" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.login.Input.Headers + /// - Remark: Generated from `#/paths/oauth/login/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.LoginInput) + } + public var body: Operations.login.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.login.Input.Headers = .init(), + body: Operations.login.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/200/headers/SET-COOKIE`. + public var SET_hyphen_COOKIE: Swift.String + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - SET_hyphen_COOKIE: + public init(SET_hyphen_COOKIE: Swift.String) { + self.SET_hyphen_COOKIE = SET_hyphen_COOKIE + } + } + /// Received HTTP response headers + public var headers: Operations.login.Output.Ok.Headers + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.LoginOutput) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.LoginOutput { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.login.Output.Ok.Headers, + body: Operations.login.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.login.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.login.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.login.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.login.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.login.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.login.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.login.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.login.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.login.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.login.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.login.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.login.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.login.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.login.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.login.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.login.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.login.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.login.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/oauth/login/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.login.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.login.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//oauth/login/post(login)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.login.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.login.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `GET /api/v1/session`. + /// - Remark: Generated from `#/paths//api/v1/session/get(session)`. + public enum session { + public static let id: Swift.String = "session" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.session.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + public init(headers: Operations.session.Input.Headers = .init()) { + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.Session) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.Session { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.session.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.session.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.session.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.session.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.session.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.session.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.session.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.session.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.session.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.session.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.session.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.session.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.session.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.session.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.session.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.session.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.session.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.session.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/session/GET/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.session.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.session.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/session/get(session)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.session.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.session.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/logout`. + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)`. + public enum logout { + public static let id: Swift.String = "logout" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.logout.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + public init(headers: Operations.logout.Input.Headers = .init()) { + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/204/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/204/headers/SET-COOKIE`. + public var SET_hyphen_COOKIE: Swift.String + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - SET_hyphen_COOKIE: + public init(SET_hyphen_COOKIE: Swift.String) { + self.SET_hyphen_COOKIE = SET_hyphen_COOKIE + } + } + /// Received HTTP response headers + public var headers: Operations.logout.Output.NoContent.Headers + /// Creates a new `NoContent`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + public init(headers: Operations.logout.Output.NoContent.Headers) { + self.headers = headers + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.logout.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.logout.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.logout.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.logout.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.logout.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.logout.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.logout.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.logout.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.logout.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.logout.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.logout.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.logout.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.logout.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.logout.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.logout.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.logout.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.logout.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.logout.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/logout/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.logout.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.logout.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.logout.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.logout.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `GET /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)`. + public enum listFiles { + public static let id: Swift.String = "listFiles" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/query/parentId`. + public var parentId: Swift.String? + /// - Remark: Generated from `#/paths/api/v1/files/GET/query/trash`. + public var trash: Swift.Bool? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - parentId: + /// - trash: + public init( + parentId: Swift.String? = nil, + trash: Swift.Bool? = nil + ) { + self.parentId = parentId + self.trash = trash + } + } + public var query: Operations.listFiles.Input.Query + /// - Remark: Generated from `#/paths/api/v1/files/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.listFiles.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - query: + /// - headers: + public init( + query: Operations.listFiles.Input.Query = .init(), + headers: Operations.listFiles.Input.Headers = .init() + ) { + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileList) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileList { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.listFiles.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.listFiles.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.listFiles.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.listFiles.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.listFiles.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.listFiles.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.listFiles.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.listFiles.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.listFiles.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.listFiles.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.listFiles.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.listFiles.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.listFiles.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.listFiles.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.listFiles.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.listFiles.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.listFiles.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.listFiles.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/GET/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listFiles.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listFiles.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.listFiles.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.listFiles.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)`. + public enum createFile { + public static let id: Swift.String = "createFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.createFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.CreateFile) + } + public var body: Operations.createFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.createFile.Input.Headers = .init(), + body: Operations.createFile.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.createFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.createFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.createFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.createFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.createFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.createFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.createFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.createFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.createFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.createFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.createFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.createFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.createFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.createFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.createFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.createFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.createFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.createFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.createFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.createFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.createFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.createFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `GET /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)`. + public enum getFile { + public static let id: Swift.String = "getFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.getFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.getFile.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.getFile.Input.Path, + headers: Operations.getFile.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.getFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.getFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.getFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.getFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.getFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.getFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.getFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.getFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.getFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.getFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.getFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.getFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.getFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.getFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.getFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.getFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.getFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.getFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/GET/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.getFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.getFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.getFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.getFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `PUT /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)`. + public enum updateFile { + public static let id: Swift.String = "updateFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.updateFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.updateFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.UpdateFile) + } + public var body: Operations.updateFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.updateFile.Input.Path, + headers: Operations.updateFile.Input.Headers = .init(), + body: Operations.updateFile.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.updateFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.updateFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.updateFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.updateFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.updateFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.updateFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.updateFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.updateFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.updateFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.updateFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.updateFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.updateFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.updateFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.updateFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.updateFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.updateFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.updateFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.updateFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/PUT/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.updateFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.updateFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.updateFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.updateFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files/{id}/duplicate`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)`. + public enum duplicateFile { + public static let id: Swift.String = "duplicateFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.duplicateFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.duplicateFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.DuplicateFile) + } + public var body: Operations.duplicateFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.duplicateFile.Input.Path, + headers: Operations.duplicateFile.Input.Headers = .init(), + body: Operations.duplicateFile.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.duplicateFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.duplicateFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.duplicateFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.duplicateFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.duplicateFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.duplicateFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.duplicateFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.duplicateFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.duplicateFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.duplicateFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.duplicateFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.duplicateFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.duplicateFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.duplicateFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.duplicateFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.duplicateFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.duplicateFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.duplicateFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/duplicate/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.duplicateFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.duplicateFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.duplicateFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.duplicateFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files/{id}/trash`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)`. + public enum trashFile { + public static let id: Swift.String = "trashFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.trashFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.trashFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.RevisionInput) + } + public var body: Operations.trashFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.trashFile.Input.Path, + headers: Operations.trashFile.Input.Headers = .init(), + body: Operations.trashFile.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.trashFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.trashFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.trashFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.trashFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.trashFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.trashFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.trashFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.trashFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.trashFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.trashFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.trashFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.trashFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.trashFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.trashFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.trashFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.trashFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.trashFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.trashFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/trash/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.trashFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.trashFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.trashFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.trashFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files/{id}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)`. + public enum restoreFile { + public static let id: Swift.String = "restoreFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.restoreFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.restoreFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.RevisionInput) + } + public var body: Operations.restoreFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.restoreFile.Input.Path, + headers: Operations.restoreFile.Input.Headers = .init(), + body: Operations.restoreFile.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.restoreFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.restoreFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.restoreFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.restoreFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.restoreFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.restoreFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.restoreFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.restoreFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.restoreFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.restoreFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.restoreFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.restoreFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.restoreFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.restoreFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.restoreFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.restoreFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.restoreFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.restoreFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/restore/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.restoreFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.restoreFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `GET /api/v1/files/{id}/versions`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)`. + public enum listVersions { + public static let id: Swift.String = "listVersions" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.listVersions.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.listVersions.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.listVersions.Input.Path, + headers: Operations.listVersions.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.VersionList) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.VersionList { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.listVersions.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.listVersions.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.listVersions.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.listVersions.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.listVersions.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.listVersions.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.listVersions.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.listVersions.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.listVersions.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.listVersions.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.listVersions.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.listVersions.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.listVersions.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.listVersions.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.listVersions.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.listVersions.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.listVersions.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.listVersions.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/GET/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.listVersions.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.listVersions.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.listVersions.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.listVersions.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files/{id}/versions/{versionId}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)`. + public enum restoreVersion { + public static let id: Swift.String = "restoreVersion" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/path/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/path/versionId`. + public var versionId: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + /// - versionId: + public init( + id: Swift.String, + versionId: Swift.String + ) { + self.id = id + self.versionId = versionId + } + } + public var path: Operations.restoreVersion.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.restoreVersion.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/requestBody/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.RevisionInput) + } + public var body: Operations.restoreVersion.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.restoreVersion.Input.Path, + headers: Operations.restoreVersion.Input.Headers = .init(), + body: Operations.restoreVersion.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.restoreVersion.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.restoreVersion.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.restoreVersion.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.restoreVersion.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.restoreVersion.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.restoreVersion.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.restoreVersion.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.restoreVersion.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.restoreVersion.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.restoreVersion.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.restoreVersion.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.restoreVersion.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.restoreVersion.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.restoreVersion.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.restoreVersion.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.restoreVersion.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.restoreVersion.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.restoreVersion.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/versions/{versionId}/restore/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.restoreVersion.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.restoreVersion.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.restoreVersion.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.restoreVersion.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `POST /api/v1/files/upload`. + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)`. + public enum uploadFile { + public static let id: Swift.String = "uploadFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/query/name`. + public var name: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/query/parentId`. + public var parentId: Swift.String? + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/query/mimeType`. + public var mimeType: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - name: + /// - parentId: + /// - mimeType: + public init( + name: Swift.String, + parentId: Swift.String? = nil, + mimeType: Swift.String? = nil + ) { + self.name = name + self.parentId = parentId + self.mimeType = mimeType + } + } + public var query: Operations.uploadFile.Input.Query + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.uploadFile.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/requestBody/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + } + public var body: Operations.uploadFile.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - query: + /// - headers: + /// - body: + public init( + query: Operations.uploadFile.Input.Query, + headers: Operations.uploadFile.Input.Headers = .init(), + body: Operations.uploadFile.Input.Body + ) { + self.query = query + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.uploadFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.uploadFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.uploadFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.uploadFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.uploadFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.uploadFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.uploadFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.uploadFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.uploadFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.uploadFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.uploadFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.uploadFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.uploadFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.uploadFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.uploadFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.uploadFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.uploadFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.uploadFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/upload/POST/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.uploadFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.uploadFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.uploadFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.uploadFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `GET /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)`. + public enum downloadFile { + public static let id: Swift.String = "downloadFile" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.downloadFile.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/header`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/header/Range`. + public var Range: Swift.String? + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Range: + /// - accept: + public init( + Range: Swift.String? = nil, + accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues() + ) { + self.Range = Range + self.accept = accept + } + } + public var headers: Operations.downloadFile.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.downloadFile.Input.Path, + headers: Operations.downloadFile.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/200/headers/CONTENT-DISPOSITION`. + public var CONTENT_hyphen_DISPOSITION: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/200/headers/ETAG`. + public var ETAG: Swift.String + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - CONTENT_hyphen_DISPOSITION: + /// - ETAG: + public init( + CONTENT_hyphen_DISPOSITION: Swift.String, + ETAG: Swift.String + ) { + self.CONTENT_hyphen_DISPOSITION = CONTENT_hyphen_DISPOSITION + self.ETAG = ETAG + } + } + /// Received HTTP response headers + public var headers: Operations.downloadFile.Output.Ok.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/200/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.binary`. + /// + /// - Throws: An error if `self` is not `.binary`. + /// - SeeAlso: `.binary`. + public var binary: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .binary(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.downloadFile.Output.Ok.Headers, + body: Operations.downloadFile.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.downloadFile.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.downloadFile.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct PartialContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/headers/CONTENT-DISPOSITION`. + public var CONTENT_hyphen_DISPOSITION: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/headers/ETAG`. + public var ETAG: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/headers/CONTENT-RANGE`. + public var CONTENT_hyphen_RANGE: Swift.String + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - CONTENT_hyphen_DISPOSITION: + /// - ETAG: + /// - CONTENT_hyphen_RANGE: + public init( + CONTENT_hyphen_DISPOSITION: Swift.String, + ETAG: Swift.String, + CONTENT_hyphen_RANGE: Swift.String + ) { + self.CONTENT_hyphen_DISPOSITION = CONTENT_hyphen_DISPOSITION + self.ETAG = ETAG + self.CONTENT_hyphen_RANGE = CONTENT_hyphen_RANGE + } + } + /// Received HTTP response headers + public var headers: Operations.downloadFile.Output.PartialContent.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/206/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.binary`. + /// + /// - Throws: An error if `self` is not `.binary`. + /// - SeeAlso: `.binary`. + public var binary: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .binary(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.PartialContent.Body + /// Creates a new `PartialContent`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.downloadFile.Output.PartialContent.Headers, + body: Operations.downloadFile.Output.PartialContent.Body + ) { + self.headers = headers + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/206`. + /// + /// HTTP response code: `206 partialContent`. + case partialContent(Operations.downloadFile.Output.PartialContent) + /// The associated value of the enum case if `self` is `.partialContent`. + /// + /// - Throws: An error if `self` is not `.partialContent`. + /// - SeeAlso: `.partialContent`. + public var partialContent: Operations.downloadFile.Output.PartialContent { + get throws { + switch self { + case let .partialContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "partialContent", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.downloadFile.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.downloadFile.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.downloadFile.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.downloadFile.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.downloadFile.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.downloadFile.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.downloadFile.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.downloadFile.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.downloadFile.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.downloadFile.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.downloadFile.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.downloadFile.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct RangeNotSatisfiable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/416/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/416/headers/CONTENT-RANGE`. + public var CONTENT_hyphen_RANGE: Swift.String + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - CONTENT_hyphen_RANGE: + public init(CONTENT_hyphen_RANGE: Swift.String) { + self.CONTENT_hyphen_RANGE = CONTENT_hyphen_RANGE + } + } + /// Received HTTP response headers + public var headers: Operations.downloadFile.Output.RangeNotSatisfiable.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/416/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/416/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.RangeNotSatisfiable.Body + /// Creates a new `RangeNotSatisfiable`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.downloadFile.Output.RangeNotSatisfiable.Headers, + body: Operations.downloadFile.Output.RangeNotSatisfiable.Body + ) { + self.headers = headers + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/416`. + /// + /// HTTP response code: `416 rangeNotSatisfiable`. + case rangeNotSatisfiable(Operations.downloadFile.Output.RangeNotSatisfiable) + /// The associated value of the enum case if `self` is `.rangeNotSatisfiable`. + /// + /// - Throws: An error if `self` is not `.rangeNotSatisfiable`. + /// - SeeAlso: `.rangeNotSatisfiable`. + public var rangeNotSatisfiable: Operations.downloadFile.Output.RangeNotSatisfiable { + get throws { + switch self { + case let .rangeNotSatisfiable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "rangeNotSatisfiable", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.downloadFile.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.downloadFile.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.downloadFile.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.downloadFile.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/GET/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.downloadFile.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.downloadFile.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.downloadFile.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.downloadFile.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case binary + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/octet-stream": + self = .binary + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .binary: + return "application/octet-stream" + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .binary, + .application_json_charset_utf_hyphen_8 + ] + } + } + } + /// - Remark: HTTP `PUT /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)`. + public enum replaceContent { + public static let id: Swift.String = "replaceContent" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.replaceContent.Input.Path + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/query/revision`. + public var revision: Swift.String + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/query/mimeType`. + public var mimeType: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - revision: + /// - mimeType: + public init( + revision: Swift.String, + mimeType: Swift.String? = nil + ) { + self.revision = revision + self.mimeType = mimeType + } + } + public var query: Operations.replaceContent.Input.Query + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.replaceContent.Input.Headers + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/requestBody/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + } + public var body: Operations.replaceContent.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + /// - body: + public init( + path: Operations.replaceContent.Input.Path, + query: Operations.replaceContent.Input.Query, + headers: Operations.replaceContent.Input.Headers = .init(), + body: Operations.replaceContent.Input.Body + ) { + self.path = path + self.query = query + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/200/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.FileEntry) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.FileEntry { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.Ok.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.replaceContent.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.replaceContent.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/400/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.BadRequest.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.replaceContent.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.replaceContent.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/401/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.Unauthorized.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.replaceContent.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.replaceContent.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/403/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.Forbidden.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.replaceContent.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.replaceContent.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/404/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.NotFound.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.replaceContent.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.replaceContent.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/409/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.Conflict.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.replaceContent.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.replaceContent.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/413/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.replaceContent.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.replaceContent.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/500/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.InternalServerError.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.replaceContent.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.replaceContent.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct BadGateway: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/502/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/502/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.BadGateway.Body + /// Creates a new `BadGateway`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.BadGateway.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/502`. + /// + /// HTTP response code: `502 badGateway`. + case badGateway(Operations.replaceContent.Output.BadGateway) + /// The associated value of the enum case if `self` is `.badGateway`. + /// + /// - Throws: An error if `self` is not `.badGateway`. + /// - SeeAlso: `.badGateway`. + public var badGateway: Operations.replaceContent.Output.BadGateway { + get throws { + switch self { + case let .badGateway(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badGateway", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/api/v1/files/{id}/content/PUT/responses/503/content/application\/json; charset=utf-8`. + case application_json_charset_utf_hyphen_8(Components.Schemas.ErrorBody) + /// The associated value of the enum case if `self` is `.application_json_charset_utf_hyphen_8`. + /// + /// - Throws: An error if `self` is not `.application_json_charset_utf_hyphen_8`. + /// - SeeAlso: `.application_json_charset_utf_hyphen_8`. + public var application_json_charset_utf_hyphen_8: Components.Schemas.ErrorBody { + get throws { + switch self { + case let .application_json_charset_utf_hyphen_8(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.replaceContent.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.replaceContent.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// + /// + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.replaceContent.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.replaceContent.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case application_json_charset_utf_hyphen_8 + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .application_json_charset_utf_hyphen_8 + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .application_json_charset_utf_hyphen_8: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .application_json_charset_utf_hyphen_8 + ] + } + } + } +} diff --git a/packages/swift-client/Sources/CrateClient/GeneratedSources/Types.swift b/packages/swift-client/Sources/CrateClient/GeneratedSources/Types.swift new file mode 100644 index 0000000..a203964 --- /dev/null +++ b/packages/swift-client/Sources/CrateClient/GeneratedSources/Types.swift @@ -0,0 +1,235 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) public import OpenAPIRuntime +#if os(Linux) +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data +@preconcurrency public import struct Foundation.Date +#else +public import struct Foundation.URL +public import struct Foundation.Data +public import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable { + /// - Remark: HTTP `POST /oauth/login`. + /// - Remark: Generated from `#/paths//oauth/login/post(login)`. + func login(_ input: Operations.login.Input) async throws -> Operations.login.Output + /// - Remark: HTTP `GET /api/v1/session`. + /// - Remark: Generated from `#/paths//api/v1/session/get(session)`. + func session(_ input: Operations.session.Input) async throws -> Operations.session.Output + /// - Remark: HTTP `POST /api/v1/logout`. + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)`. + func logout(_ input: Operations.logout.Input) async throws -> Operations.logout.Output + /// - Remark: HTTP `GET /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)`. + func listFiles(_ input: Operations.listFiles.Input) async throws -> Operations.listFiles.Output + /// - Remark: HTTP `POST /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)`. + func createFile(_ input: Operations.createFile.Input) async throws -> Operations.createFile.Output + /// - Remark: HTTP `GET /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)`. + func getFile(_ input: Operations.getFile.Input) async throws -> Operations.getFile.Output + /// - Remark: HTTP `PUT /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)`. + func updateFile(_ input: Operations.updateFile.Input) async throws -> Operations.updateFile.Output + /// - Remark: HTTP `POST /api/v1/files/{id}/duplicate`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)`. + func duplicateFile(_ input: Operations.duplicateFile.Input) async throws -> Operations.duplicateFile.Output + /// - Remark: HTTP `POST /api/v1/files/{id}/trash`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)`. + func trashFile(_ input: Operations.trashFile.Input) async throws -> Operations.trashFile.Output + /// - Remark: HTTP `POST /api/v1/files/{id}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)`. + func restoreFile(_ input: Operations.restoreFile.Input) async throws -> Operations.restoreFile.Output + /// - Remark: HTTP `GET /api/v1/files/{id}/versions`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)`. + func listVersions(_ input: Operations.listVersions.Input) async throws -> Operations.listVersions.Output + /// - Remark: HTTP `POST /api/v1/files/{id}/versions/{versionId}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)`. + func restoreVersion(_ input: Operations.restoreVersion.Input) async throws -> Operations.restoreVersion.Output + /// - Remark: HTTP `POST /api/v1/files/upload`. + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)`. + func uploadFile(_ input: Operations.uploadFile.Input) async throws -> Operations.uploadFile.Output + /// - Remark: HTTP `GET /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)`. + func downloadFile(_ input: Operations.downloadFile.Input) async throws -> Operations.downloadFile.Output + /// - Remark: HTTP `PUT /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)`. + func replaceContent(_ input: Operations.replaceContent.Input) async throws -> Operations.replaceContent.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// - Remark: HTTP `POST /oauth/login`. + /// - Remark: Generated from `#/paths//oauth/login/post(login)`. + public func login( + headers: Operations.login.Input.Headers = .init(), + body: Operations.login.Input.Body + ) async throws -> Operations.login.Output { + try await login(Operations.login.Input( + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /api/v1/session`. + /// - Remark: Generated from `#/paths//api/v1/session/get(session)`. + public func session(headers: Operations.session.Input.Headers = .init()) async throws -> Operations.session.Output { + try await session(Operations.session.Input(headers: headers)) + } + /// - Remark: HTTP `POST /api/v1/logout`. + /// - Remark: Generated from `#/paths//api/v1/logout/post(logout)`. + public func logout(headers: Operations.logout.Input.Headers = .init()) async throws -> Operations.logout.Output { + try await logout(Operations.logout.Input(headers: headers)) + } + /// - Remark: HTTP `GET /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/get(listFiles)`. + public func listFiles( + query: Operations.listFiles.Input.Query = .init(), + headers: Operations.listFiles.Input.Headers = .init() + ) async throws -> Operations.listFiles.Output { + try await listFiles(Operations.listFiles.Input( + query: query, + headers: headers + )) + } + /// - Remark: HTTP `POST /api/v1/files`. + /// - Remark: Generated from `#/paths//api/v1/files/post(createFile)`. + public func createFile( + headers: Operations.createFile.Input.Headers = .init(), + body: Operations.createFile.Input.Body + ) async throws -> Operations.createFile.Output { + try await createFile(Operations.createFile.Input( + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/get(getFile)`. + public func getFile( + path: Operations.getFile.Input.Path, + headers: Operations.getFile.Input.Headers = .init() + ) async throws -> Operations.getFile.Output { + try await getFile(Operations.getFile.Input( + path: path, + headers: headers + )) + } + /// - Remark: HTTP `PUT /api/v1/files/{id}`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/put(updateFile)`. + public func updateFile( + path: Operations.updateFile.Input.Path, + headers: Operations.updateFile.Input.Headers = .init(), + body: Operations.updateFile.Input.Body + ) async throws -> Operations.updateFile.Output { + try await updateFile(Operations.updateFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/duplicate`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/duplicate/post(duplicateFile)`. + public func duplicateFile( + path: Operations.duplicateFile.Input.Path, + headers: Operations.duplicateFile.Input.Headers = .init(), + body: Operations.duplicateFile.Input.Body + ) async throws -> Operations.duplicateFile.Output { + try await duplicateFile(Operations.duplicateFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/trash`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/trash/post(trashFile)`. + public func trashFile( + path: Operations.trashFile.Input.Path, + headers: Operations.trashFile.Input.Headers = .init(), + body: Operations.trashFile.Input.Body + ) async throws -> Operations.trashFile.Output { + try await trashFile(Operations.trashFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/restore/post(restoreFile)`. + public func restoreFile( + path: Operations.restoreFile.Input.Path, + headers: Operations.restoreFile.Input.Headers = .init(), + body: Operations.restoreFile.Input.Body + ) async throws -> Operations.restoreFile.Output { + try await restoreFile(Operations.restoreFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /api/v1/files/{id}/versions`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/get(listVersions)`. + public func listVersions( + path: Operations.listVersions.Input.Path, + headers: Operations.listVersions.Input.Headers = .init() + ) async throws -> Operations.listVersions.Output { + try await listVersions(Operations.listVersions.Input( + path: path, + headers: headers + )) + } + /// - Remark: HTTP `POST /api/v1/files/{id}/versions/{versionId}/restore`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/versions/{versionId}/restore/post(restoreVersion)`. + public func restoreVersion( + path: Operations.restoreVersion.Input.Path, + headers: Operations.restoreVersion.Input.Headers = .init(), + body: Operations.restoreVersion.Input.Body + ) async throws -> Operations.restoreVersion.Output { + try await restoreVersion(Operations.restoreVersion.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `POST /api/v1/files/upload`. + /// - Remark: Generated from `#/paths//api/v1/files/upload/post(uploadFile)`. + public func uploadFile( + query: Operations.uploadFile.Input.Query, + headers: Operations.uploadFile.Input.Headers = .init(), + body: Operations.uploadFile.Input.Body + ) async throws -> Operations.uploadFile.Output { + try await uploadFile(Operations.uploadFile.Input( + query: query, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/get(downloadFile)`. + public func downloadFile( + path: Operations.downloadFile.Input.Path, + headers: Operations.downloadFile.Input.Headers = .init() + ) async throws -> Operations.downloadFile.Output { + try await downloadFile(Operations.downloadFile.Input( + path: path, + headers: headers + )) + } + /// - Remark: HTTP `PUT /api/v1/files/{id}/content`. + /// - Remark: Generated from `#/paths//api/v1/files/{id}/content/put(replaceContent)`. + public func replaceContent( + path: Operations.replaceContent.Input.Path, + query: Operations.replaceContent.Input.Query, + headers: Operations.replaceContent.Input.Headers = .init(), + body: Operations.replaceContent.Input.Body + ) async throws -> Operations.replaceContent.Output { + try await replaceContent(Operations.replaceContent.Input( + path: path, + query: query, + headers: headers, + body: body + )) + } +} + +/// Server URLs defined in the OpenAPI document. +public enum Servers {} diff --git a/packages/swift-client/Sources/CrateClient/openapi.json b/packages/swift-client/Sources/CrateClient/openapi.json new file mode 100644 index 0000000..3208399 --- /dev/null +++ b/packages/swift-client/Sources/CrateClient/openapi.json @@ -0,0 +1,2369 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Crate web companion API", + "version": "1.0.0" + }, + "servers": [], + "tags": [], + "paths": { + "/oauth/login": { + "post": { + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/LoginInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/LoginOutput" + } + } + }, + "headers": { + "SET-COOKIE": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "operationId": "login" + } + }, + "/api/v1/session": { + "get": { + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "session" + } + }, + "/api/v1/logout": { + "post": { + "responses": { + "204": { + "description": "", + "headers": { + "SET-COOKIE": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "operationId": "logout" + } + }, + "/api/v1/files": { + "get": { + "parameters": [ + { + "name": "parentId", + "schema": { + "type": "string" + }, + "in": "query", + "required": false, + "deprecated": false, + "explode": true + }, + { + "name": "trash", + "schema": { + "type": "boolean" + }, + "in": "query", + "required": false, + "deprecated": false, + "explode": true + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileList" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "listFiles" + }, + "post": { + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/CreateFile" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "createFile" + } + }, + "/api/v1/files/{id}": { + "get": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "getFile" + }, + "put": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/UpdateFile" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "updateFile" + } + }, + "/api/v1/files/{id}/duplicate": { + "post": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/DuplicateFile" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "duplicateFile" + } + }, + "/api/v1/files/{id}/trash": { + "post": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/RevisionInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "trashFile" + } + }, + "/api/v1/files/{id}/restore": { + "post": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/RevisionInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "restoreFile" + } + }, + "/api/v1/files/{id}/versions": { + "get": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/VersionList" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "listVersions" + } + }, + "/api/v1/files/{id}/versions/{versionId}/restore": { + "post": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "versionId", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/RevisionInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "restoreVersion" + } + }, + "/api/v1/files/upload": { + "post": { + "parameters": [ + { + "name": "name", + "schema": { + "type": "string" + }, + "in": "query", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "parentId", + "schema": { + "type": "string" + }, + "in": "query", + "required": false, + "deprecated": false, + "explode": true + }, + { + "name": "mimeType", + "schema": { + "type": "string" + }, + "in": "query", + "required": false, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "uploadFile" + } + }, + "/api/v1/files/{id}/content": { + "put": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "revision", + "schema": { + "type": "string" + }, + "in": "query", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "mimeType", + "schema": { + "type": "string" + }, + "in": "query", + "required": false, + "deprecated": false, + "explode": true + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "replaceContent" + }, + "get": { + "parameters": [ + { + "name": "id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true, + "deprecated": false, + "explode": true + }, + { + "name": "Range", + "schema": { + "type": "string" + }, + "in": "header", + "required": false, + "deprecated": false, + "explode": true + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "headers": { + "CONTENT-DISPOSITION": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + }, + "ETAG": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "206": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "headers": { + "CONTENT-DISPOSITION": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + }, + "ETAG": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + }, + "CONTENT-RANGE": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "413": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "416": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + }, + "headers": { + "CONTENT-RANGE": { + "required": true, + "deprecated": false, + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "502": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json; charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/ErrorBody" + } + } + } + } + }, + "security": [ + { + "Authenticated": [] + } + ], + "operationId": "downloadFile" + } + } + }, + "components": { + "schemas": { + "BlobInfo": { + "type": "object", + "title": "BlobInfo", + "required": [ + "cid", + "mimeType", + "size" + ], + "properties": { + "cid": { + "type": "string", + "description": "Content identifier of the blob, never the file identity or record revision." + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + }, + "CreateFile": { + "type": "object", + "title": "CreateFile", + "required": [ + "name", + "kind" + ], + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "minLength": 1 + }, + "parentId": { + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/FileKind" + } + } + }, + "DuplicateFile": { + "type": "object", + "title": "DuplicateFile", + "required": [ + "revision", + "name" + ], + "properties": { + "revision": { + "type": "string" + }, + "name": { + "type": "string", + "maxLength": 255, + "minLength": 1 + }, + "parentId": { + "type": "string" + } + } + }, + "ErrorBody": { + "type": "object", + "title": "ErrorBody", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "FileEntry": { + "type": "object", + "title": "FileEntry", + "required": [ + "id", + "uri", + "revision", + "name", + "kind", + "createdAt", + "updatedAt", + "size" + ], + "properties": { + "id": { + "type": "string", + "description": "Stable record key within the authenticated account's drive space." + }, + "uri": { + "type": "string" + }, + "revision": { + "type": "string", + "description": "Current record CID, used to reject stale writes." + }, + "parentId": { + "type": "string", + "description": "Omitted for a root-level entry." + }, + "name": { + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/FileKind" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "trashedAt": { + "type": "string" + }, + "size": { + "type": "integer", + "format": "int64" + }, + "blob": { + "$ref": "#/components/schemas/BlobInfo" + } + } + }, + "FileKind": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "FileList": { + "type": "object", + "title": "FileList", + "required": [ + "files" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileEntry" + } + } + } + }, + "FileVersion": { + "type": "object", + "title": "FileVersion", + "required": [ + "id", + "fileId", + "capturedAt", + "file" + ], + "properties": { + "id": { + "type": "string", + "description": "Immutable version record key, distinct from the file's stable ID." + }, + "fileId": { + "type": "string" + }, + "capturedAt": { + "type": "string" + }, + "file": { + "$ref": "#/components/schemas/FileEntry" + } + } + }, + "LoginInput": { + "type": "object", + "title": "LoginInput", + "required": [ + "handle" + ], + "properties": { + "handle": { + "type": "string", + "minLength": 1 + } + } + }, + "LoginOutput": { + "type": "object", + "title": "LoginOutput", + "required": [ + "redirectUrl" + ], + "properties": { + "redirectUrl": { + "type": "string" + } + } + }, + "RevisionInput": { + "type": "object", + "title": "RevisionInput", + "required": [ + "revision" + ], + "properties": { + "revision": { + "type": "string" + } + } + }, + "Session": { + "type": "object", + "title": "Session", + "required": [ + "user", + "space" + ], + "properties": { + "user": { + "$ref": "#/components/schemas/User" + }, + "space": { + "$ref": "#/components/schemas/Space" + } + } + }, + "Space": { + "type": "object", + "title": "Space", + "required": [ + "uri", + "authorityDid", + "type", + "key" + ], + "properties": { + "uri": { + "type": "string" + }, + "authorityDid": { + "type": "string" + }, + "type": { + "type": "string" + }, + "key": { + "type": "string" + } + } + }, + "UpdateFile": { + "type": "object", + "title": "UpdateFile", + "description": "Renames a file without changing its parent or stable identity.", + "required": [ + "revision", + "name" + ], + "properties": { + "revision": { + "type": "string" + }, + "name": { + "type": "string", + "maxLength": 255, + "minLength": 1 + } + } + }, + "User": { + "type": "object", + "title": "User", + "required": [ + "did", + "handle" + ], + "properties": { + "did": { + "type": "string" + }, + "handle": { + "type": "string" + } + } + }, + "VersionList": { + "type": "object", + "title": "VersionList", + "required": [ + "versions" + ], + "properties": { + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileVersion" + } + } + } + } + }, + "securitySchemes": { + "Authenticated": { + "type": "apiKey", + "name": "crate_session", + "in": "cookie" + } + } + } +}