api

package
v0.0.0-...-8d918e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Index

Constants

View Source
const (
	Supabase1TokenAuthScopes = "Supabase1TokenAuth.Scopes"
	Supabase2TeamAuthScopes  = "Supabase2TeamAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type AddTeamMemberRequest

type AddTeamMemberRequest struct {
	Email openapi_types.Email `json:"email"`
}

AddTeamMemberRequest defines model for AddTeamMemberRequest.

type BuildId

type BuildId = openapi_types.UUID

BuildId defines model for build_id.

type BuildIdOrTemplate

type BuildIdOrTemplate = string

BuildIdOrTemplate defines model for build_id_or_template.

type BuildIds

type BuildIds = []openapi_types.UUID

BuildIds defines model for build_ids.

type BuildInfo

type BuildInfo struct {
	// CreatedAt Build creation timestamp in RFC3339 format.
	CreatedAt time.Time `json:"createdAt"`

	// FinishedAt Build completion timestamp in RFC3339 format, if finished.
	FinishedAt *time.Time `json:"finishedAt"`

	// Names Template names related to this build, if available.
	Names *[]string `json:"names"`

	// Status Build status mapped for dashboard clients.
	Status BuildStatus `json:"status"`

	// StatusMessage Failure message when status is `failed`, otherwise `null`.
	StatusMessage *string `json:"statusMessage"`
}

BuildInfo defines model for BuildInfo.

type BuildStatus

type BuildStatus string

BuildStatus Build status mapped for dashboard clients.

const (
	Building BuildStatus = "building"
	Failed   BuildStatus = "failed"
	Success  BuildStatus = "success"
)

Defines values for BuildStatus.

type BuildStatusItem

type BuildStatusItem struct {
	// FinishedAt Build completion timestamp in RFC3339 format, if finished.
	FinishedAt *time.Time `json:"finishedAt"`

	// Id Identifier of the build.
	Id openapi_types.UUID `json:"id"`

	// Status Build status mapped for dashboard clients.
	Status BuildStatus `json:"status"`

	// StatusMessage Failure message when status is `failed`, otherwise `null`.
	StatusMessage *string `json:"statusMessage"`
}

BuildStatusItem defines model for BuildStatusItem.

type BuildStatuses

type BuildStatuses = []BuildStatus

BuildStatuses defines model for build_statuses.

type BuildsCursor

type BuildsCursor = string

BuildsCursor defines model for builds_cursor.

type BuildsLimit

type BuildsLimit = int32

BuildsLimit defines model for builds_limit.

type BuildsListResponse

type BuildsListResponse struct {
	Data []ListedBuild `json:"data"`

	// NextCursor Cursor to pass to the next list request, or `null` if there is no next page.
	NextCursor *string `json:"nextCursor"`
}

BuildsListResponse defines model for BuildsListResponse.

type BuildsStatusesResponse

type BuildsStatusesResponse struct {
	// BuildStatuses List of build statuses
	BuildStatuses []BuildStatusItem `json:"buildStatuses"`
}

BuildsStatusesResponse defines model for BuildsStatusesResponse.

type CPUCount

type CPUCount = int64

CPUCount CPU cores for the sandbox

type DefaultTemplate

type DefaultTemplate struct {
	Aliases         []DefaultTemplateAlias `json:"aliases"`
	BuildCount      int32                  `json:"buildCount"`
	BuildId         openapi_types.UUID     `json:"buildId"`
	CreatedAt       time.Time              `json:"createdAt"`
	EnvdVersion     *string                `json:"envdVersion"`
	Id              string                 `json:"id"`
	Public          bool                   `json:"public"`
	RamMb           int64                  `json:"ramMb"`
	SpawnCount      int64                  `json:"spawnCount"`
	TotalDiskSizeMb *int64                 `json:"totalDiskSizeMb"`
	Vcpu            int64                  `json:"vcpu"`
}

DefaultTemplate defines model for DefaultTemplate.

type DefaultTemplateAlias

type DefaultTemplateAlias struct {
	Alias     string  `json:"alias"`
	Namespace *string `json:"namespace"`
}

DefaultTemplateAlias defines model for DefaultTemplateAlias.

type DefaultTemplatesResponse

type DefaultTemplatesResponse struct {
	Templates []DefaultTemplate `json:"templates"`
}

DefaultTemplatesResponse defines model for DefaultTemplatesResponse.

type DiskSizeMB

type DiskSizeMB = int64

DiskSizeMB Disk size for the sandbox in MiB

type Error

type Error struct {
	// Code Error code.
	Code int32 `json:"code"`

	// Message Error message.
	Message string `json:"message"`
}

Error defines model for Error.

type GetBuildsParams

type GetBuildsParams struct {
	// BuildIdOrTemplate Optional filter by build identifier, template identifier, or template alias.
	BuildIdOrTemplate *BuildIdOrTemplate `form:"build_id_or_template,omitempty" json:"build_id_or_template,omitempty"`

	// Statuses Comma-separated list of build statuses to include.
	Statuses *BuildStatuses `form:"statuses,omitempty" json:"statuses,omitempty"`

	// Limit Maximum number of items to return per page.
	Limit *BuildsLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor Cursor returned by the previous list response in `created_at|build_id` format.
	Cursor *BuildsCursor `form:"cursor,omitempty" json:"cursor,omitempty"`
}

GetBuildsParams defines parameters for GetBuilds.

type GetBuildsStatusesParams

type GetBuildsStatusesParams struct {
	// BuildIds Comma-separated list of build IDs to get statuses for.
	BuildIds BuildIds `form:"build_ids" json:"build_ids"`
}

GetBuildsStatusesParams defines parameters for GetBuildsStatuses.

type GetTeamsResolveParams

type GetTeamsResolveParams struct {
	// Slug Team slug to resolve.
	Slug TeamSlug `form:"slug" json:"slug"`
}

GetTeamsResolveParams defines parameters for GetTeamsResolve.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type HealthResponse

type HealthResponse struct {
	// Message Human-readable health check result.
	Message string `json:"message"`
}

HealthResponse defines model for HealthResponse.

type ListedBuild

type ListedBuild struct {
	// CreatedAt Build creation timestamp in RFC3339 format.
	CreatedAt time.Time `json:"createdAt"`

	// FinishedAt Build completion timestamp in RFC3339 format, if finished.
	FinishedAt *time.Time `json:"finishedAt"`

	// Id Identifier of the build.
	Id openapi_types.UUID `json:"id"`

	// Status Build status mapped for dashboard clients.
	Status BuildStatus `json:"status"`

	// StatusMessage Failure message when status is `failed`, otherwise `null`.
	StatusMessage *string `json:"statusMessage"`

	// Template Template alias when present, otherwise template ID.
	Template string `json:"template"`

	// TemplateId Identifier of the template.
	TemplateId string `json:"templateId"`
}

ListedBuild defines model for ListedBuild.

type MemoryMB

type MemoryMB = int64

MemoryMB Memory for the sandbox in MiB

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type N400

type N400 = Error

N400 defines model for 400.

type N401

type N401 = Error

N401 defines model for 401.

type N403

type N403 = Error

N403 defines model for 403.

type N404

type N404 = Error

N404 defines model for 404.

type N500

type N500 = Error

N500 defines model for 500.

type PatchTeamsTeamIDJSONRequestBody

type PatchTeamsTeamIDJSONRequestBody = UpdateTeamRequest

PatchTeamsTeamIDJSONRequestBody defines body for PatchTeamsTeamID for application/json ContentType.

type PostTeamsTeamIDMembersJSONRequestBody

type PostTeamsTeamIDMembersJSONRequestBody = AddTeamMemberRequest

PostTeamsTeamIDMembersJSONRequestBody defines body for PostTeamsTeamIDMembers for application/json ContentType.

type SandboxID

type SandboxID = string

SandboxID defines model for sandboxID.

type SandboxRecord

type SandboxRecord struct {
	// Alias Alias of the template
	Alias *string `json:"alias,omitempty"`

	// CpuCount CPU cores for the sandbox
	CpuCount CPUCount `json:"cpuCount"`

	// DiskSizeMB Disk size for the sandbox in MiB
	DiskSizeMB DiskSizeMB `json:"diskSizeMB"`

	// Domain Base domain where the sandbox traffic is accessible
	Domain *string `json:"domain"`

	// MemoryMB Memory for the sandbox in MiB
	MemoryMB MemoryMB `json:"memoryMB"`

	// SandboxID Identifier of the sandbox
	SandboxID string `json:"sandboxID"`

	// StartedAt Time when the sandbox was started
	StartedAt time.Time `json:"startedAt"`

	// StoppedAt Time when the sandbox was stopped
	StoppedAt *time.Time `json:"stoppedAt"`

	// TemplateID Identifier of the template from which is the sandbox created
	TemplateID string `json:"templateID"`
}

SandboxRecord defines model for SandboxRecord.

type ServerInterface

type ServerInterface interface {
	// List team builds
	// (GET /builds)
	GetBuilds(c *gin.Context, params GetBuildsParams)
	// Get build statuses
	// (GET /builds/statuses)
	GetBuildsStatuses(c *gin.Context, params GetBuildsStatusesParams)
	// Get build details
	// (GET /builds/{build_id})
	GetBuildsBuildId(c *gin.Context, buildId BuildId)
	// Health check
	// (GET /health)
	GetHealth(c *gin.Context)
	// Get sandbox record
	// (GET /sandboxes/{sandboxID}/record)
	GetSandboxesSandboxIDRecord(c *gin.Context, sandboxID SandboxID)
	// List user teams
	// (GET /teams)
	GetTeams(c *gin.Context)
	// Resolve team identity
	// (GET /teams/resolve)
	GetTeamsResolve(c *gin.Context, params GetTeamsResolveParams)
	// Update team
	// (PATCH /teams/{teamID})
	PatchTeamsTeamID(c *gin.Context, teamID TeamID)
	// List team members
	// (GET /teams/{teamID}/members)
	GetTeamsTeamIDMembers(c *gin.Context, teamID TeamID)
	// Add team member
	// (POST /teams/{teamID}/members)
	PostTeamsTeamIDMembers(c *gin.Context, teamID TeamID)
	// Remove team member
	// (DELETE /teams/{teamID}/members/{userId})
	DeleteTeamsTeamIDMembersUserId(c *gin.Context, teamID TeamID, userId UserId)
	// List default templates
	// (GET /templates/defaults)
	GetTemplatesDefaults(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) DeleteTeamsTeamIDMembersUserId

func (siw *ServerInterfaceWrapper) DeleteTeamsTeamIDMembersUserId(c *gin.Context)

DeleteTeamsTeamIDMembersUserId operation middleware

func (*ServerInterfaceWrapper) GetBuilds

func (siw *ServerInterfaceWrapper) GetBuilds(c *gin.Context)

GetBuilds operation middleware

func (*ServerInterfaceWrapper) GetBuildsBuildId

func (siw *ServerInterfaceWrapper) GetBuildsBuildId(c *gin.Context)

GetBuildsBuildId operation middleware

func (*ServerInterfaceWrapper) GetBuildsStatuses

func (siw *ServerInterfaceWrapper) GetBuildsStatuses(c *gin.Context)

GetBuildsStatuses operation middleware

func (*ServerInterfaceWrapper) GetHealth

func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context)

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetSandboxesSandboxIDRecord

func (siw *ServerInterfaceWrapper) GetSandboxesSandboxIDRecord(c *gin.Context)

GetSandboxesSandboxIDRecord operation middleware

func (*ServerInterfaceWrapper) GetTeams

func (siw *ServerInterfaceWrapper) GetTeams(c *gin.Context)

GetTeams operation middleware

func (*ServerInterfaceWrapper) GetTeamsResolve

func (siw *ServerInterfaceWrapper) GetTeamsResolve(c *gin.Context)

GetTeamsResolve operation middleware

func (*ServerInterfaceWrapper) GetTeamsTeamIDMembers

func (siw *ServerInterfaceWrapper) GetTeamsTeamIDMembers(c *gin.Context)

GetTeamsTeamIDMembers operation middleware

func (*ServerInterfaceWrapper) GetTemplatesDefaults

func (siw *ServerInterfaceWrapper) GetTemplatesDefaults(c *gin.Context)

GetTemplatesDefaults operation middleware

func (*ServerInterfaceWrapper) PatchTeamsTeamID

func (siw *ServerInterfaceWrapper) PatchTeamsTeamID(c *gin.Context)

PatchTeamsTeamID operation middleware

func (*ServerInterfaceWrapper) PostTeamsTeamIDMembers

func (siw *ServerInterfaceWrapper) PostTeamsTeamIDMembers(c *gin.Context)

PostTeamsTeamIDMembers operation middleware

type TeamID

type TeamID = openapi_types.UUID

TeamID defines model for teamID.

type TeamMember

type TeamMember struct {
	AddedBy   *openapi_types.UUID `json:"addedBy"`
	CreatedAt *time.Time          `json:"createdAt"`
	Email     string              `json:"email"`
	Id        openapi_types.UUID  `json:"id"`
	IsDefault bool                `json:"isDefault"`
}

TeamMember defines model for TeamMember.

type TeamMembersResponse

type TeamMembersResponse struct {
	Members []TeamMember `json:"members"`
}

TeamMembersResponse defines model for TeamMembersResponse.

type TeamResolveResponse

type TeamResolveResponse struct {
	Id   openapi_types.UUID `json:"id"`
	Slug string             `json:"slug"`
}

TeamResolveResponse defines model for TeamResolveResponse.

type TeamSlug

type TeamSlug = string

TeamSlug defines model for teamSlug.

type UpdateTeamRequest

type UpdateTeamRequest struct {
	Name              *string `json:"name,omitempty"`
	ProfilePictureUrl *string `json:"profilePictureUrl"`
}

UpdateTeamRequest defines model for UpdateTeamRequest.

type UpdateTeamResponse

type UpdateTeamResponse struct {
	Id                openapi_types.UUID `json:"id"`
	Name              string             `json:"name"`
	ProfilePictureUrl *string            `json:"profilePictureUrl"`
}

UpdateTeamResponse defines model for UpdateTeamResponse.

type UserId

type UserId = openapi_types.UUID

UserId defines model for userId.

type UserTeam

type UserTeam struct {
	BlockedReason     *string            `json:"blockedReason"`
	CreatedAt         time.Time          `json:"createdAt"`
	Email             string             `json:"email"`
	Id                openapi_types.UUID `json:"id"`
	IsBanned          bool               `json:"isBanned"`
	IsBlocked         bool               `json:"isBlocked"`
	IsDefault         bool               `json:"isDefault"`
	Limits            UserTeamLimits     `json:"limits"`
	Name              string             `json:"name"`
	ProfilePictureUrl *string            `json:"profilePictureUrl"`
	Slug              string             `json:"slug"`
	Tier              string             `json:"tier"`
}

UserTeam defines model for UserTeam.

type UserTeamLimits

type UserTeamLimits struct {
	ConcurrentSandboxes      int32 `json:"concurrentSandboxes"`
	ConcurrentTemplateBuilds int32 `json:"concurrentTemplateBuilds"`
	DiskMb                   int32 `json:"diskMb"`
	MaxLengthHours           int64 `json:"maxLengthHours"`
	MaxRamMb                 int32 `json:"maxRamMb"`
	MaxVcpu                  int32 `json:"maxVcpu"`
}

UserTeamLimits defines model for UserTeamLimits.

type UserTeamsResponse

type UserTeamsResponse struct {
	Teams []UserTeam `json:"teams"`
}

UserTeamsResponse defines model for UserTeamsResponse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL