// Code generated by ogen, DO NOT EDIT.
package api
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// CreateRecords implements createRecords operation.
//
// Create records in a table.
//
// POST /{baseId}/{tableIdOrName}
CreateRecords(ctx context.Context, req *CreateRecordsReq, params CreateRecordsParams) (*CreateRecordsResponse, error)
// CreateTable implements createTable operation.
//
// Create a new table in a base.
//
// POST /meta/bases/{baseId}/tables
CreateTable(ctx context.Context, req *CreateTableReq, params CreateTableParams) (*Table, error)
// DeleteRecords implements deleteRecords operation.
//
// Delete records from a table.
//
// DELETE /{baseId}/{tableIdOrName}
DeleteRecords(ctx context.Context, params DeleteRecordsParams) (*DeleteRecordsResponse, error)
// GetRecord implements getRecord operation.
//
// Get a single record.
//
// GET /{baseId}/{tableIdOrName}/{recordId}
GetRecord(ctx context.Context, params GetRecordParams) (*Record, error)
// ListBases implements listBases operation.
//
// List all accessible bases.
//
// GET /meta/bases
ListBases(ctx context.Context) (*BaseListResponse, error)
// ListRecords implements listRecords operation.
//
// List records in a table.
//
// GET /{baseId}/{tableIdOrName}
ListRecords(ctx context.Context, params ListRecordsParams) (*RecordListResponse, error)
// ListTables implements listTables operation.
//
// Get tables schema for a base.
//
// GET /meta/bases/{baseId}/tables
ListTables(ctx context.Context, params ListTablesParams) (*TableListResponse, error)
// UpdateRecords implements updateRecords operation.
//
// Update records in a table.
//
// PATCH /{baseId}/{tableIdOrName}
UpdateRecords(ctx context.Context, req *UpdateRecordsReq, params UpdateRecordsParams) (*UpdateRecordsResponse, error)
// UpdateTable implements updateTable operation.
//
// Update table metadata.
//
// PATCH /meta/bases/{baseId}/tables/{tableId}
UpdateTable(ctx context.Context, req *UpdateTableReq, params UpdateTableParams) (*Table, error)
}
// Server implements http server based on OpenAPI v3 specification and
// calls Handler to handle requests.
type Server struct {
h Handler
sec SecurityHandler
baseServer
}
// NewServer creates new Server.
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error) {
s, err := newServerConfig(opts...).baseServer()
if err != nil {
return nil, err
}
return &Server{
h: h,
sec: sec,
baseServer: s,
}, nil
}