feat(evidence): project skill evidence from confirmed assessments

This commit is contained in:
shira committed 2026-10-09 11:25:19 +03:00
1 parent 4761508f13
commit c2a8d17195
94 files changed
+10077 -151

No files matched your search

@@ -4511,6 +4511,13 @@ func (s *Server) handleGetMyAssessmentSignalNoticeRequest(args [0]string, argsEs
// formats appear only through their separate explicit publication choices, and self-assessment never
// becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
//
// `evidence` shows what an organization would read in the evidence section of the card
// (`GetOrganizationCandidateEvidence`): for each category of the card, the one assessment fact that
// supports its confirmed grade, with its skill, the passed grade, the trust level, the year, and the
// basis and calibration (`synthetic_demo`, `uncalibrated`). It is null while `card` is null, and an
// empty list when the card shows no category or no visible fact supports one. The preview applies no
// organization or cohort, so an organization can still receive less.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account
// answers 403 forbidden.
//
@@ -6379,6 +6386,243 @@ func (s *Server) handleGetOrganizationCandidateCardRequest(args [2]string, argsE
}
}
// handleGetOrganizationCandidateEvidenceRequest handles GetOrganizationCandidateEvidence operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
// organization and membership come from the current server-side session and path, never from cached
// search data.
//
// `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card
// projection. The server runs the same checks as the card read on every request: active membership,
// effective C2 publication, the candidate's hiding of this organization, and the minimum cohort. In
// addition the card must publish the `categories` field and show at least one category after the
// cohort rules, because the evidence explains those categories and discloses nothing beyond them. An
// unknown handle, a handle of another organization, a closed or revoked publication, a profile hidden
// from this organization, a profile suppressed by the minimum cohort, and a card without categories
// all answer the same 404 not_found. Closing C2 or hiding the organization blocks this read
// immediately, and a cached response proves nothing.
//
// The response lists, for each category of the card, the one visible fact that supports its confirmed
// grade: the earliest assessment that passed exactly that grade, so a lower grade or a retake adds
// nothing. A fact the candidate hid is absent. Each fact carries only the skill, the passed grade, the
// trust level, the year of the assessment, and the basis and calibration of the method
// (`synthetic_demo`, `uncalibrated`), which are the same for every candidate and say that the fact is
// a demonstration, not a validated measurement. It carries no identifier of the fact, event, result,
// or candidate, no month or exact time, and never an answer, item, score, failed attempt, review band,
// or anti-cheat signal. An express training run and a failed attempt create no fact. The answer has no
// key that joins it to a person, but it is not unlinkable: with the other values of the card it can
// narrow a small pool of candidates.
//
// Reading the evidence is a view of the candidate card: it consumes the organization's current
// card-view quota with the same distinct-card rule and is recorded in the access history with the
// `categories` field. When the quota is exhausted the operation answers 429 with Retry-After. The
// response is `Cache-Control: no-store`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account
// answers 403 forbidden; an unknown organization or account without an active membership answers 404
// not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400
// validation_failed.
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence
func (s *Server) handleGetOrganizationCandidateEvidenceRequest(args [2]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) {
statusWriter := &codeRecorder{ResponseWriter: w}
w = statusWriter
otelAttrs := []attribute.KeyValue{
otelogen.OperationID("GetOrganizationCandidateEvidence"),
semconv.HTTPRequestMethodKey.String("GET"),
semconv.HTTPRouteKey.String("/api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence"),
}
// Add attributes from config.
otelAttrs = append(otelAttrs, s.cfg.Attributes...)
// Start a span for this request.
ctx, span := s.cfg.Tracer.Start(r.Context(), GetOrganizationCandidateEvidenceOperation,
trace.WithAttributes(otelAttrs...),
serverSpanKind,
)
defer span.End()
// Add Labeler to context.
labeler := &Labeler{attrs: otelAttrs}
ctx = contextWithLabeler(ctx, labeler)
// Run stopwatch.
startTime := time.Now()
defer func() {
elapsedDuration := time.Since(startTime)
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
code := statusWriter.status
if code != 0 {
codeAttr := semconv.HTTPResponseStatusCode(code)
attrs = append(attrs, codeAttr)
span.SetAttributes(attrs...)
}
attrOpt := metric.WithAttributes(attrs...)
// Increment request counter.
s.requests.Add(ctx, 1, attrOpt)
// Use floating point division here for higher precision (instead of Millisecond method).
s.duration.Record(ctx, float64(elapsedDuration)/float64(time.Millisecond), attrOpt)
}()
var (
recordError = func(stage string, err error) {
span.RecordError(err)
// https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
// Span Status MUST be left unset if HTTP status code was in the 1xx, 2xx or 3xx ranges,
// unless there was another error (e.g., network error receiving the response body; or 3xx codes with
// max redirects exceeded), in which case status MUST be set to Error.
code := statusWriter.status
if code < 100 || code >= 500 {
span.SetStatus(codes.Error, stage)
}
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
if code != 0 {
attrs = append(attrs, semconv.HTTPResponseStatusCode(code))
}
s.errors.Add(ctx, 1, metric.WithAttributes(attrs...))
}
err error
opErrContext = ogenerrors.OperationContext{
Name: GetOrganizationCandidateEvidenceOperation,
ID: "GetOrganizationCandidateEvidence",
}
)
{
type bitset = [1]uint8
var satisfied bitset
{
sctx, ok, err := s.securitySessionCookie(ctx, GetOrganizationCandidateEvidenceOperation, r)
if err != nil {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Security: "SessionCookie",
Err: err,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security:SessionCookie", err)
}
return
}
if ok {
satisfied[0] |= 1 << 0
ctx = sctx
}
}
if ok := func() bool {
nextRequirement:
for _, requirement := range []bitset{
{0b00000001},
} {
for i, mask := range requirement {
if satisfied[i]&mask != mask {
continue nextRequirement
}
}
return true
}
return false
}(); !ok {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security", err)
}
return
}
}
params, err := decodeGetOrganizationCandidateEvidenceParams(args, argsEscaped, r)
if err != nil {
err = &ogenerrors.DecodeParamsError{
OperationContext: opErrContext,
Err: err,
}
defer recordError("DecodeParams", err)
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
var rawBody []byte
var response GetOrganizationCandidateEvidenceRes
if m := s.cfg.Middleware; m != nil {
mreq := middleware.Request{
Context: ctx,
OperationName: GetOrganizationCandidateEvidenceOperation,
OperationSummary: "Read the permitted skill evidence of one currently visible candidate card.",
OperationID: "GetOrganizationCandidateEvidence",
Body: nil,
RawBody: rawBody,
Params: middleware.Parameters{
{
Name: "org_id",
In: "path",
}: params.OrgID,
{
Name: "candidate_handle",
In: "path",
}: params.CandidateHandle,
},
Raw: r,
}
type (
Request = struct{}
Params = GetOrganizationCandidateEvidenceParams
Response = GetOrganizationCandidateEvidenceRes
)
response, err = middleware.HookMiddleware[
Request,
Params,
Response,
](
m,
mreq,
unpackGetOrganizationCandidateEvidenceParams,
func(ctx context.Context, request Request, params Params) (response Response, err error) {
response, err = s.h.GetOrganizationCandidateEvidence(ctx, params)
return response, err
},
)
} else {
response, err = s.h.GetOrganizationCandidateEvidence(ctx, params)
}
if err != nil {
if errRes, ok := errors.Into[*ProblemStatusCode](err); ok {
if err := encodeErrorResponse(errRes, w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if errors.Is(err, ht.ErrNotImplemented) {
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
if err := encodeErrorResponse(s.h.NewError(ctx, err), w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if err := encodeGetOrganizationCandidateEvidenceResponse(response, w, span); err != nil {
defer recordError("EncodeResponse", err)
if !errors.Is(err, ht.ErrInternalServerErrorResponse) {
s.cfg.ErrorHandler(ctx, w, r, err)
}
return
}
}
// handleGetOrganizationInvitationRequest handles GetOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
@@ -8367,6 +8611,228 @@ func (s *Server) handleListMyConsentsRequest(args [0]string, argsEscaped bool, w
}
}
// handleListMyEvidenceRequest handles ListMyEvidence operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
// response holds only the caller's own facts. Returns a page, newest event first with the fact
// identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
//
// A fact is derived from the immutable result of a confirmed real assessment (root or corrective), in
// the same transaction that stores the result. Each fact names its source (the event and the result,
// which the candidate can open at `GetMyAssessmentResult`), the skills of the event, the grade that
// was passed with its basis and calibration, the attribution, the date, the visibility, and the trust
// level. An online assessment without a reliable confirmation of the identity has trust 1. One source
// event is one fact: its skills are tags of that fact, so several tags never make several facts.
//
// The list never carries raw answers, items, scores, failed attempts, or anti-cheat data. A failed
// attempt, a result without a reviewed category source, and an express training run (`demo_express`)
// create no fact, so reading the list before and after an express run shows no new fact. The list
// includes facts the candidate hid, with `visibility` `hidden`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account, or
// a candidate with an unverified email, answers 403 forbidden. A malformed `limit` or `cursor`, or a
// cursor of another candidate, answers 400 validation_failed.
//
// GET /api/v1/me/evidence
func (s *Server) handleListMyEvidenceRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) {
statusWriter := &codeRecorder{ResponseWriter: w}
w = statusWriter
otelAttrs := []attribute.KeyValue{
otelogen.OperationID("ListMyEvidence"),
semconv.HTTPRequestMethodKey.String("GET"),
semconv.HTTPRouteKey.String("/api/v1/me/evidence"),
}
// Add attributes from config.
otelAttrs = append(otelAttrs, s.cfg.Attributes...)
// Start a span for this request.
ctx, span := s.cfg.Tracer.Start(r.Context(), ListMyEvidenceOperation,
trace.WithAttributes(otelAttrs...),
serverSpanKind,
)
defer span.End()
// Add Labeler to context.
labeler := &Labeler{attrs: otelAttrs}
ctx = contextWithLabeler(ctx, labeler)
// Run stopwatch.
startTime := time.Now()
defer func() {
elapsedDuration := time.Since(startTime)
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
code := statusWriter.status
if code != 0 {
codeAttr := semconv.HTTPResponseStatusCode(code)
attrs = append(attrs, codeAttr)
span.SetAttributes(attrs...)
}
attrOpt := metric.WithAttributes(attrs...)
// Increment request counter.
s.requests.Add(ctx, 1, attrOpt)
// Use floating point division here for higher precision (instead of Millisecond method).
s.duration.Record(ctx, float64(elapsedDuration)/float64(time.Millisecond), attrOpt)
}()
var (
recordError = func(stage string, err error) {
span.RecordError(err)
// https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
// Span Status MUST be left unset if HTTP status code was in the 1xx, 2xx or 3xx ranges,
// unless there was another error (e.g., network error receiving the response body; or 3xx codes with
// max redirects exceeded), in which case status MUST be set to Error.
code := statusWriter.status
if code < 100 || code >= 500 {
span.SetStatus(codes.Error, stage)
}
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
if code != 0 {
attrs = append(attrs, semconv.HTTPResponseStatusCode(code))
}
s.errors.Add(ctx, 1, metric.WithAttributes(attrs...))
}
err error
opErrContext = ogenerrors.OperationContext{
Name: ListMyEvidenceOperation,
ID: "ListMyEvidence",
}
)
{
type bitset = [1]uint8
var satisfied bitset
{
sctx, ok, err := s.securitySessionCookie(ctx, ListMyEvidenceOperation, r)
if err != nil {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Security: "SessionCookie",
Err: err,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security:SessionCookie", err)
}
return
}
if ok {
satisfied[0] |= 1 << 0
ctx = sctx
}
}
if ok := func() bool {
nextRequirement:
for _, requirement := range []bitset{
{0b00000001},
} {
for i, mask := range requirement {
if satisfied[i]&mask != mask {
continue nextRequirement
}
}
return true
}
return false
}(); !ok {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security", err)
}
return
}
}
params, err := decodeListMyEvidenceParams(args, argsEscaped, r)
if err != nil {
err = &ogenerrors.DecodeParamsError{
OperationContext: opErrContext,
Err: err,
}
defer recordError("DecodeParams", err)
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
var rawBody []byte
var response ListMyEvidenceRes
if m := s.cfg.Middleware; m != nil {
mreq := middleware.Request{
Context: ctx,
OperationName: ListMyEvidenceOperation,
OperationSummary: "List the skill evidence of the current candidate.",
OperationID: "ListMyEvidence",
Body: nil,
RawBody: rawBody,
Params: middleware.Parameters{
{
Name: "limit",
In: "query",
}: params.Limit,
{
Name: "cursor",
In: "query",
}: params.Cursor,
},
Raw: r,
}
type (
Request = struct{}
Params = ListMyEvidenceParams
Response = ListMyEvidenceRes
)
response, err = middleware.HookMiddleware[
Request,
Params,
Response,
](
m,
mreq,
unpackListMyEvidenceParams,
func(ctx context.Context, request Request, params Params) (response Response, err error) {
response, err = s.h.ListMyEvidence(ctx, params)
return response, err
},
)
} else {
response, err = s.h.ListMyEvidence(ctx, params)
}
if err != nil {
if errRes, ok := errors.Into[*ProblemStatusCode](err); ok {
if err := encodeErrorResponse(errRes, w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if errors.Is(err, ht.ErrNotImplemented) {
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
if err := encodeErrorResponse(s.h.NewError(ctx, err), w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if err := encodeListMyEvidenceResponse(response, w, span); err != nil {
defer recordError("EncodeResponse", err)
if !errors.Is(err, ht.ErrInternalServerErrorResponse) {
s.cfg.ErrorHandler(ctx, w, r, err)
}
return
}
}
// handleListMyHiddenOrganizationsRequest handles ListMyHiddenOrganizations operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
@@ -105,6 +105,10 @@ type GetOrganizationCandidateCardRes interface {
getOrganizationCandidateCardRes()
}
type GetOrganizationCandidateEvidenceRes interface {
getOrganizationCandidateEvidenceRes()
}
type GetOrganizationInvitationContactsRes interface {
getOrganizationInvitationContactsRes()
}
@@ -141,6 +145,10 @@ type ListMyConsentsRes interface {
listMyConsentsRes()
}
type ListMyEvidenceRes interface {
listMyEvidenceRes()
}
type ListMyHiddenOrganizationsRes interface {
listMyHiddenOrganizationsRes()
}
File diff suppressed because it is too large. Load diff
@@ -34,6 +34,7 @@ const (
GetMySupportCaseOperation OperationName = "GetMySupportCase"
GetOrganizationOperation OperationName = "GetOrganization"
GetOrganizationCandidateCardOperation OperationName = "GetOrganizationCandidateCard"
GetOrganizationCandidateEvidenceOperation OperationName = "GetOrganizationCandidateEvidence"
GetOrganizationInvitationOperation OperationName = "GetOrganizationInvitation"
GetOrganizationInvitationContactsOperation OperationName = "GetOrganizationInvitationContacts"
GetOrganizationNeedOperation OperationName = "GetOrganizationNeed"
@@ -43,6 +44,7 @@ const (
ListMyAssessmentResultsOperation OperationName = "ListMyAssessmentResults"
ListMyCardAccessHistoryOperation OperationName = "ListMyCardAccessHistory"
ListMyConsentsOperation OperationName = "ListMyConsents"
ListMyEvidenceOperation OperationName = "ListMyEvidence"
ListMyHiddenOrganizationsOperation OperationName = "ListMyHiddenOrganizations"
ListMyInvitationsOperation OperationName = "ListMyInvitations"
ListMyOrganizationsOperation OperationName = "ListMyOrganizations"
@@ -1917,6 +1917,147 @@ func decodeGetOrganizationCandidateCardParams(args [2]string, argsEscaped bool,
return params, nil
}
// GetOrganizationCandidateEvidenceParams is parameters of GetOrganizationCandidateEvidence operation.
type GetOrganizationCandidateEvidenceParams struct {
// Identifier of an organization. Access comes only from an active membership of the session account in
// this organization, checked by the server on every request; the identifier itself grants nothing. An
// organization without such a membership and an unknown identifier both answer 404 not_found, so
// organizations cannot be enumerated.
OrgID uuid.UUID
// Organization-scoped opaque candidate alias issued by the current visible card projection. The server
// resolves it only for the organization in the path and rechecks current membership, publication
// consent, and hiding on every read. Unknown, hidden, unpublished, and suppressed candidates all
// answer the same 404.
CandidateHandle CandidateHandle
}
func unpackGetOrganizationCandidateEvidenceParams(packed middleware.Parameters) (params GetOrganizationCandidateEvidenceParams) {
{
key := middleware.ParameterKey{
Name: "org_id",
In: "path",
}
params.OrgID = packed[key].(uuid.UUID)
}
{
key := middleware.ParameterKey{
Name: "candidate_handle",
In: "path",
}
params.CandidateHandle = packed[key].(CandidateHandle)
}
return params
}
func decodeGetOrganizationCandidateEvidenceParams(args [2]string, argsEscaped bool, r *http.Request) (params GetOrganizationCandidateEvidenceParams, _ error) {
// Decode path: org_id.
if err := func() error {
param := args[0]
if argsEscaped {
unescaped, err := url.PathUnescape(args[0])
if err != nil {
return errors.Wrap(err, "unescape path")
}
param = unescaped
}
if len(param) > 0 {
d := uri.NewPathDecoder(uri.PathDecoderConfig{
Param: "org_id",
Value: param,
Style: uri.PathStyleSimple,
Explode: false,
})
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToUUID(val)
if err != nil {
return err
}
params.OrgID = c
return nil
}(); err != nil {
return err
}
} else {
return validate.ErrFieldRequired
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "org_id",
In: "path",
Err: err,
}
}
// Decode path: candidate_handle.
if err := func() error {
param := args[1]
if argsEscaped {
unescaped, err := url.PathUnescape(args[1])
if err != nil {
return errors.Wrap(err, "unescape path")
}
param = unescaped
}
if len(param) > 0 {
d := uri.NewPathDecoder(uri.PathDecoderConfig{
Param: "candidate_handle",
Value: param,
Style: uri.PathStyleSimple,
Explode: false,
})
if err := func() error {
var paramsDotCandidateHandleVal string
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToString(val)
if err != nil {
return err
}
paramsDotCandidateHandleVal = c
return nil
}(); err != nil {
return err
}
params.CandidateHandle = CandidateHandle(paramsDotCandidateHandleVal)
return nil
}(); err != nil {
return err
}
if err := func() error {
if err := params.CandidateHandle.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
} else {
return validate.ErrFieldRequired
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "candidate_handle",
In: "path",
Err: err,
}
}
return params, nil
}
// GetOrganizationInvitationParams is parameters of GetOrganizationInvitation operation.
type GetOrganizationInvitationParams struct {
// Identifier of an organization. Access comes only from an active membership of the session account in
@@ -3027,6 +3168,182 @@ func decodeListMyConsentsParams(args [0]string, argsEscaped bool, r *http.Reques
return params, nil
}
// ListMyEvidenceParams is parameters of ListMyEvidence operation.
type ListMyEvidenceParams struct {
// Maximum number of items in the page. The server may return fewer items even when more remain; use
// `page.has_more` to detect the end.
Limit OptInt32 `json:",omitempty,omitzero"`
// Opaque `page.next_cursor` value from the previous page of the same listing. Omit it to read the
// first page. A malformed or foreign cursor returns 400 with code validation_failed.
Cursor OptString `json:",omitempty,omitzero"`
}
func unpackListMyEvidenceParams(packed middleware.Parameters) (params ListMyEvidenceParams) {
{
key := middleware.ParameterKey{
Name: "limit",
In: "query",
}
if v, ok := packed[key]; ok {
params.Limit = v.(OptInt32)
}
}
{
key := middleware.ParameterKey{
Name: "cursor",
In: "query",
}
if v, ok := packed[key]; ok {
params.Cursor = v.(OptString)
}
}
return params
}
func decodeListMyEvidenceParams(args [0]string, argsEscaped bool, r *http.Request) (params ListMyEvidenceParams, _ error) {
q := uri.NewQueryDecoder(r.URL.Query())
// Set default value for query: limit.
{
val := int32(20)
params.Limit.SetTo(val)
}
// Decode query: limit.
if err := func() error {
cfg := uri.QueryParameterDecodingConfig{
Name: "limit",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.HasParam(cfg); err == nil {
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
var paramsDotLimitVal int32
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToInt32(val)
if err != nil {
return err
}
paramsDotLimitVal = c
return nil
}(); err != nil {
return err
}
params.Limit.SetTo(paramsDotLimitVal)
return nil
}); err != nil {
return err
}
if err := func() error {
if value, ok := params.Limit.Get(); ok {
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 1,
MaxSet: true,
Max: 100,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(value)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "limit",
In: "query",
Err: err,
}
}
// Decode query: cursor.
if err := func() error {
cfg := uri.QueryParameterDecodingConfig{
Name: "cursor",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.HasParam(cfg); err == nil {
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
var paramsDotCursorVal string
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToString(val)
if err != nil {
return err
}
paramsDotCursorVal = c
return nil
}(); err != nil {
return err
}
params.Cursor.SetTo(paramsDotCursorVal)
return nil
}); err != nil {
return err
}
if err := func() error {
if value, ok := params.Cursor.Get(); ok {
if err := func() error {
if err := (validate.String{
MinLength: 1,
MinLengthSet: true,
MaxLength: 512,
MaxLengthSet: true,
Email: false,
Hostname: false,
Regex: regexMap["^[A-Za-z0-9_-]+$"],
MinNumeric: 0,
MinNumericSet: false,
MaxNumeric: 0,
MaxNumericSet: false,
}).Validate(string(value)); err != nil {
return errors.Wrap(err, "string")
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "cursor",
In: "query",
Err: err,
}
}
return params, nil
}
// ListMyHiddenOrganizationsParams is parameters of ListMyHiddenOrganizations operation.
type ListMyHiddenOrganizationsParams struct {
// Maximum number of items in the page. The server may return fewer items even when more remain; use
@@ -2472,6 +2472,121 @@ func encodeGetOrganizationCandidateCardResponse(response GetOrganizationCandidat
}
}
func encodeGetOrganizationCandidateEvidenceResponse(response GetOrganizationCandidateEvidenceRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *OrganizationEvidenceHeaders:
w.Header().Set("Content-Type", "application/json; charset=utf-8")
// Encoding response headers.
{
h := uri.NewHeaderEncoder(w.Header())
// Encode "Cache-Control" header.
{
cfg := uri.HeaderParameterEncodingConfig{
Name: "Cache-Control",
Explode: false,
}
if err := h.EncodeParam(cfg, func(e uri.Encoder) error {
return e.EncodeValue(conv.StringToString(string(response.CacheControl)))
}); err != nil {
return errors.Wrap(err, "encode Cache-Control header")
}
}
}
w.WriteHeader(200)
e := new(jx.Encoder)
response.Response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *GetOrganizationCandidateEvidenceBadRequest:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(400)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *GetOrganizationCandidateEvidenceUnauthorized:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(401)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *GetOrganizationCandidateEvidenceForbidden:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(403)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *GetOrganizationCandidateEvidenceNotFound:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(404)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *TooManyRequestsHeaders:
w.Header().Set("Content-Type", "application/problem+json")
w.Header().Set("Access-Control-Expose-Headers", "Retry-After")
// Encoding response headers.
{
h := uri.NewHeaderEncoder(w.Header())
// Encode "Retry-After" header.
{
cfg := uri.HeaderParameterEncodingConfig{
Name: "Retry-After",
Explode: false,
}
if err := h.EncodeParam(cfg, func(e uri.Encoder) error {
if val, ok := response.RetryAfter.Get(); ok {
return e.EncodeValue(conv.Int32ToString(val))
}
return nil
}); err != nil {
return errors.Wrap(err, "encode Retry-After header")
}
}
}
w.WriteHeader(429)
e := new(jx.Encoder)
response.Response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
default:
return errors.Errorf("unexpected response type: %T", response)
}
}
func encodeGetOrganizationInvitationResponse(response GetOrganizationInvitationRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *OrganizationInvitationHeaders:
@@ -3133,6 +3248,77 @@ func encodeListMyConsentsResponse(response ListMyConsentsRes, w http.ResponseWri
}
}
func encodeListMyEvidenceResponse(response ListMyEvidenceRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *EvidenceFactListHeaders:
w.Header().Set("Content-Type", "application/json; charset=utf-8")
// Encoding response headers.
{
h := uri.NewHeaderEncoder(w.Header())
// Encode "Cache-Control" header.
{
cfg := uri.HeaderParameterEncodingConfig{
Name: "Cache-Control",
Explode: false,
}
if err := h.EncodeParam(cfg, func(e uri.Encoder) error {
return e.EncodeValue(conv.StringToString(string(response.CacheControl)))
}); err != nil {
return errors.Wrap(err, "encode Cache-Control header")
}
}
}
w.WriteHeader(200)
e := new(jx.Encoder)
response.Response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *ListMyEvidenceBadRequest:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(400)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *ListMyEvidenceUnauthorized:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(401)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *ListMyEvidenceForbidden:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(403)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
default:
return errors.Errorf("unexpected response type: %T", response)
}
}
func encodeListMyHiddenOrganizationsResponse(response ListMyHiddenOrganizationsRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *HiddenOrganizationListHeaders:
@@ -11,46 +11,46 @@ import (
)
var (
rn72AllowedHeaders = map[string]string{
rn74AllowedHeaders = map[string]string{
"POST": "Content-Type",
}
rn9AllowedHeaders = map[string]string{
"POST": "Content-Type,Origin",
}
rn68AllowedHeaders = map[string]string{
rn70AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key",
}
rn64AllowedHeaders = map[string]string{
rn66AllowedHeaders = map[string]string{
"POST": "Content-Type",
}
rn27AllowedHeaders = map[string]string{
"DELETE": "X-Csrf-Token",
}
rn70AllowedHeaders = map[string]string{
rn72AllowedHeaders = map[string]string{
"POST": "X-Csrf-Token",
}
rn11AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn83AllowedHeaders = map[string]string{
rn85AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn22AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn82AllowedHeaders = map[string]string{
rn84AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn67AllowedHeaders = map[string]string{
rn69AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn5AllowedHeaders = map[string]string{
"PUT": "Content-Type,X-Csrf-Token",
}
rn74AllowedHeaders = map[string]string{
rn76AllowedHeaders = map[string]string{
"DELETE": "X-Csrf-Token",
}
rn52AllowedHeaders = map[string]string{
rn53AllowedHeaders = map[string]string{
"DELETE": "X-Csrf-Token",
"PUT": "Content-Type,X-Csrf-Token",
}
@@ -63,17 +63,17 @@ var (
rn19AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn84AllowedHeaders = map[string]string{
rn86AllowedHeaders = map[string]string{
"POST": "X-Csrf-Token",
}
rn55AllowedHeaders = map[string]string{
rn56AllowedHeaders = map[string]string{
"DELETE": "X-Csrf-Token",
"PUT": "X-Csrf-Token",
}
rn79AllowedHeaders = map[string]string{
rn81AllowedHeaders = map[string]string{
"PUT": "Content-Type,X-Csrf-Token",
}
rn80AllowedHeaders = map[string]string{
rn82AllowedHeaders = map[string]string{
"PUT": "Content-Type,X-Csrf-Token",
}
rn38AllowedHeaders = map[string]string{
@@ -94,25 +94,25 @@ var (
rn16AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn45AllowedHeaders = map[string]string{
rn46AllowedHeaders = map[string]string{
"PATCH": "Content-Type,X-Csrf-Token",
}
rn66AllowedHeaders = map[string]string{
rn68AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn79AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn87AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn77AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn85AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn75AllowedHeaders = map[string]string{
"POST": "Content-Type,X-Csrf-Token",
}
rn18AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn48AllowedHeaders = map[string]string{
rn49AllowedHeaders = map[string]string{
"PATCH": "Content-Type,X-Csrf-Token",
}
)
@@ -269,7 +269,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn72AllowedHeaders,
allowedHeaders: rn74AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -346,7 +346,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn68AllowedHeaders,
allowedHeaders: rn70AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -370,7 +370,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn64AllowedHeaders,
allowedHeaders: rn66AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -450,7 +450,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn70AllowedHeaders,
allowedHeaders: rn72AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -572,7 +572,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn83AllowedHeaders,
allowedHeaders: rn85AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -665,7 +665,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn82AllowedHeaders,
allowedHeaders: rn84AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -692,7 +692,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn67AllowedHeaders,
allowedHeaders: rn69AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -903,7 +903,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "DELETE",
allowedHeaders: rn74AllowedHeaders,
allowedHeaders: rn76AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -937,7 +937,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "DELETE,PUT",
allowedHeaders: rn52AllowedHeaders,
allowedHeaders: rn53AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -950,6 +950,31 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
case 'e': // Prefix: "evidence"
if l := len("evidence"); len(elem) >= l && elem[0:l] == "evidence" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch r.Method {
case "GET":
s.handleListMyEvidenceRequest([0]string{}, elemIsEscaped, w, r)
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "GET",
allowedHeaders: nil,
acceptPost: "",
acceptPatch: "",
})
}
return
}
case 'i': // Prefix: "invitations"
if l := len("invitations"); len(elem) >= l && elem[0:l] == "invitations" {
@@ -1120,7 +1145,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn84AllowedHeaders,
allowedHeaders: rn86AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1300,7 +1325,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "DELETE,PUT",
allowedHeaders: rn55AllowedHeaders,
allowedHeaders: rn56AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1391,7 +1416,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "PUT",
allowedHeaders: rn79AllowedHeaders,
allowedHeaders: rn81AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1418,7 +1443,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "PUT",
allowedHeaders: rn80AllowedHeaders,
allowedHeaders: rn82AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1637,16 +1662,15 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
// Param: "candidate_handle"
// Leaf parameter, slashes are prohibited
// Match until "/"
idx := strings.IndexByte(elem, '/')
if idx >= 0 {
break
if idx < 0 {
idx = len(elem)
}
args[1] = elem
elem = ""
args[1] = elem[:idx]
elem = elem[idx:]
if len(elem) == 0 {
// Leaf node.
switch r.Method {
case "GET":
s.handleGetOrganizationCandidateCardRequest([2]string{
@@ -1664,6 +1688,36 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
switch elem[0] {
case '/': // Prefix: "/evidence"
if l := len("/evidence"); len(elem) >= l && elem[0:l] == "/evidence" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch r.Method {
case "GET":
s.handleGetOrganizationCandidateEvidenceRequest([2]string{
args[0],
args[1],
}, elemIsEscaped, w, r)
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "GET",
allowedHeaders: nil,
acceptPost: "",
acceptPatch: "",
})
}
return
}
}
case 'i': // Prefix: "invitations"
@@ -1727,7 +1781,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "GET,PATCH",
allowedHeaders: rn45AllowedHeaders,
allowedHeaders: rn46AllowedHeaders,
acceptPost: "",
acceptPatch: "application/json",
})
@@ -1807,7 +1861,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn66AllowedHeaders,
allowedHeaders: rn68AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1835,7 +1889,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn77AllowedHeaders,
allowedHeaders: rn79AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1865,7 +1919,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn85AllowedHeaders,
allowedHeaders: rn87AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1898,7 +1952,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn75AllowedHeaders,
allowedHeaders: rn77AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1970,7 +2024,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "GET,PATCH",
allowedHeaders: rn48AllowedHeaders,
allowedHeaders: rn49AllowedHeaders,
acceptPost: "",
acceptPatch: "application/json",
})
@@ -2893,6 +2947,31 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
}
case 'e': // Prefix: "evidence"
if l := len("evidence"); len(elem) >= l && elem[0:l] == "evidence" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch method {
case "GET":
r.name = ListMyEvidenceOperation
r.summary = "List the skill evidence of the current candidate."
r.operationID = "ListMyEvidence"
r.operationGroup = ""
r.pathPattern = "/api/v1/me/evidence"
r.args = args
r.count = 0
return r, true
default:
return
}
}
case 'i': // Prefix: "invitations"
if l := len("invitations"); len(elem) >= l && elem[0:l] == "invitations" {
@@ -3595,16 +3674,15 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
}
// Param: "candidate_handle"
// Leaf parameter, slashes are prohibited
// Match until "/"
idx := strings.IndexByte(elem, '/')
if idx >= 0 {
break
if idx < 0 {
idx = len(elem)
}
args[1] = elem
elem = ""
args[1] = elem[:idx]
elem = elem[idx:]
if len(elem) == 0 {
// Leaf node.
switch method {
case "GET":
r.name = GetOrganizationCandidateCardOperation
@@ -3619,6 +3697,33 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
return
}
}
switch elem[0] {
case '/': // Prefix: "/evidence"
if l := len("/evidence"); len(elem) >= l && elem[0:l] == "/evidence" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch method {
case "GET":
r.name = GetOrganizationCandidateEvidenceOperation
r.summary = "Read the permitted skill evidence of one currently visible candidate card."
r.operationID = "GetOrganizationCandidateEvidence"
r.operationGroup = ""
r.pathPattern = "/api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence"
r.args = args
r.count = 2
return r, true
default:
return
}
}
}
case 'i': // Prefix: "invitations"
@@ -7117,7 +7117,11 @@ func (s *CardCategoryStrength) UnmarshalText(data []byte) error {
// leave only through the contact grant of an accepted invitation (C4), and the lowest salary never
// leaves.
//
// - categories: specialization and grade confirmed by an authoritative assessment result.
// - categories: specialization and grade confirmed by an authoritative assessment result. With it an
// organization receives the confirmed category and, with each category of the card, one supporting
// assessment fact: its skill, the passed grade, the trust level, the year of the assessment, and
// the basis and calibration that mark a synthetic, uncalibrated demonstration
// (`GetOrganizationCandidateEvidence`). The candidate sees the same on `GetMyCardPreview`.
// - self_assessment: the candidate's declared specialization and grade, separate from confirmed
// categories.
// - stack: only recognized technology codes from the server's closed taxonomy.
@@ -7231,12 +7235,15 @@ type CardFieldSet []CardField
// pseudonym uses a separate preview context and is not an organization's alias. Organization-specific
// visibility filters and cohort checks can further generalize or suppress the organization-facing
// card. This read creates no view or history record and never reaches an organization. `card` is null
// while the profile is closed.
// while the profile is closed. `evidence` is what an organization would read in the evidence section
// of the card, one supporting assessment fact for each category of the card, and is null exactly when
// `card` is null; the organization-facing section can still be generalized or suppressed.
// Ref: #/components/schemas/CardPreview
type CardPreview struct {
State PublicationState `json:"state"`
Fields CardFieldSet `json:"fields"`
Card NilAnonymousCardContent `json:"card"`
Evidence NilOrganizationEvidence `json:"evidence"`
GeneratedAt Timestamp `json:"generated_at"`
}
@@ -7255,6 +7262,11 @@ func (s *CardPreview) GetCard() NilAnonymousCardContent {
return s.Card
}
// GetEvidence returns the value of Evidence.
func (s *CardPreview) GetEvidence() NilOrganizationEvidence {
return s.Evidence
}
// GetGeneratedAt returns the value of GeneratedAt.
func (s *CardPreview) GetGeneratedAt() Timestamp {
return s.GeneratedAt
@@ -7275,6 +7287,11 @@ func (s *CardPreview) SetCard(val NilAnonymousCardContent) {
s.Card = val
}
// SetEvidence sets the value of Evidence.
func (s *CardPreview) SetEvidence(val NilOrganizationEvidence) {
s.Evidence = val
}
// SetGeneratedAt sets the value of GeneratedAt.
func (s *CardPreview) SetGeneratedAt(val Timestamp) {
s.GeneratedAt = val
@@ -9672,6 +9689,651 @@ func (EmailVerificationResultEmailVerified) AllValues() []EmailVerificationResul
}
}
// Whose contribution the fact is.
//
// - personal: the candidate's own result. Every assessment fact is personal.
// - team_role: a team result with a confirmed role of the candidate.
// - team_unattributed: a team result without a confirmed role; it is not a personal skill.
//
// Only `personal` is produced today.
// Ref: #/components/schemas/EvidenceAttribution
type EvidenceAttribution string
const (
EvidenceAttributionPersonal EvidenceAttribution = "personal"
EvidenceAttributionTeamRole EvidenceAttribution = "team_role"
EvidenceAttributionTeamUnattributed EvidenceAttribution = "team_unattributed"
)
// AllValues returns all EvidenceAttribution values.
func (EvidenceAttribution) AllValues() []EvidenceAttribution {
return []EvidenceAttribution{
EvidenceAttributionPersonal,
EvidenceAttributionTeamRole,
EvidenceAttributionTeamUnattributed,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceAttribution) MarshalText() ([]byte, error) {
switch s {
case EvidenceAttributionPersonal:
return []byte(s), nil
case EvidenceAttributionTeamRole:
return []byte(s), nil
case EvidenceAttributionTeamUnattributed:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceAttribution) UnmarshalText(data []byte) error {
switch EvidenceAttribution(data) {
case EvidenceAttributionPersonal:
*s = EvidenceAttributionPersonal
return nil
case EvidenceAttributionTeamRole:
*s = EvidenceAttributionTeamRole
return nil
case EvidenceAttributionTeamUnattributed:
*s = EvidenceAttributionTeamUnattributed
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// What the measurement rests on.
//
// - synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics
// and is not a validated measurement.
//
// Ref: #/components/schemas/EvidenceBasis
type EvidenceBasis string
const (
EvidenceBasisSyntheticDemo EvidenceBasis = "synthetic_demo"
)
// AllValues returns all EvidenceBasis values.
func (EvidenceBasis) AllValues() []EvidenceBasis {
return []EvidenceBasis{
EvidenceBasisSyntheticDemo,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceBasis) MarshalText() ([]byte, error) {
switch s {
case EvidenceBasisSyntheticDemo:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceBasis) UnmarshalText(data []byte) error {
switch EvidenceBasis(data) {
case EvidenceBasisSyntheticDemo:
*s = EvidenceBasisSyntheticDemo
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// Calibration of the method behind the result.
//
// - uncalibrated: the thresholds are initial values that no measurement has validated.
//
// Ref: #/components/schemas/EvidenceCalibrationStatus
type EvidenceCalibrationStatus string
const (
EvidenceCalibrationStatusUncalibrated EvidenceCalibrationStatus = "uncalibrated"
)
// AllValues returns all EvidenceCalibrationStatus values.
func (EvidenceCalibrationStatus) AllValues() []EvidenceCalibrationStatus {
return []EvidenceCalibrationStatus{
EvidenceCalibrationStatusUncalibrated,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceCalibrationStatus) MarshalText() ([]byte, error) {
switch s {
case EvidenceCalibrationStatusUncalibrated:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceCalibrationStatus) UnmarshalText(data []byte) error {
switch EvidenceCalibrationStatus(data) {
case EvidenceCalibrationStatusUncalibrated:
*s = EvidenceCalibrationStatusUncalibrated
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// One independent fact of the current candidate. `occurred_at` is when the source event ended; for an
// assessment it is the time of the decision. A fact is one source event; the skills of that event are
// tags of the fact, so a second tag never makes a second fact. Hidden facts are listed here with their
// visibility, because the candidate owns them.
// Ref: #/components/schemas/EvidenceFact
type EvidenceFact struct {
// Identifier of the fact.
ID uuid.UUID `json:"id"`
Kind EvidenceKind `json:"kind"`
Source EvidenceSource `json:"source"`
// Skill tags of the event in ascending order.
Skills []EvidenceSkillCode `json:"skills"`
Result EvidenceResult `json:"result"`
Attribution EvidenceAttribution `json:"attribution"`
Trust EvidenceTrustLevel `json:"trust"`
OccurredAt Timestamp `json:"occurred_at"`
Visibility EvidenceVisibility `json:"visibility"`
}
// GetID returns the value of ID.
func (s *EvidenceFact) GetID() uuid.UUID {
return s.ID
}
// GetKind returns the value of Kind.
func (s *EvidenceFact) GetKind() EvidenceKind {
return s.Kind
}
// GetSource returns the value of Source.
func (s *EvidenceFact) GetSource() EvidenceSource {
return s.Source
}
// GetSkills returns the value of Skills.
func (s *EvidenceFact) GetSkills() []EvidenceSkillCode {
return s.Skills
}
// GetResult returns the value of Result.
func (s *EvidenceFact) GetResult() EvidenceResult {
return s.Result
}
// GetAttribution returns the value of Attribution.
func (s *EvidenceFact) GetAttribution() EvidenceAttribution {
return s.Attribution
}
// GetTrust returns the value of Trust.
func (s *EvidenceFact) GetTrust() EvidenceTrustLevel {
return s.Trust
}
// GetOccurredAt returns the value of OccurredAt.
func (s *EvidenceFact) GetOccurredAt() Timestamp {
return s.OccurredAt
}
// GetVisibility returns the value of Visibility.
func (s *EvidenceFact) GetVisibility() EvidenceVisibility {
return s.Visibility
}
// SetID sets the value of ID.
func (s *EvidenceFact) SetID(val uuid.UUID) {
s.ID = val
}
// SetKind sets the value of Kind.
func (s *EvidenceFact) SetKind(val EvidenceKind) {
s.Kind = val
}
// SetSource sets the value of Source.
func (s *EvidenceFact) SetSource(val EvidenceSource) {
s.Source = val
}
// SetSkills sets the value of Skills.
func (s *EvidenceFact) SetSkills(val []EvidenceSkillCode) {
s.Skills = val
}
// SetResult sets the value of Result.
func (s *EvidenceFact) SetResult(val EvidenceResult) {
s.Result = val
}
// SetAttribution sets the value of Attribution.
func (s *EvidenceFact) SetAttribution(val EvidenceAttribution) {
s.Attribution = val
}
// SetTrust sets the value of Trust.
func (s *EvidenceFact) SetTrust(val EvidenceTrustLevel) {
s.Trust = val
}
// SetOccurredAt sets the value of OccurredAt.
func (s *EvidenceFact) SetOccurredAt(val Timestamp) {
s.OccurredAt = val
}
// SetVisibility sets the value of Visibility.
func (s *EvidenceFact) SetVisibility(val EvidenceVisibility) {
s.Visibility = val
}
// One page of the facts of the current candidate, newest event first.
// Ref: #/components/schemas/EvidenceFactList
type EvidenceFactList struct {
// Facts of the page.
Items []EvidenceFact `json:"items"`
Page PageInfo `json:"page"`
}
// GetItems returns the value of Items.
func (s *EvidenceFactList) GetItems() []EvidenceFact {
return s.Items
}
// GetPage returns the value of Page.
func (s *EvidenceFactList) GetPage() PageInfo {
return s.Page
}
// SetItems sets the value of Items.
func (s *EvidenceFactList) SetItems(val []EvidenceFact) {
s.Items = val
}
// SetPage sets the value of Page.
func (s *EvidenceFactList) SetPage(val PageInfo) {
s.Page = val
}
// EvidenceFactListHeaders wraps EvidenceFactList with response headers.
type EvidenceFactListHeaders struct {
CacheControl CacheControlNoStore
Response EvidenceFactList
}
// GetCacheControl returns the value of CacheControl.
func (s *EvidenceFactListHeaders) GetCacheControl() CacheControlNoStore {
return s.CacheControl
}
// GetResponse returns the value of Response.
func (s *EvidenceFactListHeaders) GetResponse() EvidenceFactList {
return s.Response
}
// SetCacheControl sets the value of CacheControl.
func (s *EvidenceFactListHeaders) SetCacheControl(val CacheControlNoStore) {
s.CacheControl = val
}
// SetResponse sets the value of Response.
func (s *EvidenceFactListHeaders) SetResponse(val EvidenceFactList) {
s.Response = val
}
func (*EvidenceFactListHeaders) listMyEvidenceRes() {}
// Whether a fact is a statement or an observation.
//
// - claim: something the candidate stated that nothing confirmed separately. Its trust is 0.
// - measurement: a result that a system observed, such as a confirmed assessment. Its trust is 1 to
// 3.
//
// Assessments produce measurements only. A claim never becomes a measurement by repetition, and the
// two kinds are stored apart.
// Ref: #/components/schemas/EvidenceKind
type EvidenceKind string
const (
EvidenceKindClaim EvidenceKind = "claim"
EvidenceKindMeasurement EvidenceKind = "measurement"
)
// AllValues returns all EvidenceKind values.
func (EvidenceKind) AllValues() []EvidenceKind {
return []EvidenceKind{
EvidenceKindClaim,
EvidenceKindMeasurement,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceKind) MarshalText() ([]byte, error) {
switch s {
case EvidenceKindClaim:
return []byte(s), nil
case EvidenceKindMeasurement:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceKind) UnmarshalText(data []byte) error {
switch EvidenceKind(data) {
case EvidenceKindClaim:
*s = EvidenceKindClaim
return nil
case EvidenceKindMeasurement:
*s = EvidenceKindMeasurement
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// What the fact says: the grade that was passed and how reliable the method is. It carries no score,
// answer, item, failure, or anti-cheat data.
// Ref: #/components/schemas/EvidenceResult
type EvidenceResult struct {
Grade GradeCode `json:"grade"`
Basis EvidenceBasis `json:"basis"`
CalibrationStatus EvidenceCalibrationStatus `json:"calibration_status"`
}
// GetGrade returns the value of Grade.
func (s *EvidenceResult) GetGrade() GradeCode {
return s.Grade
}
// GetBasis returns the value of Basis.
func (s *EvidenceResult) GetBasis() EvidenceBasis {
return s.Basis
}
// GetCalibrationStatus returns the value of CalibrationStatus.
func (s *EvidenceResult) GetCalibrationStatus() EvidenceCalibrationStatus {
return s.CalibrationStatus
}
// SetGrade sets the value of Grade.
func (s *EvidenceResult) SetGrade(val GradeCode) {
s.Grade = val
}
// SetBasis sets the value of Basis.
func (s *EvidenceResult) SetBasis(val EvidenceBasis) {
s.Basis = val
}
// SetCalibrationStatus sets the value of CalibrationStatus.
func (s *EvidenceResult) SetCalibrationStatus(val EvidenceCalibrationStatus) {
s.CalibrationStatus = val
}
// A skill tag from a closed set - the specialization codes of the catalog and the technology codes of
// the anonymous card. An assessment tags its fact with the specialization of the category.
// Ref: #/components/schemas/EvidenceSkillCode
type EvidenceSkillCode string
const (
EvidenceSkillCodeBackend EvidenceSkillCode = "backend"
EvidenceSkillCodeFrontend EvidenceSkillCode = "frontend"
EvidenceSkillCodeMobile EvidenceSkillCode = "mobile"
EvidenceSkillCodeNetworkEngineer EvidenceSkillCode = "network_engineer"
EvidenceSkillCodeDevopsSre EvidenceSkillCode = "devops_sre"
EvidenceSkillCodeDataAnalyst EvidenceSkillCode = "data_analyst"
EvidenceSkillCodeDsMl EvidenceSkillCode = "ds_ml"
EvidenceSkillCodeInformationSecurity EvidenceSkillCode = "information_security"
EvidenceSkillCodeQa EvidenceSkillCode = "qa"
EvidenceSkillCodeGo EvidenceSkillCode = "go"
EvidenceSkillCodePostgresql EvidenceSkillCode = "postgresql"
EvidenceSkillCodeKafka EvidenceSkillCode = "kafka"
EvidenceSkillCodeDocker EvidenceSkillCode = "docker"
)
// AllValues returns all EvidenceSkillCode values.
func (EvidenceSkillCode) AllValues() []EvidenceSkillCode {
return []EvidenceSkillCode{
EvidenceSkillCodeBackend,
EvidenceSkillCodeFrontend,
EvidenceSkillCodeMobile,
EvidenceSkillCodeNetworkEngineer,
EvidenceSkillCodeDevopsSre,
EvidenceSkillCodeDataAnalyst,
EvidenceSkillCodeDsMl,
EvidenceSkillCodeInformationSecurity,
EvidenceSkillCodeQa,
EvidenceSkillCodeGo,
EvidenceSkillCodePostgresql,
EvidenceSkillCodeKafka,
EvidenceSkillCodeDocker,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceSkillCode) MarshalText() ([]byte, error) {
switch s {
case EvidenceSkillCodeBackend:
return []byte(s), nil
case EvidenceSkillCodeFrontend:
return []byte(s), nil
case EvidenceSkillCodeMobile:
return []byte(s), nil
case EvidenceSkillCodeNetworkEngineer:
return []byte(s), nil
case EvidenceSkillCodeDevopsSre:
return []byte(s), nil
case EvidenceSkillCodeDataAnalyst:
return []byte(s), nil
case EvidenceSkillCodeDsMl:
return []byte(s), nil
case EvidenceSkillCodeInformationSecurity:
return []byte(s), nil
case EvidenceSkillCodeQa:
return []byte(s), nil
case EvidenceSkillCodeGo:
return []byte(s), nil
case EvidenceSkillCodePostgresql:
return []byte(s), nil
case EvidenceSkillCodeKafka:
return []byte(s), nil
case EvidenceSkillCodeDocker:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceSkillCode) UnmarshalText(data []byte) error {
switch EvidenceSkillCode(data) {
case EvidenceSkillCodeBackend:
*s = EvidenceSkillCodeBackend
return nil
case EvidenceSkillCodeFrontend:
*s = EvidenceSkillCodeFrontend
return nil
case EvidenceSkillCodeMobile:
*s = EvidenceSkillCodeMobile
return nil
case EvidenceSkillCodeNetworkEngineer:
*s = EvidenceSkillCodeNetworkEngineer
return nil
case EvidenceSkillCodeDevopsSre:
*s = EvidenceSkillCodeDevopsSre
return nil
case EvidenceSkillCodeDataAnalyst:
*s = EvidenceSkillCodeDataAnalyst
return nil
case EvidenceSkillCodeDsMl:
*s = EvidenceSkillCodeDsMl
return nil
case EvidenceSkillCodeInformationSecurity:
*s = EvidenceSkillCodeInformationSecurity
return nil
case EvidenceSkillCodeQa:
*s = EvidenceSkillCodeQa
return nil
case EvidenceSkillCodeGo:
*s = EvidenceSkillCodeGo
return nil
case EvidenceSkillCodePostgresql:
*s = EvidenceSkillCodePostgresql
return nil
case EvidenceSkillCodeKafka:
*s = EvidenceSkillCodeKafka
return nil
case EvidenceSkillCodeDocker:
*s = EvidenceSkillCodeDocker
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// Where the fact comes from. For an assessment the event is the attempt and the result is the
// immutable result of that attempt, which the candidate reads at `GetMyAssessmentResult`; the two
// identifiers are equal because a result is keyed by its attempt.
// Ref: #/components/schemas/EvidenceSource
type EvidenceSource struct {
Type EvidenceSourceType `json:"type"`
// Identifier of the source event. One event is one fact, however many skills it is tagged with.
EventID uuid.UUID `json:"event_id"`
// Identifier of the immutable result that produced the fact.
ResultID uuid.UUID `json:"result_id"`
}
// GetType returns the value of Type.
func (s *EvidenceSource) GetType() EvidenceSourceType {
return s.Type
}
// GetEventID returns the value of EventID.
func (s *EvidenceSource) GetEventID() uuid.UUID {
return s.EventID
}
// GetResultID returns the value of ResultID.
func (s *EvidenceSource) GetResultID() uuid.UUID {
return s.ResultID
}
// SetType sets the value of Type.
func (s *EvidenceSource) SetType(val EvidenceSourceType) {
s.Type = val
}
// SetEventID sets the value of EventID.
func (s *EvidenceSource) SetEventID(val uuid.UUID) {
s.EventID = val
}
// SetResultID sets the value of ResultID.
func (s *EvidenceSource) SetResultID(val uuid.UUID) {
s.ResultID = val
}
// Where the fact comes from.
//
// - assessment_result: a real (root or corrective) assessment result of this platform that confirmed
// a grade. An express training run (`demo_express`), a failed attempt, and a result without a
// reviewed category source are never a source.
//
// Adding a value is a contract change.
// Ref: #/components/schemas/EvidenceSourceType
type EvidenceSourceType string
const (
EvidenceSourceTypeAssessmentResult EvidenceSourceType = "assessment_result"
)
// AllValues returns all EvidenceSourceType values.
func (EvidenceSourceType) AllValues() []EvidenceSourceType {
return []EvidenceSourceType{
EvidenceSourceTypeAssessmentResult,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceSourceType) MarshalText() ([]byte, error) {
switch s {
case EvidenceSourceTypeAssessmentResult:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceSourceType) UnmarshalText(data []byte) error {
switch EvidenceSourceType(data) {
case EvidenceSourceTypeAssessmentResult:
*s = EvidenceSourceTypeAssessmentResult
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
type EvidenceTrustLevel int32
// Whether the fact may take part in what an organization reads.
//
// - visible: the fact is eligible for the organization projection. It does not publish the fact: the
// projection also needs the published card with the `categories` field and an active C2.
// - hidden: the candidate hid the fact. No organization reads it. Hiding never edits or deletes the
// confirmed result.
//
// Ref: #/components/schemas/EvidenceVisibility
type EvidenceVisibility string
const (
EvidenceVisibilityVisible EvidenceVisibility = "visible"
EvidenceVisibilityHidden EvidenceVisibility = "hidden"
)
// AllValues returns all EvidenceVisibility values.
func (EvidenceVisibility) AllValues() []EvidenceVisibility {
return []EvidenceVisibility{
EvidenceVisibilityVisible,
EvidenceVisibilityHidden,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s EvidenceVisibility) MarshalText() ([]byte, error) {
switch s {
case EvidenceVisibilityVisible:
return []byte(s), nil
case EvidenceVisibilityHidden:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *EvidenceVisibility) UnmarshalText(data []byte) error {
switch EvidenceVisibility(data) {
case EvidenceVisibilityVisible:
*s = EvidenceVisibilityVisible
return nil
case EvidenceVisibilityHidden:
*s = EvidenceVisibilityHidden
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
type FinalizeMyAssessmentAttemptBadRequest Problem
func (*FinalizeMyAssessmentAttemptBadRequest) finalizeMyAssessmentAttemptRes() {}
@@ -10006,6 +10668,22 @@ type GetOrganizationCandidateCardUnauthorized Problem
func (*GetOrganizationCandidateCardUnauthorized) getOrganizationCandidateCardRes() {}
type GetOrganizationCandidateEvidenceBadRequest Problem
func (*GetOrganizationCandidateEvidenceBadRequest) getOrganizationCandidateEvidenceRes() {}
type GetOrganizationCandidateEvidenceForbidden Problem
func (*GetOrganizationCandidateEvidenceForbidden) getOrganizationCandidateEvidenceRes() {}
type GetOrganizationCandidateEvidenceNotFound Problem
func (*GetOrganizationCandidateEvidenceNotFound) getOrganizationCandidateEvidenceRes() {}
type GetOrganizationCandidateEvidenceUnauthorized Problem
func (*GetOrganizationCandidateEvidenceUnauthorized) getOrganizationCandidateEvidenceRes() {}
type GetOrganizationForbidden Problem
func (*GetOrganizationForbidden) getOrganizationRes() {}
@@ -11911,6 +12589,18 @@ type ListMyConsentsUnauthorized Problem
func (*ListMyConsentsUnauthorized) listMyConsentsRes() {}
type ListMyEvidenceBadRequest Problem
func (*ListMyEvidenceBadRequest) listMyEvidenceRes() {}
type ListMyEvidenceForbidden Problem
func (*ListMyEvidenceForbidden) listMyEvidenceRes() {}
type ListMyEvidenceUnauthorized Problem
func (*ListMyEvidenceUnauthorized) listMyEvidenceRes() {}
type ListMyHiddenOrganizationsBadRequest Problem
func (*ListMyHiddenOrganizationsBadRequest) listMyHiddenOrganizationsRes() {}
@@ -18185,6 +18875,51 @@ func (o NilOrganizationDescription) Or(d OrganizationDescription) OrganizationDe
return d
}
// NewNilOrganizationEvidence returns new NilOrganizationEvidence with value set to v.
func NewNilOrganizationEvidence(v OrganizationEvidence) NilOrganizationEvidence {
return NilOrganizationEvidence{
Value: v,
}
}
// NilOrganizationEvidence is nullable OrganizationEvidence.
type NilOrganizationEvidence struct {
Value OrganizationEvidence
Null bool
}
// SetTo sets value to v.
func (o *NilOrganizationEvidence) SetTo(v OrganizationEvidence) {
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o NilOrganizationEvidence) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *NilOrganizationEvidence) SetToNull() {
o.Null = true
var v OrganizationEvidence
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o NilOrganizationEvidence) Get() (v OrganizationEvidence, 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 NilOrganizationEvidence) Or(d OrganizationEvidence) OrganizationEvidence {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewNilOrganizationSphere returns new NilOrganizationSphere with value set to v.
func NewNilOrganizationSphere(v OrganizationSphere) NilOrganizationSphere {
return NilOrganizationSphere{
@@ -22180,6 +22915,133 @@ func (s *OrganizationCreate) SetRepresentatives(val []OrganizationRepresentative
type OrganizationDescription string
// The permitted evidence of one candidate card, ordered by skill: at most one fact for each category
// of the card (at most nine). The list is empty when no visible fact supports a category of the card.
// Ref: #/components/schemas/OrganizationEvidence
type OrganizationEvidence struct {
// Permitted facts, one for each supported category.
Items []OrganizationEvidenceFact `json:"items"`
}
// GetItems returns the value of Items.
func (s *OrganizationEvidence) GetItems() []OrganizationEvidenceFact {
return s.Items
}
// SetItems sets the value of Items.
func (s *OrganizationEvidence) SetItems(val []OrganizationEvidenceFact) {
s.Items = val
}
// The one assessment fact that supports a category of the card as an organization reads it: the
// earliest visible measurement that passed exactly the confirmed grade of that category. A lower
// grade, a retake, the other tags of the event, the source, the basis, the exact time, and every
// identifier stay with the candidate. The fact carries no identifier of the fact, the event, the
// result, or the candidate, so it cannot be joined to a person by a key. It is not unlinkable: the
// skill, the grade, the trust level, and the year, together with the other values of the card, can
// narrow a small pool of candidates, and the minimum cohort of the card does not cover the year.
// `basis` and `calibration_status` are the same for every candidate: they say that the fact comes from
// a synthetic demonstration and is not calibrated, so a demonstration is never read as a validated
// measurement. The fact never carries an answer, score, item, failure, signal, or review band.
// Ref: #/components/schemas/OrganizationEvidenceFact
type OrganizationEvidenceFact struct {
Skill EvidenceSkillCode `json:"skill"`
Grade GradeCode `json:"grade"`
Trust EvidenceTrustLevel `json:"trust"`
Basis EvidenceBasis `json:"basis"`
CalibrationStatus EvidenceCalibrationStatus `json:"calibration_status"`
// Year (UTC) when the assessment ended. The month, day, and time stay with the candidate.
ObservedYear int32 `json:"observed_year"`
}
// GetSkill returns the value of Skill.
func (s *OrganizationEvidenceFact) GetSkill() EvidenceSkillCode {
return s.Skill
}
// GetGrade returns the value of Grade.
func (s *OrganizationEvidenceFact) GetGrade() GradeCode {
return s.Grade
}
// GetTrust returns the value of Trust.
func (s *OrganizationEvidenceFact) GetTrust() EvidenceTrustLevel {
return s.Trust
}
// GetBasis returns the value of Basis.
func (s *OrganizationEvidenceFact) GetBasis() EvidenceBasis {
return s.Basis
}
// GetCalibrationStatus returns the value of CalibrationStatus.
func (s *OrganizationEvidenceFact) GetCalibrationStatus() EvidenceCalibrationStatus {
return s.CalibrationStatus
}
// GetObservedYear returns the value of ObservedYear.
func (s *OrganizationEvidenceFact) GetObservedYear() int32 {
return s.ObservedYear
}
// SetSkill sets the value of Skill.
func (s *OrganizationEvidenceFact) SetSkill(val EvidenceSkillCode) {
s.Skill = val
}
// SetGrade sets the value of Grade.
func (s *OrganizationEvidenceFact) SetGrade(val GradeCode) {
s.Grade = val
}
// SetTrust sets the value of Trust.
func (s *OrganizationEvidenceFact) SetTrust(val EvidenceTrustLevel) {
s.Trust = val
}
// SetBasis sets the value of Basis.
func (s *OrganizationEvidenceFact) SetBasis(val EvidenceBasis) {
s.Basis = val
}
// SetCalibrationStatus sets the value of CalibrationStatus.
func (s *OrganizationEvidenceFact) SetCalibrationStatus(val EvidenceCalibrationStatus) {
s.CalibrationStatus = val
}
// SetObservedYear sets the value of ObservedYear.
func (s *OrganizationEvidenceFact) SetObservedYear(val int32) {
s.ObservedYear = val
}
// OrganizationEvidenceHeaders wraps OrganizationEvidence with response headers.
type OrganizationEvidenceHeaders struct {
CacheControl CacheControlNoStore
Response OrganizationEvidence
}
// GetCacheControl returns the value of CacheControl.
func (s *OrganizationEvidenceHeaders) GetCacheControl() CacheControlNoStore {
return s.CacheControl
}
// GetResponse returns the value of Response.
func (s *OrganizationEvidenceHeaders) GetResponse() OrganizationEvidence {
return s.Response
}
// SetCacheControl sets the value of CacheControl.
func (s *OrganizationEvidenceHeaders) SetCacheControl(val CacheControlNoStore) {
s.CacheControl = val
}
// SetResponse sets the value of Response.
func (s *OrganizationEvidenceHeaders) SetResponse(val OrganizationEvidence) {
s.Response = val
}
func (*OrganizationEvidenceHeaders) getOrganizationCandidateEvidenceRes() {}
// OrganizationHeaders wraps Organization with response headers.
type OrganizationHeaders struct {
CacheControl CacheControlNoStore
@@ -29642,6 +30504,7 @@ func (*TooManyRequestsHeaders) createOrganizationNeedRes() {}
func (*TooManyRequestsHeaders) createOrganizationRes() {}
func (*TooManyRequestsHeaders) declineMyInvitationRes() {}
func (*TooManyRequestsHeaders) getOrganizationCandidateCardRes() {}
func (*TooManyRequestsHeaders) getOrganizationCandidateEvidenceRes() {}
func (*TooManyRequestsHeaders) hideOrganizationRes() {}
func (*TooManyRequestsHeaders) loginRes() {}
func (*TooManyRequestsHeaders) raiseOrganizationInvitationSalaryRes() {}
@@ -81,6 +81,7 @@ var operationRolesSessionCookie = map[string][]string{
GetMySupportCaseOperation: []string{},
GetOrganizationOperation: []string{},
GetOrganizationCandidateCardOperation: []string{},
GetOrganizationCandidateEvidenceOperation: []string{},
GetOrganizationInvitationOperation: []string{},
GetOrganizationInvitationContactsOperation: []string{},
GetOrganizationNeedOperation: []string{},
@@ -89,6 +90,7 @@ var operationRolesSessionCookie = map[string][]string{
ListMyAssessmentResultsOperation: []string{},
ListMyCardAccessHistoryOperation: []string{},
ListMyConsentsOperation: []string{},
ListMyEvidenceOperation: []string{},
ListMyHiddenOrganizationsOperation: []string{},
ListMyInvitationsOperation: []string{},
ListMyOrganizationsOperation: []string{},
@@ -663,6 +663,13 @@ type Handler interface {
// formats appear only through their separate explicit publication choices, and self-assessment never
// becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
//
// `evidence` shows what an organization would read in the evidence section of the card
// (`GetOrganizationCandidateEvidence`): for each category of the card, the one assessment fact that
// supports its confirmed grade, with its skill, the passed grade, the trust level, the year, and the
// basis and calibration (`synthetic_demo`, `uncalibrated`). It is null while `card` is null, and an
// empty list when the card shows no category or no visible fact supports one. The preview applies no
// organization or cohort, so an organization can still receive less.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account
// answers 403 forbidden.
//
@@ -841,6 +848,45 @@ type Handler interface {
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}
GetOrganizationCandidateCard(ctx context.Context, params GetOrganizationCandidateCardParams) (GetOrganizationCandidateCardRes, error)
// GetOrganizationCandidateEvidence implements GetOrganizationCandidateEvidence operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
// organization and membership come from the current server-side session and path, never from cached
// search data.
//
// `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card
// projection. The server runs the same checks as the card read on every request: active membership,
// effective C2 publication, the candidate's hiding of this organization, and the minimum cohort. In
// addition the card must publish the `categories` field and show at least one category after the
// cohort rules, because the evidence explains those categories and discloses nothing beyond them. An
// unknown handle, a handle of another organization, a closed or revoked publication, a profile hidden
// from this organization, a profile suppressed by the minimum cohort, and a card without categories
// all answer the same 404 not_found. Closing C2 or hiding the organization blocks this read
// immediately, and a cached response proves nothing.
//
// The response lists, for each category of the card, the one visible fact that supports its confirmed
// grade: the earliest assessment that passed exactly that grade, so a lower grade or a retake adds
// nothing. A fact the candidate hid is absent. Each fact carries only the skill, the passed grade, the
// trust level, the year of the assessment, and the basis and calibration of the method
// (`synthetic_demo`, `uncalibrated`), which are the same for every candidate and say that the fact is
// a demonstration, not a validated measurement. It carries no identifier of the fact, event, result,
// or candidate, no month or exact time, and never an answer, item, score, failed attempt, review band,
// or anti-cheat signal. An express training run and a failed attempt create no fact. The answer has no
// key that joins it to a person, but it is not unlinkable: with the other values of the card it can
// narrow a small pool of candidates.
//
// Reading the evidence is a view of the candidate card: it consumes the organization's current
// card-view quota with the same distinct-card rule and is recorded in the access history with the
// `categories` field. When the quota is exhausted the operation answers 429 with Retry-After. The
// response is `Cache-Control: no-store`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account
// answers 403 forbidden; an unknown organization or account without an active membership answers 404
// not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400
// validation_failed.
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence
GetOrganizationCandidateEvidence(ctx context.Context, params GetOrganizationCandidateEvidenceParams) (GetOrganizationCandidateEvidenceRes, error)
// GetOrganizationInvitation implements GetOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
@@ -1069,6 +1115,30 @@ type Handler interface {
//
// GET /api/v1/me/consents
ListMyConsents(ctx context.Context, params ListMyConsentsParams) (ListMyConsentsRes, error)
// ListMyEvidence implements ListMyEvidence operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
// response holds only the caller's own facts. Returns a page, newest event first with the fact
// identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
//
// A fact is derived from the immutable result of a confirmed real assessment (root or corrective), in
// the same transaction that stores the result. Each fact names its source (the event and the result,
// which the candidate can open at `GetMyAssessmentResult`), the skills of the event, the grade that
// was passed with its basis and calibration, the attribution, the date, the visibility, and the trust
// level. An online assessment without a reliable confirmation of the identity has trust 1. One source
// event is one fact: its skills are tags of that fact, so several tags never make several facts.
//
// The list never carries raw answers, items, scores, failed attempts, or anti-cheat data. A failed
// attempt, a result without a reviewed category source, and an express training run (`demo_express`)
// create no fact, so reading the list before and after an express run shows no new fact. The list
// includes facts the candidate hid, with `visibility` `hidden`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account, or
// a candidate with an unverified email, answers 403 forbidden. A malformed `limit` or `cursor`, or a
// cursor of another candidate, answers 400 validation_failed.
//
// GET /api/v1/me/evidence
ListMyEvidence(ctx context.Context, params ListMyEvidenceParams) (ListMyEvidenceRes, error)
// ListMyHiddenOrganizations implements ListMyHiddenOrganizations operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
@@ -725,6 +725,13 @@ func (UnimplementedHandler) GetMyAssessmentSignalNotice(ctx context.Context) (r
// formats appear only through their separate explicit publication choices, and self-assessment never
// becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
//
// `evidence` shows what an organization would read in the evidence section of the card
// (`GetOrganizationCandidateEvidence`): for each category of the card, the one assessment fact that
// supports its confirmed grade, with its skill, the passed grade, the trust level, the year, and the
// basis and calibration (`synthetic_demo`, `uncalibrated`). It is null while `card` is null, and an
// empty list when the card shows no category or no visible fact supports one. The preview applies no
// organization or cohort, so an organization can still receive less.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account
// answers 403 forbidden.
//
@@ -930,6 +937,48 @@ func (UnimplementedHandler) GetOrganizationCandidateCard(ctx context.Context, pa
return r, ht.ErrNotImplemented
}
// GetOrganizationCandidateEvidence implements GetOrganizationCandidateEvidence operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
// organization and membership come from the current server-side session and path, never from cached
// search data.
//
// `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card
// projection. The server runs the same checks as the card read on every request: active membership,
// effective C2 publication, the candidate's hiding of this organization, and the minimum cohort. In
// addition the card must publish the `categories` field and show at least one category after the
// cohort rules, because the evidence explains those categories and discloses nothing beyond them. An
// unknown handle, a handle of another organization, a closed or revoked publication, a profile hidden
// from this organization, a profile suppressed by the minimum cohort, and a card without categories
// all answer the same 404 not_found. Closing C2 or hiding the organization blocks this read
// immediately, and a cached response proves nothing.
//
// The response lists, for each category of the card, the one visible fact that supports its confirmed
// grade: the earliest assessment that passed exactly that grade, so a lower grade or a retake adds
// nothing. A fact the candidate hid is absent. Each fact carries only the skill, the passed grade, the
// trust level, the year of the assessment, and the basis and calibration of the method
// (`synthetic_demo`, `uncalibrated`), which are the same for every candidate and say that the fact is
// a demonstration, not a validated measurement. It carries no identifier of the fact, event, result,
// or candidate, no month or exact time, and never an answer, item, score, failed attempt, review band,
// or anti-cheat signal. An express training run and a failed attempt create no fact. The answer has no
// key that joins it to a person, but it is not unlinkable: with the other values of the card it can
// narrow a small pool of candidates.
//
// Reading the evidence is a view of the candidate card: it consumes the organization's current
// card-view quota with the same distinct-card rule and is recorded in the access history with the
// `categories` field. When the quota is exhausted the operation answers 429 with Retry-After. The
// response is `Cache-Control: no-store`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account
// answers 403 forbidden; an unknown organization or account without an active membership answers 404
// not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400
// validation_failed.
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence
func (UnimplementedHandler) GetOrganizationCandidateEvidence(ctx context.Context, params GetOrganizationCandidateEvidenceParams) (r GetOrganizationCandidateEvidenceRes, _ error) {
return r, ht.ErrNotImplemented
}
// GetOrganizationInvitation implements GetOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
@@ -1185,6 +1234,33 @@ func (UnimplementedHandler) ListMyConsents(ctx context.Context, params ListMyCon
return r, ht.ErrNotImplemented
}
// ListMyEvidence implements ListMyEvidence operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
// response holds only the caller's own facts. Returns a page, newest event first with the fact
// identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
//
// A fact is derived from the immutable result of a confirmed real assessment (root or corrective), in
// the same transaction that stores the result. Each fact names its source (the event and the result,
// which the candidate can open at `GetMyAssessmentResult`), the skills of the event, the grade that
// was passed with its basis and calibration, the attribution, the date, the visibility, and the trust
// level. An online assessment without a reliable confirmation of the identity has trust 1. One source
// event is one fact: its skills are tags of that fact, so several tags never make several facts.
//
// The list never carries raw answers, items, scores, failed attempts, or anti-cheat data. A failed
// attempt, a result without a reviewed category source, and an express training run (`demo_express`)
// create no fact, so reading the list before and after an express run shows no new fact. The list
// includes facts the candidate hid, with `visibility` `hidden`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account, or
// a candidate with an unverified email, answers 403 forbidden. A malformed `limit` or `cursor`, or a
// cursor of another candidate, answers 400 validation_failed.
//
// GET /api/v1/me/evidence
func (UnimplementedHandler) ListMyEvidence(ctx context.Context, params ListMyEvidenceParams) (r ListMyEvidenceRes, _ error) {
return r, ht.ErrNotImplemented
}
// ListMyHiddenOrganizations implements ListMyHiddenOrganizations operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
@@ -6512,6 +6512,24 @@ func (s *CardPreview) Validate() error {
Error: err,
})
}
if err := func() error {
if value, ok := s.Evidence.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "evidence",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
@@ -8833,6 +8851,397 @@ func (s EmailVerificationResultEmailVerified) Validate() error {
}
}
func (s EvidenceAttribution) Validate() error {
switch s {
case "personal":
return nil
case "team_role":
return nil
case "team_unattributed":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s EvidenceBasis) Validate() error {
switch s {
case "synthetic_demo":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s EvidenceCalibrationStatus) Validate() error {
switch s {
case "uncalibrated":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *EvidenceFact) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Kind.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "kind",
Error: err,
})
}
if err := func() error {
if err := s.Source.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "source",
Error: err,
})
}
if err := func() error {
if s.Skills == nil {
return errors.New("nil is invalid value")
}
if err := (validate.Array{
MinLength: 1,
MinLengthSet: true,
MaxLength: 13,
MaxLengthSet: true,
}).ValidateLength(len(s.Skills)); err != nil {
return errors.Wrap(err, "array")
}
if err := validate.UniqueItems(s.Skills); err != nil {
return errors.Wrap(err, "array")
}
var failures []validate.FieldError
for i, elem := range s.Skills {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: fmt.Sprintf("[%d]", i),
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "skills",
Error: err,
})
}
if err := func() error {
if err := s.Result.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "result",
Error: err,
})
}
if err := func() error {
if err := s.Attribution.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "attribution",
Error: err,
})
}
if err := func() error {
if err := s.Trust.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "trust",
Error: err,
})
}
if err := func() error {
if err := s.Visibility.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "visibility",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *EvidenceFactList) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
if err := (validate.Array{
MinLength: 0,
MinLengthSet: false,
MaxLength: 100,
MaxLengthSet: true,
}).ValidateLength(len(s.Items)); err != nil {
return errors.Wrap(err, "array")
}
var failures []validate.FieldError
for i, elem := range s.Items {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: fmt.Sprintf("[%d]", i),
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if err := func() error {
if err := s.Page.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "page",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *EvidenceFactListHeaders) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.CacheControl.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "CacheControl",
Error: err,
})
}
if err := func() error {
if err := s.Response.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "Response",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s EvidenceKind) Validate() error {
switch s {
case "claim":
return nil
case "measurement":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *EvidenceResult) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Grade.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "grade",
Error: err,
})
}
if err := func() error {
if err := s.Basis.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "basis",
Error: err,
})
}
if err := func() error {
if err := s.CalibrationStatus.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "calibration_status",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s EvidenceSkillCode) Validate() error {
switch s {
case "backend":
return nil
case "frontend":
return nil
case "mobile":
return nil
case "network_engineer":
return nil
case "devops_sre":
return nil
case "data_analyst":
return nil
case "ds_ml":
return nil
case "information_security":
return nil
case "qa":
return nil
case "go":
return nil
case "postgresql":
return nil
case "kafka":
return nil
case "docker":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *EvidenceSource) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Type.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "type",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s EvidenceSourceType) Validate() error {
switch s {
case "assessment_result":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s EvidenceTrustLevel) Validate() error {
alias := (int32)(s)
if err := (validate.Int{
MinSet: true,
Min: 0,
MaxSet: true,
Max: 3,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(alias)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}
func (s EvidenceVisibility) Validate() error {
switch s {
case "visible":
return nil
case "hidden":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *FinalizeMyAssessmentAttemptBadRequest) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
@@ -9379,6 +9788,38 @@ func (s *GetOrganizationCandidateCardUnauthorized) Validate() error {
return nil
}
func (s *GetOrganizationCandidateEvidenceBadRequest) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *GetOrganizationCandidateEvidenceForbidden) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *GetOrganizationCandidateEvidenceNotFound) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *GetOrganizationCandidateEvidenceUnauthorized) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *GetOrganizationForbidden) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
@@ -10914,6 +11355,30 @@ func (s *ListMyConsentsUnauthorized) Validate() error {
return nil
}
func (s *ListMyEvidenceBadRequest) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *ListMyEvidenceForbidden) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *ListMyEvidenceUnauthorized) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
return err
}
return nil
}
func (s *ListMyHiddenOrganizationsBadRequest) Validate() error {
alias := (*Problem)(s)
if err := alias.Validate(); err != nil {
@@ -16322,6 +16787,176 @@ func (s OrganizationDescription) Validate() error {
return nil
}
func (s *OrganizationEvidence) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
if err := (validate.Array{
MinLength: 0,
MinLengthSet: false,
MaxLength: 9,
MaxLengthSet: true,
}).ValidateLength(len(s.Items)); err != nil {
return errors.Wrap(err, "array")
}
var failures []validate.FieldError
for i, elem := range s.Items {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: fmt.Sprintf("[%d]", i),
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *OrganizationEvidenceFact) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Skill.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "skill",
Error: err,
})
}
if err := func() error {
if err := s.Grade.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "grade",
Error: err,
})
}
if err := func() error {
if err := s.Trust.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "trust",
Error: err,
})
}
if err := func() error {
if err := s.Basis.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "basis",
Error: err,
})
}
if err := func() error {
if err := s.CalibrationStatus.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "calibration_status",
Error: err,
})
}
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 2000,
MaxSet: true,
Max: 9999,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(s.ObservedYear)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "observed_year",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *OrganizationEvidenceHeaders) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.CacheControl.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "CacheControl",
Error: err,
})
}
if err := func() error {
if err := s.Response.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "Response",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *OrganizationHeaders) Validate() error {
if s == nil {
return validate.ErrNilPointer