// Package api provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package api import ( "time" ) // Defines values for AuthResponseRole. const ( Admin AuthResponseRole = "admin" Default AuthResponseRole = "default" ) // Valid indicates whether the value is a known member of the AuthResponseRole enum. func (e AuthResponseRole) Valid() bool { switch e { case Admin: return true case Default: return true default: return false } } // Defines values for InstanceHealth. const ( Green InstanceHealth = "green" Red InstanceHealth = "red" Unknown InstanceHealth = "unknown" Yellow InstanceHealth = "yellow" ) // Valid indicates whether the value is a known member of the InstanceHealth enum. func (e InstanceHealth) Valid() bool { switch e { case Green: return true case Red: return true case Unknown: return true case Yellow: return true default: return false } } // Defines values for InstanceStatus. const ( Creating InstanceStatus = "creating" Degraded InstanceStatus = "degraded" Deleting InstanceStatus = "deleting" Failed InstanceStatus = "failed" Pending InstanceStatus = "pending" Ready InstanceStatus = "ready" ) // Valid indicates whether the value is a known member of the InstanceStatus enum. func (e InstanceStatus) Valid() bool { switch e { case Creating: return true case Degraded: return true case Deleting: return true case Failed: return true case Pending: return true case Ready: return true default: return false } } // Defines values for LogEntryOperation. const ( CreateInstance LogEntryOperation = "create_instance" DeleteDoc LogEntryOperation = "delete_doc" DeleteInstance LogEntryOperation = "delete_instance" GetInstance LogEntryOperation = "get_instance" IndexDoc LogEntryOperation = "index_doc" ListIndices LogEntryOperation = "list_indices" ListInstances LogEntryOperation = "list_instances" SearchDocs LogEntryOperation = "search_docs" ) // Valid indicates whether the value is a known member of the LogEntryOperation enum. func (e LogEntryOperation) Valid() bool { switch e { case CreateInstance: return true case DeleteDoc: return true case DeleteInstance: return true case GetInstance: return true case IndexDoc: return true case ListIndices: return true case ListInstances: return true case SearchDocs: return true default: return false } } // Defines values for LogEntryStatus. const ( Failure LogEntryStatus = "failure" Success LogEntryStatus = "success" ) // Valid indicates whether the value is a known member of the LogEntryStatus enum. func (e LogEntryStatus) Valid() bool { switch e { case Failure: return true case Success: return true default: return false } } // AuthRequest defines model for AuthRequest. type AuthRequest struct { // InviteCode Invite code required when invite-only mode is enabled // // Example: sunset-rocket-42 InviteCode *string `json:"inviteCode,omitempty"` // Password Example: s3cureP@ssw0rd Password string `json:"password"` // Username Example: johndoe Username string `json:"username"` } // AuthResponse defines model for AuthResponse. type AuthResponse struct { // Role Example: default Role AuthResponseRole `json:"role"` // Token JWT access token Token string `json:"token"` } // AuthResponseRole Example: default type AuthResponseRole string // Document defines model for Document. type Document struct { // DocumentId Document identifier DocumentId string `json:"documentId"` // Index Index the document belongs to Index string `json:"index"` // Score Relevance score from search Score *float64 `json:"score,omitempty"` // Text Document text content Text string `json:"text"` } // DocumentCreateRequest defines model for DocumentCreateRequest. type DocumentCreateRequest struct { // Index Target Elasticsearch index (defaults to 'default') // // Example: articles Index *string `json:"index,omitempty"` // Text Text content to index // // Example: The quick brown fox jumps over the lazy dog Text string `json:"text"` } // DocumentIndexResponse defines model for DocumentIndexResponse. type DocumentIndexResponse struct { // DocumentId Auto-generated document ID assigned by Elasticsearch DocumentId string `json:"documentId"` // Index The index the document was stored in Index string `json:"index"` } // IndexList defines model for IndexList. type IndexList struct { // Indices List of index names in the Elasticsearch instance Indices []string `json:"indices"` } // Instance defines model for Instance. type Instance struct { CreatedAt time.Time `json:"createdAt"` // Endpoint Internal cluster endpoint for the Elasticsearch cluster Endpoint *string `json:"endpoint,omitempty"` Health *InstanceHealth `json:"health,omitempty"` // Id Unique identifier of the instance Id string `json:"id"` // Name Kubernetes-compatible name of the Elasticsearch cluster Name string `json:"name"` // NodeCount Number of Elasticsearch nodes deployed by the server NodeCount *int `json:"nodeCount,omitempty"` Status InstanceStatus `json:"status"` // StorageSize Persistent volume claim size per node, managed by the server // // Example: 10Gi StorageSize *string `json:"storageSize,omitempty"` UpdatedAt time.Time `json:"updatedAt"` // Version Elasticsearch version deployed by the server // // Example: 8.11.0 Version *string `json:"version,omitempty"` } // InstanceHealth defines model for Instance.Health. type InstanceHealth string // InstanceStatus defines model for Instance.Status. type InstanceStatus string // InstanceCreateRequest defines model for InstanceCreateRequest. type InstanceCreateRequest struct { // InstanceId Kubernetes-compatible name for the Elasticsearch cluster. All other // configuration (version, node count, storage, etc.) is managed by the // server. InstanceId string `json:"instanceId"` } // LogEntry defines model for LogEntry. type LogEntry struct { // Id Unique identifier of the log entry Id string `json:"id"` // InstanceId Instance this log entry belongs to InstanceId string `json:"instanceId"` // Message Human-readable summary of the operation Message string `json:"message"` // Operation The operation that was performed Operation LogEntryOperation `json:"operation"` // Status Whether the operation succeeded or failed Status LogEntryStatus `json:"status"` // Timestamp When the operation occurred Timestamp time.Time `json:"timestamp"` // Username User who performed the operation Username string `json:"username"` } // LogEntryOperation The operation that was performed type LogEntryOperation string // LogEntryStatus Whether the operation succeeded or failed type LogEntryStatus string // SearchDocsParams defines parameters for SearchDocs. type SearchDocsParams struct { // Q Search query string Q string `form:"q" json:"q"` // Index Index to search in (defaults to 'default') Index *string `form:"index,omitempty" json:"index,omitempty"` } // DeleteDocParams defines parameters for DeleteDoc. type DeleteDocParams struct { // Index Index the document belongs to (defaults to 'default') Index string `form:"index" json:"index"` } // LoginUserJSONRequestBody defines body for LoginUser for application/json ContentType. type LoginUserJSONRequestBody = AuthRequest // RegisterUserJSONRequestBody defines body for RegisterUser for application/json ContentType. type RegisterUserJSONRequestBody = AuthRequest // CreateInstanceJSONRequestBody defines body for CreateInstance for application/json ContentType. type CreateInstanceJSONRequestBody = InstanceCreateRequest // IndexDocJSONRequestBody defines body for IndexDoc for application/json ContentType. type IndexDocJSONRequestBody = DocumentCreateRequest