Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSandboxEndpoint ¶
type CreateSandboxEndpoint struct{}
Creates a sandbox account owned by your production account.
The creating user is added to the new sandbox as an administrator, so it can be switched into right away. When the owner's plan limits how many sandboxes it may have, the request fails once that limit is reached.
When `mode` is `seeded`, sample data is populated asynchronously and may not be available immediately after the sandbox is created. Sandboxes cannot be created while acting in a sandbox.
func (*CreateSandboxEndpoint) Materialize ¶
func (e *CreateSandboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*CreateSandboxRequest, *apiresource.Sandbox]
type CreateSandboxRequest ¶
type CreateSandboxRequest struct {
// Display name of the sandbox.
Name string `json:"name" validate:"required,max=255"`
// Controls how the sandbox is initialized.
//
// - `blank`: starts empty, with no pre-populated data.
// - `seeded`: starts with sample data, populated asynchronously after the sandbox is created.
Mode field.Optional[constants.SandboxMode] `json:"mode,omitzero" default:"blank"`
}
Request to create a sandbox.
func (*CreateSandboxRequest) SchemaExample ¶
func (*CreateSandboxRequest) SchemaExample() any
type DeleteSandboxEndpoint ¶
type DeleteSandboxEndpoint struct{}
Deletes a sandbox account and everything inside it.
The sandbox becomes inaccessible as soon as this call returns, but its data is purged asynchronously and may persist briefly. Deletion is permanent: the sandbox cannot be restored, and deleting it again reports that it has already been deleted. Sandboxes cannot be deleted while acting in a sandbox.
func (*DeleteSandboxEndpoint) Materialize ¶
func (e *DeleteSandboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*DeleteSandboxRequest, *apiresource.EmptyResource]
type DeleteSandboxRequest ¶
type DeleteSandboxRequest struct {
// ID of the sandbox to delete.
SandboxID string `path:"id" validate:"required"`
}
Request to delete a sandbox.
type ListSandboxesEndpoint ¶
type ListSandboxesEndpoint struct{}
Returns a paginated list of the sandboxes owned by your production account, newest first.
The `q` search term matches the sandbox name. Sandboxes cannot be listed while acting in a sandbox.
func (*ListSandboxesEndpoint) Materialize ¶
func (e *ListSandboxesEndpoint) Materialize() *apiendpoint.APIEndpoint[*apiresource.PaginationRequest, *apiresource.List[apiresource.Sandbox]]
type RetrieveSandboxEndpoint ¶
type RetrieveSandboxEndpoint struct{}
Returns a single sandbox by ID.
Only sandboxes owned by your production account are visible; any other sandbox is reported as not found. Sandboxes cannot be retrieved while acting in a sandbox.
func (*RetrieveSandboxEndpoint) Materialize ¶
func (e *RetrieveSandboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*RetrieveSandboxRequest, *apiresource.Sandbox]
type RetrieveSandboxRequest ¶
type RetrieveSandboxRequest struct {
// ID of the sandbox to retrieve.
SandboxID string `path:"id" validate:"required"`
}
Request to retrieve a sandbox.
type SandboxSvc ¶
type SandboxSvc interface {
ListSandboxes(ctx context.Context, req *apiresource.PaginationRequest) (*apiresource.List[apiresource.Sandbox], *apierror.APIError)
GetSandbox(ctx context.Context, req *RetrieveSandboxRequest) (*apiresource.Sandbox, *apierror.APIError)
CreateSandbox(ctx context.Context, req *CreateSandboxRequest) (*apiresource.Sandbox, *apierror.APIError)
DeleteSandbox(ctx context.Context, req *DeleteSandboxRequest) (*apiresource.EmptyResource, *apierror.APIError)
}
func NewSandboxSvc ¶
func NewSandboxSvc(config *SandboxSvcConfig) SandboxSvc
type SandboxSvcConfig ¶
type SandboxSvcConfig struct {
// CoreClient (required) is the core-service gRPC client.
CoreClient pb.CoreServiceClient
}