/*
File response.go contains the JSON and HTML response types for HTTP endpoints.
Le fichier response.go contient les types de réponses JSON et HTML pour les endpoints HTTP.
*/
package main
import (
"codeberg.org/vlbeaudoin/voki/v3"
)
type APIResponse struct {
voki.MessageResponse
statusCode int
Error string
}
func (R APIResponse) StatusCode() int {
return R.statusCode
}
func (R *APIResponse) SetStatusCode(code int) {
R.statusCode = code
}
type ListBucketsResponse struct {
APIResponse
Data struct {
Buckets map[string]string
}
}
type ReadBucketResponse struct {
APIResponse
Data struct {
Keys []string
}
}
type DataDocument struct {
Key string
Size int64
}
type CreateDocumentsResponse struct {
APIResponse
Data struct {
Bucket string
Documents []DataDocument
}
}
type CreateDocumentResponse struct {
APIResponse
Data struct {
Bucket string
DataDocument
}
}
type DeleteDocumentResponse struct {
APIResponse
}
type UpdateDocumentKeyResponse struct {
APIResponse
Data struct {
Bucket string
Key string
}
}
type ExecuteSeedResponse struct {
APIResponse
Data struct {
Buckets []string
}
}
type ReadSpecResponse struct {
APIResponse
Data struct {
Spec string
}
}
// Deprecated: Use ListBucketsResponse instead
type HandleAdminDocumentsUploadResponse struct {
APIResponse
Data struct {
Buckets []Bucket
}
}
// Deprecated: Use ListBucketsResponse instead
type HandleDocumentationResponse struct {
APIResponse
Data struct {
Buckets []Bucket
}
}
// Deprecated: Use CreateDocumentResponse instead
type UploadDocumentAPIResponse struct {
APIResponse
Data UploadDocumentResponseData
}
// Deprecated: Use DataDocument instead
type UploadDocumentResponseData struct {
Bucket string
Object string
Size float64
}