feat(labs): describe the lab task contract and the provisioner port
This commit is contained in:
1 parent
3de226b16c
commit
9fdaa62b9b
91 files changed
+19262
-155
No files matched your search
@@ -3610,6 +3610,488 @@ func (s *AssessmentItem) SetContent(val ItemContent) {
|
||||
|
||||
type AssessmentItemId uuid.UUID
|
||||
|
||||
// Candidate view of the lab of one attempt item. It contains no node address, MAC address, port,
|
||||
// password, key, token, seed, checker state, criteria, score, or infrastructure name.
|
||||
// Ref: #/components/schemas/AssessmentLab
|
||||
type AssessmentLab struct {
|
||||
// Identifier of the lab.
|
||||
ID uuid.UUID `json:"id"`
|
||||
ItemID AssessmentItemId `json:"item_id"`
|
||||
State AssessmentLabState `json:"state"`
|
||||
Nodes []AssessmentLabNode `json:"nodes"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
// Time the lab became `ready`, or null before.
|
||||
ReadyAt NilTimestamp `json:"ready_at"`
|
||||
// Time the lab ends unless it was submitted before: the earlier of the lifetime of the item and the
|
||||
// attempt deadline. It never moves.
|
||||
ExpiresAt Timestamp `json:"expires_at"`
|
||||
// Time the lab reached `submitted`, `expired`, or `failed`, or null.
|
||||
FinishedAt NilTimestamp `json:"finished_at"`
|
||||
// `lab_error` when `state` is `failed`, otherwise null.
|
||||
FailureReason NilAssessmentLabFailureReason `json:"failure_reason"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *AssessmentLab) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// GetItemID returns the value of ItemID.
|
||||
func (s *AssessmentLab) GetItemID() AssessmentItemId {
|
||||
return s.ItemID
|
||||
}
|
||||
|
||||
// GetState returns the value of State.
|
||||
func (s *AssessmentLab) GetState() AssessmentLabState {
|
||||
return s.State
|
||||
}
|
||||
|
||||
// GetNodes returns the value of Nodes.
|
||||
func (s *AssessmentLab) GetNodes() []AssessmentLabNode {
|
||||
return s.Nodes
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the value of CreatedAt.
|
||||
func (s *AssessmentLab) GetCreatedAt() Timestamp {
|
||||
return s.CreatedAt
|
||||
}
|
||||
|
||||
// GetReadyAt returns the value of ReadyAt.
|
||||
func (s *AssessmentLab) GetReadyAt() NilTimestamp {
|
||||
return s.ReadyAt
|
||||
}
|
||||
|
||||
// GetExpiresAt returns the value of ExpiresAt.
|
||||
func (s *AssessmentLab) GetExpiresAt() Timestamp {
|
||||
return s.ExpiresAt
|
||||
}
|
||||
|
||||
// GetFinishedAt returns the value of FinishedAt.
|
||||
func (s *AssessmentLab) GetFinishedAt() NilTimestamp {
|
||||
return s.FinishedAt
|
||||
}
|
||||
|
||||
// GetFailureReason returns the value of FailureReason.
|
||||
func (s *AssessmentLab) GetFailureReason() NilAssessmentLabFailureReason {
|
||||
return s.FailureReason
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *AssessmentLab) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// SetItemID sets the value of ItemID.
|
||||
func (s *AssessmentLab) SetItemID(val AssessmentItemId) {
|
||||
s.ItemID = val
|
||||
}
|
||||
|
||||
// SetState sets the value of State.
|
||||
func (s *AssessmentLab) SetState(val AssessmentLabState) {
|
||||
s.State = val
|
||||
}
|
||||
|
||||
// SetNodes sets the value of Nodes.
|
||||
func (s *AssessmentLab) SetNodes(val []AssessmentLabNode) {
|
||||
s.Nodes = val
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the value of CreatedAt.
|
||||
func (s *AssessmentLab) SetCreatedAt(val Timestamp) {
|
||||
s.CreatedAt = val
|
||||
}
|
||||
|
||||
// SetReadyAt sets the value of ReadyAt.
|
||||
func (s *AssessmentLab) SetReadyAt(val NilTimestamp) {
|
||||
s.ReadyAt = val
|
||||
}
|
||||
|
||||
// SetExpiresAt sets the value of ExpiresAt.
|
||||
func (s *AssessmentLab) SetExpiresAt(val Timestamp) {
|
||||
s.ExpiresAt = val
|
||||
}
|
||||
|
||||
// SetFinishedAt sets the value of FinishedAt.
|
||||
func (s *AssessmentLab) SetFinishedAt(val NilTimestamp) {
|
||||
s.FinishedAt = val
|
||||
}
|
||||
|
||||
// SetFailureReason sets the value of FailureReason.
|
||||
func (s *AssessmentLab) SetFailureReason(val NilAssessmentLabFailureReason) {
|
||||
s.FailureReason = val
|
||||
}
|
||||
|
||||
// A console session of one node. The client opens a WebSocket to `websocket_path` on the same origin
|
||||
// before `expires_at`; the session cookie and the Origin check authorize the upgrade, so no secret
|
||||
// travels in the path, the body, or a query string. A session can be attached once and ends with the
|
||||
// lab.
|
||||
// Ref: #/components/schemas/AssessmentLabConsoleSession
|
||||
type AssessmentLabConsoleSession struct {
|
||||
// Identifier of the console session; it is not a secret.
|
||||
ID uuid.UUID `json:"id"`
|
||||
Node AssessmentLabNodeName `json:"node"`
|
||||
// Same-origin path of the console WebSocket.
|
||||
WebsocketPath string `json:"websocket_path"`
|
||||
// Time by which the WebSocket must be opened.
|
||||
ExpiresAt Timestamp `json:"expires_at"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *AssessmentLabConsoleSession) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// GetNode returns the value of Node.
|
||||
func (s *AssessmentLabConsoleSession) GetNode() AssessmentLabNodeName {
|
||||
return s.Node
|
||||
}
|
||||
|
||||
// GetWebsocketPath returns the value of WebsocketPath.
|
||||
func (s *AssessmentLabConsoleSession) GetWebsocketPath() string {
|
||||
return s.WebsocketPath
|
||||
}
|
||||
|
||||
// GetExpiresAt returns the value of ExpiresAt.
|
||||
func (s *AssessmentLabConsoleSession) GetExpiresAt() Timestamp {
|
||||
return s.ExpiresAt
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *AssessmentLabConsoleSession) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// SetNode sets the value of Node.
|
||||
func (s *AssessmentLabConsoleSession) SetNode(val AssessmentLabNodeName) {
|
||||
s.Node = val
|
||||
}
|
||||
|
||||
// SetWebsocketPath sets the value of WebsocketPath.
|
||||
func (s *AssessmentLabConsoleSession) SetWebsocketPath(val string) {
|
||||
s.WebsocketPath = val
|
||||
}
|
||||
|
||||
// SetExpiresAt sets the value of ExpiresAt.
|
||||
func (s *AssessmentLabConsoleSession) SetExpiresAt(val Timestamp) {
|
||||
s.ExpiresAt = val
|
||||
}
|
||||
|
||||
// Open a console of one node of a ready lab. Unknown fields are rejected.
|
||||
// Ref: #/components/schemas/AssessmentLabConsoleSessionCreate
|
||||
type AssessmentLabConsoleSessionCreate struct {
|
||||
Node AssessmentLabNodeName `json:"node"`
|
||||
}
|
||||
|
||||
// GetNode returns the value of Node.
|
||||
func (s *AssessmentLabConsoleSessionCreate) GetNode() AssessmentLabNodeName {
|
||||
return s.Node
|
||||
}
|
||||
|
||||
// SetNode sets the value of Node.
|
||||
func (s *AssessmentLabConsoleSessionCreate) SetNode(val AssessmentLabNodeName) {
|
||||
s.Node = val
|
||||
}
|
||||
|
||||
// AssessmentLabConsoleSessionHeaders wraps AssessmentLabConsoleSession with response headers.
|
||||
type AssessmentLabConsoleSessionHeaders struct {
|
||||
CacheControl CacheControlNoStore
|
||||
Response AssessmentLabConsoleSession
|
||||
}
|
||||
|
||||
// GetCacheControl returns the value of CacheControl.
|
||||
func (s *AssessmentLabConsoleSessionHeaders) GetCacheControl() CacheControlNoStore {
|
||||
return s.CacheControl
|
||||
}
|
||||
|
||||
// GetResponse returns the value of Response.
|
||||
func (s *AssessmentLabConsoleSessionHeaders) GetResponse() AssessmentLabConsoleSession {
|
||||
return s.Response
|
||||
}
|
||||
|
||||
// SetCacheControl sets the value of CacheControl.
|
||||
func (s *AssessmentLabConsoleSessionHeaders) SetCacheControl(val CacheControlNoStore) {
|
||||
s.CacheControl = val
|
||||
}
|
||||
|
||||
// SetResponse sets the value of Response.
|
||||
func (s *AssessmentLabConsoleSessionHeaders) SetResponse(val AssessmentLabConsoleSession) {
|
||||
s.Response = val
|
||||
}
|
||||
|
||||
func (*AssessmentLabConsoleSessionHeaders) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
// Start the lab of the current lab item. Unknown fields are rejected.
|
||||
// Ref: #/components/schemas/AssessmentLabCreate
|
||||
type AssessmentLabCreate struct {
|
||||
ItemID AssessmentItemId `json:"item_id"`
|
||||
}
|
||||
|
||||
// GetItemID returns the value of ItemID.
|
||||
func (s *AssessmentLabCreate) GetItemID() AssessmentItemId {
|
||||
return s.ItemID
|
||||
}
|
||||
|
||||
// SetItemID sets the value of ItemID.
|
||||
func (s *AssessmentLabCreate) SetItemID(val AssessmentItemId) {
|
||||
s.ItemID = val
|
||||
}
|
||||
|
||||
// Why a lab failed: `lab_error` for an infrastructure failure, such as a node that did not boot or a
|
||||
// check that could not reach a node. It never depends on the candidate and is never a failed check.
|
||||
// Ref: #/components/schemas/AssessmentLabFailureReason
|
||||
type AssessmentLabFailureReason string
|
||||
|
||||
const (
|
||||
AssessmentLabFailureReasonLabError AssessmentLabFailureReason = "lab_error"
|
||||
)
|
||||
|
||||
// AllValues returns all AssessmentLabFailureReason values.
|
||||
func (AssessmentLabFailureReason) AllValues() []AssessmentLabFailureReason {
|
||||
return []AssessmentLabFailureReason{
|
||||
AssessmentLabFailureReasonLabError,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s AssessmentLabFailureReason) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case AssessmentLabFailureReasonLabError:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *AssessmentLabFailureReason) UnmarshalText(data []byte) error {
|
||||
switch AssessmentLabFailureReason(data) {
|
||||
case AssessmentLabFailureReasonLabError:
|
||||
*s = AssessmentLabFailureReasonLabError
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
// AssessmentLabHeaders wraps AssessmentLab with response headers.
|
||||
type AssessmentLabHeaders struct {
|
||||
CacheControl CacheControlNoStore
|
||||
Response AssessmentLab
|
||||
}
|
||||
|
||||
// GetCacheControl returns the value of CacheControl.
|
||||
func (s *AssessmentLabHeaders) GetCacheControl() CacheControlNoStore {
|
||||
return s.CacheControl
|
||||
}
|
||||
|
||||
// GetResponse returns the value of Response.
|
||||
func (s *AssessmentLabHeaders) GetResponse() AssessmentLab {
|
||||
return s.Response
|
||||
}
|
||||
|
||||
// SetCacheControl sets the value of CacheControl.
|
||||
func (s *AssessmentLabHeaders) SetCacheControl(val CacheControlNoStore) {
|
||||
s.CacheControl = val
|
||||
}
|
||||
|
||||
// SetResponse sets the value of Response.
|
||||
func (s *AssessmentLabHeaders) SetResponse(val AssessmentLab) {
|
||||
s.Response = val
|
||||
}
|
||||
|
||||
func (*AssessmentLabHeaders) getMyAssessmentLabRes() {}
|
||||
func (*AssessmentLabHeaders) submitMyAssessmentLabRes() {}
|
||||
|
||||
// A node of a lab by its task name and kind. It never carries an address, a MAC address, a port, a
|
||||
// password, a key, or an infrastructure name.
|
||||
// Ref: #/components/schemas/AssessmentLabNode
|
||||
type AssessmentLabNode struct {
|
||||
Name AssessmentLabNodeName `json:"name"`
|
||||
Kind AssessmentLabNodeKind `json:"kind"`
|
||||
}
|
||||
|
||||
// GetName returns the value of Name.
|
||||
func (s *AssessmentLabNode) GetName() AssessmentLabNodeName {
|
||||
return s.Name
|
||||
}
|
||||
|
||||
// GetKind returns the value of Kind.
|
||||
func (s *AssessmentLabNode) GetKind() AssessmentLabNodeKind {
|
||||
return s.Kind
|
||||
}
|
||||
|
||||
// SetName sets the value of Name.
|
||||
func (s *AssessmentLabNode) SetName(val AssessmentLabNodeName) {
|
||||
s.Name = val
|
||||
}
|
||||
|
||||
// SetKind sets the value of Kind.
|
||||
func (s *AssessmentLabNode) SetKind(val AssessmentLabNodeKind) {
|
||||
s.Kind = val
|
||||
}
|
||||
|
||||
// What the console of a node shows.
|
||||
//
|
||||
// - mikrotik: a MikroTik router with the RouterOS console.
|
||||
// - ubuntu: a small Ubuntu server with a Linux login.
|
||||
//
|
||||
// Adding a value is a contract change.
|
||||
// Ref: #/components/schemas/AssessmentLabNodeKind
|
||||
type AssessmentLabNodeKind string
|
||||
|
||||
const (
|
||||
AssessmentLabNodeKindMikrotik AssessmentLabNodeKind = "mikrotik"
|
||||
AssessmentLabNodeKindUbuntu AssessmentLabNodeKind = "ubuntu"
|
||||
)
|
||||
|
||||
// AllValues returns all AssessmentLabNodeKind values.
|
||||
func (AssessmentLabNodeKind) AllValues() []AssessmentLabNodeKind {
|
||||
return []AssessmentLabNodeKind{
|
||||
AssessmentLabNodeKindMikrotik,
|
||||
AssessmentLabNodeKindUbuntu,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s AssessmentLabNodeKind) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case AssessmentLabNodeKindMikrotik:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabNodeKindUbuntu:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *AssessmentLabNodeKind) UnmarshalText(data []byte) error {
|
||||
switch AssessmentLabNodeKind(data) {
|
||||
case AssessmentLabNodeKindMikrotik:
|
||||
*s = AssessmentLabNodeKindMikrotik
|
||||
return nil
|
||||
case AssessmentLabNodeKindUbuntu:
|
||||
*s = AssessmentLabNodeKindUbuntu
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type AssessmentLabNodeName string
|
||||
|
||||
// State of a lab of an attempt item.
|
||||
//
|
||||
// - provisioning: the nodes are being prepared; poll GetMyAssessmentLab.
|
||||
// - ready: the consoles can be opened until `expires_at`.
|
||||
// - checking: the answer was accepted; the consoles are closed and the server checks the nodes.
|
||||
// - submitted: the check finished and the answer is recorded; the lab is deleted. The state never
|
||||
// says whether the answer was correct.
|
||||
// - expired: the lifetime or the attempt deadline ended before a submission; the lab is deleted and
|
||||
// the item cannot start another lab.
|
||||
// - failed: the lab infrastructure failed, independently of the candidate; `failure_reason` is
|
||||
// `lab_error`. Nothing was recorded or consumed, and the candidate may start a new lab of the same
|
||||
// item while the item is current.
|
||||
//
|
||||
// Adding a value is a contract change.
|
||||
// Ref: #/components/schemas/AssessmentLabState
|
||||
type AssessmentLabState string
|
||||
|
||||
const (
|
||||
AssessmentLabStateProvisioning AssessmentLabState = "provisioning"
|
||||
AssessmentLabStateReady AssessmentLabState = "ready"
|
||||
AssessmentLabStateChecking AssessmentLabState = "checking"
|
||||
AssessmentLabStateSubmitted AssessmentLabState = "submitted"
|
||||
AssessmentLabStateExpired AssessmentLabState = "expired"
|
||||
AssessmentLabStateFailed AssessmentLabState = "failed"
|
||||
)
|
||||
|
||||
// AllValues returns all AssessmentLabState values.
|
||||
func (AssessmentLabState) AllValues() []AssessmentLabState {
|
||||
return []AssessmentLabState{
|
||||
AssessmentLabStateProvisioning,
|
||||
AssessmentLabStateReady,
|
||||
AssessmentLabStateChecking,
|
||||
AssessmentLabStateSubmitted,
|
||||
AssessmentLabStateExpired,
|
||||
AssessmentLabStateFailed,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s AssessmentLabState) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case AssessmentLabStateProvisioning:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabStateReady:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabStateChecking:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabStateSubmitted:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabStateExpired:
|
||||
return []byte(s), nil
|
||||
case AssessmentLabStateFailed:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *AssessmentLabState) UnmarshalText(data []byte) error {
|
||||
switch AssessmentLabState(data) {
|
||||
case AssessmentLabStateProvisioning:
|
||||
*s = AssessmentLabStateProvisioning
|
||||
return nil
|
||||
case AssessmentLabStateReady:
|
||||
*s = AssessmentLabStateReady
|
||||
return nil
|
||||
case AssessmentLabStateChecking:
|
||||
*s = AssessmentLabStateChecking
|
||||
return nil
|
||||
case AssessmentLabStateSubmitted:
|
||||
*s = AssessmentLabStateSubmitted
|
||||
return nil
|
||||
case AssessmentLabStateExpired:
|
||||
*s = AssessmentLabStateExpired
|
||||
return nil
|
||||
case AssessmentLabStateFailed:
|
||||
*s = AssessmentLabStateFailed
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
// Submit the lab of the current lab item as its answer. Unknown fields are rejected, so a request
|
||||
// cannot send a score or a correctness flag.
|
||||
// Ref: #/components/schemas/AssessmentLabSubmission
|
||||
type AssessmentLabSubmission struct {
|
||||
ExpectedVersion AssessmentAttemptVersion `json:"expected_version"`
|
||||
Answer LabAnswer `json:"answer"`
|
||||
}
|
||||
|
||||
// GetExpectedVersion returns the value of ExpectedVersion.
|
||||
func (s *AssessmentLabSubmission) GetExpectedVersion() AssessmentAttemptVersion {
|
||||
return s.ExpectedVersion
|
||||
}
|
||||
|
||||
// GetAnswer returns the value of Answer.
|
||||
func (s *AssessmentLabSubmission) GetAnswer() LabAnswer {
|
||||
return s.Answer
|
||||
}
|
||||
|
||||
// SetExpectedVersion sets the value of ExpectedVersion.
|
||||
func (s *AssessmentLabSubmission) SetExpectedVersion(val AssessmentAttemptVersion) {
|
||||
s.ExpectedVersion = val
|
||||
}
|
||||
|
||||
// SetAnswer sets the value of Answer.
|
||||
func (s *AssessmentLabSubmission) SetAnswer(val LabAnswer) {
|
||||
s.Answer = val
|
||||
}
|
||||
|
||||
// Known limitation of the method behind a real-assessment result, shown with the result.
|
||||
//
|
||||
// - uncalibrated_thresholds: the thresholds are not yet validated on a pilot.
|
||||
@@ -9746,6 +10228,58 @@ type CreateMyAssessmentAttemptUnprocessableEntity Problem
|
||||
|
||||
func (*CreateMyAssessmentAttemptUnprocessableEntity) createMyAssessmentAttemptRes() {}
|
||||
|
||||
type CreateMyAssessmentLabBadRequest Problem
|
||||
|
||||
func (*CreateMyAssessmentLabBadRequest) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConflict Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConflict) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConsoleSessionBadRequest Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConsoleSessionBadRequest) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConsoleSessionConflict Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConsoleSessionConflict) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConsoleSessionForbidden Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConsoleSessionForbidden) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConsoleSessionNotFound Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConsoleSessionNotFound) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
type CreateMyAssessmentLabConsoleSessionUnauthorized Problem
|
||||
|
||||
func (*CreateMyAssessmentLabConsoleSessionUnauthorized) createMyAssessmentLabConsoleSessionRes() {}
|
||||
|
||||
type CreateMyAssessmentLabCreated AssessmentLabHeaders
|
||||
|
||||
func (*CreateMyAssessmentLabCreated) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabForbidden Problem
|
||||
|
||||
func (*CreateMyAssessmentLabForbidden) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabNotFound Problem
|
||||
|
||||
func (*CreateMyAssessmentLabNotFound) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabOK AssessmentLabHeaders
|
||||
|
||||
func (*CreateMyAssessmentLabOK) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabUnauthorized Problem
|
||||
|
||||
func (*CreateMyAssessmentLabUnauthorized) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentLabUnprocessableEntity Problem
|
||||
|
||||
func (*CreateMyAssessmentLabUnprocessableEntity) createMyAssessmentLabRes() {}
|
||||
|
||||
type CreateMyAssessmentPracticeRunBadRequest Problem
|
||||
|
||||
func (*CreateMyAssessmentPracticeRunBadRequest) createMyAssessmentPracticeRunRes() {}
|
||||
@@ -11015,6 +11549,18 @@ type GetMyAssessmentAvailabilityUnauthorized Problem
|
||||
|
||||
func (*GetMyAssessmentAvailabilityUnauthorized) getMyAssessmentAvailabilityRes() {}
|
||||
|
||||
type GetMyAssessmentLabForbidden Problem
|
||||
|
||||
func (*GetMyAssessmentLabForbidden) getMyAssessmentLabRes() {}
|
||||
|
||||
type GetMyAssessmentLabNotFound Problem
|
||||
|
||||
func (*GetMyAssessmentLabNotFound) getMyAssessmentLabRes() {}
|
||||
|
||||
type GetMyAssessmentLabUnauthorized Problem
|
||||
|
||||
func (*GetMyAssessmentLabUnauthorized) getMyAssessmentLabRes() {}
|
||||
|
||||
type GetMyAssessmentPracticeRunForbidden Problem
|
||||
|
||||
func (*GetMyAssessmentPracticeRunForbidden) getMyAssessmentPracticeRunRes() {}
|
||||
@@ -12862,6 +13408,7 @@ type ItemContent struct {
|
||||
FindErrorItemContent FindErrorItemContent
|
||||
ConfigurationItemContent ConfigurationItemContent
|
||||
PracticeItemContent PracticeItemContent
|
||||
LabItemContent LabItemContent
|
||||
}
|
||||
|
||||
// ItemContentType is oneOf type of ItemContent.
|
||||
@@ -12876,6 +13423,7 @@ const (
|
||||
FindErrorItemContentItemContent ItemContentType = "FindErrorItemContent"
|
||||
ConfigurationItemContentItemContent ItemContentType = "ConfigurationItemContent"
|
||||
PracticeItemContentItemContent ItemContentType = "PracticeItemContent"
|
||||
LabItemContentItemContent ItemContentType = "LabItemContent"
|
||||
)
|
||||
|
||||
// IsChoiceItemContent reports whether ItemContent is ChoiceItemContent.
|
||||
@@ -12901,6 +13449,9 @@ func (s ItemContent) IsConfigurationItemContent() bool {
|
||||
// IsPracticeItemContent reports whether ItemContent is PracticeItemContent.
|
||||
func (s ItemContent) IsPracticeItemContent() bool { return s.Type == PracticeItemContentItemContent }
|
||||
|
||||
// IsLabItemContent reports whether ItemContent is LabItemContent.
|
||||
func (s ItemContent) IsLabItemContent() bool { return s.Type == LabItemContentItemContent }
|
||||
|
||||
// SetChoiceItemContent sets ItemContent to ChoiceItemContent.
|
||||
func (s *ItemContent) SetChoiceItemContent(v ChoiceItemContent) {
|
||||
s.Type = ChoiceItemContentItemContent
|
||||
@@ -13048,6 +13599,172 @@ func NewPracticeItemContentItemContent(v PracticeItemContent) ItemContent {
|
||||
return s
|
||||
}
|
||||
|
||||
// SetLabItemContent sets ItemContent to LabItemContent.
|
||||
func (s *ItemContent) SetLabItemContent(v LabItemContent) {
|
||||
s.Type = LabItemContentItemContent
|
||||
s.LabItemContent = v
|
||||
}
|
||||
|
||||
// GetLabItemContent returns LabItemContent and true boolean if ItemContent is LabItemContent.
|
||||
func (s ItemContent) GetLabItemContent() (v LabItemContent, ok bool) {
|
||||
if !s.IsLabItemContent() {
|
||||
return v, false
|
||||
}
|
||||
return s.LabItemContent, true
|
||||
}
|
||||
|
||||
// NewLabItemContentItemContent returns new ItemContent from LabItemContent.
|
||||
func NewLabItemContentItemContent(v LabItemContent) ItemContent {
|
||||
var s ItemContent
|
||||
s.SetLabItemContent(v)
|
||||
return s
|
||||
}
|
||||
|
||||
// Answer of a lab item: the state of the nodes of the named lab at the moment of submission. The
|
||||
// server reads that state with the checker of the task; the body carries no configuration text, score,
|
||||
// or correctness flag. Two answers are equal when they name the same lab. It is the answer of
|
||||
// SubmitMyAssessmentLab only and is not a member of AssessmentAnswer.
|
||||
// Ref: #/components/schemas/LabAnswer
|
||||
type LabAnswer struct {
|
||||
Format LabAnswerFormat `json:"format"`
|
||||
// The lab of this item that the candidate worked in.
|
||||
LabID uuid.UUID `json:"lab_id"`
|
||||
}
|
||||
|
||||
// GetFormat returns the value of Format.
|
||||
func (s *LabAnswer) GetFormat() LabAnswerFormat {
|
||||
return s.Format
|
||||
}
|
||||
|
||||
// GetLabID returns the value of LabID.
|
||||
func (s *LabAnswer) GetLabID() uuid.UUID {
|
||||
return s.LabID
|
||||
}
|
||||
|
||||
// SetFormat sets the value of Format.
|
||||
func (s *LabAnswer) SetFormat(val LabAnswerFormat) {
|
||||
s.Format = val
|
||||
}
|
||||
|
||||
// SetLabID sets the value of LabID.
|
||||
func (s *LabAnswer) SetLabID(val uuid.UUID) {
|
||||
s.LabID = val
|
||||
}
|
||||
|
||||
type LabAnswerFormat string
|
||||
|
||||
const (
|
||||
LabAnswerFormatLab LabAnswerFormat = "lab"
|
||||
)
|
||||
|
||||
// AllValues returns all LabAnswerFormat values.
|
||||
func (LabAnswerFormat) AllValues() []LabAnswerFormat {
|
||||
return []LabAnswerFormat{
|
||||
LabAnswerFormatLab,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s LabAnswerFormat) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case LabAnswerFormatLab:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *LabAnswerFormat) UnmarshalText(data []byte) error {
|
||||
switch LabAnswerFormat(data) {
|
||||
case LabAnswerFormatLab:
|
||||
*s = LabAnswerFormatLab
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
// Practical lab: configure or repair a small network of virtual nodes through their consoles. The
|
||||
// candidate starts the lab of the item with CreateMyAssessmentLab, works in the node consoles, and
|
||||
// submits with SubmitMyAssessmentLab; the server then checks the state of the nodes. The content lists
|
||||
// only the nodes the statement names and the lifetime of the lab, never the checker, its criteria, the
|
||||
// seed, or an address. SubmitMyAssessmentAnswer takes no answer to a lab item; its result is submitted
|
||||
// only with SubmitMyAssessmentLab.
|
||||
// Ref: #/components/schemas/LabItemContent
|
||||
type LabItemContent struct {
|
||||
Format LabItemContentFormat `json:"format"`
|
||||
// Nodes of the lab in the order of the statement.
|
||||
Nodes []AssessmentLabNode `json:"nodes"`
|
||||
// Lifetime of a lab of this item from its creation. The lab also ends no later than the attempt
|
||||
// deadline.
|
||||
TimeLimitSeconds int32 `json:"time_limit_seconds"`
|
||||
}
|
||||
|
||||
// GetFormat returns the value of Format.
|
||||
func (s *LabItemContent) GetFormat() LabItemContentFormat {
|
||||
return s.Format
|
||||
}
|
||||
|
||||
// GetNodes returns the value of Nodes.
|
||||
func (s *LabItemContent) GetNodes() []AssessmentLabNode {
|
||||
return s.Nodes
|
||||
}
|
||||
|
||||
// GetTimeLimitSeconds returns the value of TimeLimitSeconds.
|
||||
func (s *LabItemContent) GetTimeLimitSeconds() int32 {
|
||||
return s.TimeLimitSeconds
|
||||
}
|
||||
|
||||
// SetFormat sets the value of Format.
|
||||
func (s *LabItemContent) SetFormat(val LabItemContentFormat) {
|
||||
s.Format = val
|
||||
}
|
||||
|
||||
// SetNodes sets the value of Nodes.
|
||||
func (s *LabItemContent) SetNodes(val []AssessmentLabNode) {
|
||||
s.Nodes = val
|
||||
}
|
||||
|
||||
// SetTimeLimitSeconds sets the value of TimeLimitSeconds.
|
||||
func (s *LabItemContent) SetTimeLimitSeconds(val int32) {
|
||||
s.TimeLimitSeconds = val
|
||||
}
|
||||
|
||||
type LabItemContentFormat string
|
||||
|
||||
const (
|
||||
LabItemContentFormatLab LabItemContentFormat = "lab"
|
||||
)
|
||||
|
||||
// AllValues returns all LabItemContentFormat values.
|
||||
func (LabItemContentFormat) AllValues() []LabItemContentFormat {
|
||||
return []LabItemContentFormat{
|
||||
LabItemContentFormatLab,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s LabItemContentFormat) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case LabItemContentFormatLab:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *LabItemContentFormat) UnmarshalText(data []byte) error {
|
||||
switch LabItemContentFormat(data) {
|
||||
case LabItemContentFormatLab:
|
||||
*s = LabItemContentFormatLab
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type ListMyAssessmentResultsBadRequest Problem
|
||||
|
||||
func (*ListMyAssessmentResultsBadRequest) listMyAssessmentResultsRes() {}
|
||||
@@ -17873,6 +18590,51 @@ func (o NilAssessmentItem) Or(d AssessmentItem) AssessmentItem {
|
||||
return d
|
||||
}
|
||||
|
||||
// NewNilAssessmentLabFailureReason returns new NilAssessmentLabFailureReason with value set to v.
|
||||
func NewNilAssessmentLabFailureReason(v AssessmentLabFailureReason) NilAssessmentLabFailureReason {
|
||||
return NilAssessmentLabFailureReason{
|
||||
Value: v,
|
||||
}
|
||||
}
|
||||
|
||||
// NilAssessmentLabFailureReason is nullable AssessmentLabFailureReason.
|
||||
type NilAssessmentLabFailureReason struct {
|
||||
Value AssessmentLabFailureReason
|
||||
Null bool
|
||||
}
|
||||
|
||||
// SetTo sets value to v.
|
||||
func (o *NilAssessmentLabFailureReason) SetTo(v AssessmentLabFailureReason) {
|
||||
o.Null = false
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// IsNull returns true if value is Null.
|
||||
func (o NilAssessmentLabFailureReason) IsNull() bool { return o.Null }
|
||||
|
||||
// SetToNull sets value to null.
|
||||
func (o *NilAssessmentLabFailureReason) SetToNull() {
|
||||
o.Null = true
|
||||
var v AssessmentLabFailureReason
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// Get returns value and boolean that denotes whether value was set.
|
||||
func (o NilAssessmentLabFailureReason) Get() (v AssessmentLabFailureReason, ok bool) {
|
||||
if o.Null {
|
||||
return v, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// Or returns value if set, or given parameter if does not.
|
||||
func (o NilAssessmentLabFailureReason) Or(d AssessmentLabFailureReason) AssessmentLabFailureReason {
|
||||
if v, ok := o.Get(); ok {
|
||||
return v
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// NewNilAssessmentNotDeterminedReason returns new NilAssessmentNotDeterminedReason with value set to v.
|
||||
func NewNilAssessmentNotDeterminedReason(v AssessmentNotDeterminedReason) NilAssessmentNotDeterminedReason {
|
||||
return NilAssessmentNotDeterminedReason{
|
||||
@@ -30237,7 +30999,10 @@ func (s *ServiceUnavailableHeaders) SetResponse(val Problem) {
|
||||
s.Response = val
|
||||
}
|
||||
|
||||
func (*ServiceUnavailableHeaders) createMyAssessmentPracticeRunRes() {}
|
||||
func (*ServiceUnavailableHeaders) createMyAssessmentLabConsoleSessionRes() {}
|
||||
func (*ServiceUnavailableHeaders) createMyAssessmentLabRes() {}
|
||||
func (*ServiceUnavailableHeaders) createMyAssessmentPracticeRunRes() {}
|
||||
func (*ServiceUnavailableHeaders) submitMyAssessmentLabRes() {}
|
||||
|
||||
// Current session as the client may see it: the account and the CSRF token. The session identifier
|
||||
// itself travels only in the HttpOnly session cookie and never appears in a body.
|
||||
@@ -30717,6 +31482,34 @@ type SubmitMyAssessmentAnswerUnprocessableEntity Problem
|
||||
|
||||
func (*SubmitMyAssessmentAnswerUnprocessableEntity) submitMyAssessmentAnswerRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabBadRequest Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabBadRequest) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabConflict Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabConflict) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabForbidden Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabForbidden) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabNotFound Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabNotFound) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabPreconditionFailed Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabPreconditionFailed) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabUnauthorized Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabUnauthorized) submitMyAssessmentLabRes() {}
|
||||
|
||||
type SubmitMyAssessmentLabUnprocessableEntity Problem
|
||||
|
||||
func (*SubmitMyAssessmentLabUnprocessableEntity) submitMyAssessmentLabRes() {}
|
||||
|
||||
// Case of the current account. It contains what the author sent, the public processing state, and the
|
||||
// public history. It never contains the identity of a moderator, an expert, or a support agent,
|
||||
// internal notes, evidence, assessment answers or anti-cheat signals, risk signals, or contact data of
|
||||
@@ -32837,36 +33630,39 @@ func (s *TooManyRequestsHeaders) SetResponse(val Problem) {
|
||||
s.Response = val
|
||||
}
|
||||
|
||||
func (*TooManyRequestsHeaders) acceptMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) cancelMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) confirmEmailByCodeRes() {}
|
||||
func (*TooManyRequestsHeaders) confirmEmailRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentAttemptRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentPracticeRunRes() {}
|
||||
func (*TooManyRequestsHeaders) createMySupportCaseRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationNeedRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) declineMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) getOrganizationCandidateCardRes() {}
|
||||
func (*TooManyRequestsHeaders) getOrganizationCandidateEvidenceRes() {}
|
||||
func (*TooManyRequestsHeaders) hideOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) loginRes() {}
|
||||
func (*TooManyRequestsHeaders) markMyNotificationReadRes() {}
|
||||
func (*TooManyRequestsHeaders) markOrganizationNotificationReadRes() {}
|
||||
func (*TooManyRequestsHeaders) raiseOrganizationInvitationSalaryRes() {}
|
||||
func (*TooManyRequestsHeaders) recordMyAssessmentAttemptSignalsRes() {}
|
||||
func (*TooManyRequestsHeaders) registerAccountRes() {}
|
||||
func (*TooManyRequestsHeaders) requestMyRepositoryChecksRes() {}
|
||||
func (*TooManyRequestsHeaders) resendEmailVerificationRes() {}
|
||||
func (*TooManyRequestsHeaders) sendOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) startMyAssessmentAttemptSessionRes() {}
|
||||
func (*TooManyRequestsHeaders) submitMyAssessmentAnswerRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationNeedRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) viewMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) withdrawOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) acceptMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) cancelMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) confirmEmailByCodeRes() {}
|
||||
func (*TooManyRequestsHeaders) confirmEmailRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentAttemptRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentLabConsoleSessionRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentLabRes() {}
|
||||
func (*TooManyRequestsHeaders) createMyAssessmentPracticeRunRes() {}
|
||||
func (*TooManyRequestsHeaders) createMySupportCaseRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationNeedRes() {}
|
||||
func (*TooManyRequestsHeaders) createOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) declineMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) getOrganizationCandidateCardRes() {}
|
||||
func (*TooManyRequestsHeaders) getOrganizationCandidateEvidenceRes() {}
|
||||
func (*TooManyRequestsHeaders) hideOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) loginRes() {}
|
||||
func (*TooManyRequestsHeaders) markMyNotificationReadRes() {}
|
||||
func (*TooManyRequestsHeaders) markOrganizationNotificationReadRes() {}
|
||||
func (*TooManyRequestsHeaders) raiseOrganizationInvitationSalaryRes() {}
|
||||
func (*TooManyRequestsHeaders) recordMyAssessmentAttemptSignalsRes() {}
|
||||
func (*TooManyRequestsHeaders) registerAccountRes() {}
|
||||
func (*TooManyRequestsHeaders) requestMyRepositoryChecksRes() {}
|
||||
func (*TooManyRequestsHeaders) resendEmailVerificationRes() {}
|
||||
func (*TooManyRequestsHeaders) sendOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) startMyAssessmentAttemptSessionRes() {}
|
||||
func (*TooManyRequestsHeaders) submitMyAssessmentAnswerRes() {}
|
||||
func (*TooManyRequestsHeaders) submitMyAssessmentLabRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationNeedRes() {}
|
||||
func (*TooManyRequestsHeaders) updateOrganizationRes() {}
|
||||
func (*TooManyRequestsHeaders) viewMyInvitationRes() {}
|
||||
func (*TooManyRequestsHeaders) withdrawOrganizationInvitationRes() {}
|
||||
|
||||
type UnhideOrganizationBadRequest Problem
|
||||
|
||||
|
||||
Reference in new issue
Block a user