2026-10-23 12:24:54 +00:00
|
|
|
|
// Package api provides primitives to interact with the openapi HTTP API.
|
|
|
|
|
|
//
|
|
|
|
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"bytes"
|
|
|
|
|
|
"compress/gzip"
|
|
|
|
|
|
"context"
|
|
|
|
|
|
"encoding/base64"
|
|
|
|
|
|
"encoding/json"
|
|
|
|
|
|
"fmt"
|
|
|
|
|
|
"io"
|
|
|
|
|
|
"net/http"
|
|
|
|
|
|
"net/url"
|
|
|
|
|
|
"path"
|
|
|
|
|
|
"strings"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
|
"github.com/oapi-codegen/runtime"
|
|
|
|
|
|
strictgin "github.com/oapi-codegen/runtime/strictmiddleware/gin"
|
|
|
|
|
|
openapi_types "github.com/oapi-codegen/runtime/types"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
const (
|
|
|
|
|
|
BearerAuthScopes = "bearerAuth.Scopes"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Defines values for AuthConfigMode.
|
|
|
|
|
|
const (
|
|
|
|
|
|
Oidc AuthConfigMode = "oidc"
|
|
|
|
|
|
Password AuthConfigMode = "password"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// Defines values for QuestionType.
|
|
|
|
|
|
const (
|
|
|
|
|
|
Boolean QuestionType = "boolean"
|
|
|
|
|
|
Date QuestionType = "date"
|
|
|
|
|
|
Number QuestionType = "number"
|
|
|
|
|
|
Select QuestionType = "select"
|
|
|
|
|
|
Text QuestionType = "text"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Defines values for SignatureType.
|
|
|
|
|
|
const (
|
|
|
|
|
|
Drawn SignatureType = "drawn"
|
|
|
|
|
|
Image SignatureType = "image"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Defines values for UserIdType.
|
|
|
|
|
|
const (
|
2026-10-25 10:53:17 +00:00
|
|
|
|
Email UserIdType = "email"
|
|
|
|
|
|
ForeignkeyGuid UserIdType = "foreignkey guid"
|
|
|
|
|
|
Phone UserIdType = "phone"
|
|
|
|
|
|
Username UserIdType = "username"
|
2026-10-23 12:24:54 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// AccessCode defines model for AccessCode.
|
|
|
|
|
|
type AccessCode struct {
|
|
|
|
|
|
Code string `json:"code"`
|
|
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
|
FormId openapi_types.UUID `json:"formId"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
Used bool `json:"used"`
|
|
|
|
|
|
UsedAt *time.Time `json:"usedAt,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Answer defines model for Answer.
|
|
|
|
|
|
type Answer struct {
|
|
|
|
|
|
QuestionId openapi_types.UUID `json:"questionId"`
|
|
|
|
|
|
|
|
|
|
|
|
// Value Answer value. String, number, boolean or list of strings depending on the question type.
|
|
|
|
|
|
Value interface{} `json:"value"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AnswerRecord defines model for AnswerRecord.
|
|
|
|
|
|
type AnswerRecord struct {
|
|
|
|
|
|
QuestionId openapi_types.UUID `json:"questionId"`
|
|
|
|
|
|
QuestionKey string `json:"questionKey"`
|
|
|
|
|
|
|
|
|
|
|
|
// Value The captured value
|
|
|
|
|
|
Value interface{} `json:"value"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// AuthConfig defines model for AuthConfig.
|
|
|
|
|
|
type AuthConfig struct {
|
|
|
|
|
|
Mode AuthConfigMode `json:"mode"`
|
|
|
|
|
|
Oidc *OIDCClientConfig `json:"oidc,omitempty"`
|
|
|
|
|
|
RequireSubmissionAuth bool `json:"requireSubmissionAuth"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AuthConfigMode defines model for AuthConfig.Mode.
|
|
|
|
|
|
type AuthConfigMode string
|
|
|
|
|
|
|
|
|
|
|
|
// AuthMeResponse defines model for AuthMeResponse.
|
|
|
|
|
|
type AuthMeResponse struct {
|
|
|
|
|
|
Authenticated bool `json:"authenticated"`
|
|
|
|
|
|
User *AuthUser `json:"user,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AuthUser defines model for AuthUser.
|
|
|
|
|
|
type AuthUser struct {
|
|
|
|
|
|
CanAdmin bool `json:"canAdmin"`
|
|
|
|
|
|
CanView bool `json:"canView"`
|
|
|
|
|
|
Email *openapi_types.Email `json:"email,omitempty"`
|
|
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
|
|
Roles []string `json:"roles"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// ClientTracking Client supplied tracking details. IP and user agent are captured server-side.
|
|
|
|
|
|
type ClientTracking struct {
|
|
|
|
|
|
Locale *string `json:"locale,omitempty"`
|
|
|
|
|
|
Place *string `json:"place,omitempty"`
|
|
|
|
|
|
Referer *string `json:"referer,omitempty"`
|
|
|
|
|
|
Timezone *string `json:"timezone,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateAccessCodesRequest defines model for CreateAccessCodesRequest.
|
|
|
|
|
|
type CreateAccessCodesRequest struct {
|
|
|
|
|
|
Count int `json:"count"`
|
|
|
|
|
|
Prefix *string `json:"prefix,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateFormRequest defines model for CreateFormRequest.
|
|
|
|
|
|
type CreateFormRequest struct {
|
|
|
|
|
|
CompanyName *string `json:"companyName,omitempty"`
|
|
|
|
|
|
ContactEmail *string `json:"contactEmail,omitempty"`
|
|
|
|
|
|
ContactPhone *string `json:"contactPhone,omitempty"`
|
|
|
|
|
|
ContactUrl *string `json:"contactUrl,omitempty"`
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
ExternalReferenceLabel *string `json:"externalReferenceLabel,omitempty"`
|
|
|
|
|
|
ExternalReferenceRequired *bool `json:"externalReferenceRequired,omitempty"`
|
|
|
|
|
|
Introduction *string `json:"introduction,omitempty"`
|
|
|
|
|
|
LogoUrl *string `json:"logoUrl,omitempty"`
|
|
|
|
|
|
PdfUrl *string `json:"pdfUrl,omitempty"`
|
|
|
|
|
|
Questions []QuestionInput `json:"questions"`
|
|
|
|
|
|
RequiresAccessCode *bool `json:"requiresAccessCode,omitempty"`
|
2026-10-25 10:53:17 +00:00
|
|
|
|
Sections *[]SectionInput `json:"sections,omitempty"`
|
2026-10-23 12:24:54 +00:00
|
|
|
|
SignatureRequired *bool `json:"signatureRequired,omitempty"`
|
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Error defines model for Error.
|
|
|
|
|
|
type Error struct {
|
|
|
|
|
|
Code *string `json:"code,omitempty"`
|
|
|
|
|
|
Error string `json:"error"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Form defines model for Form.
|
|
|
|
|
|
type Form struct {
|
|
|
|
|
|
CompanyName *string `json:"companyName,omitempty"`
|
|
|
|
|
|
ContactEmail *string `json:"contactEmail,omitempty"`
|
|
|
|
|
|
ContactPhone *string `json:"contactPhone,omitempty"`
|
|
|
|
|
|
ContactUrl *string `json:"contactUrl,omitempty"`
|
|
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// ExternalReferenceLabel Label shown for the external reference, for example Invoice number
|
|
|
|
|
|
ExternalReferenceLabel *string `json:"externalReferenceLabel,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// ExternalReferenceRequired Whether a reference identifier is required before the form can be submitted
|
|
|
|
|
|
ExternalReferenceRequired *bool `json:"externalReferenceRequired,omitempty"`
|
|
|
|
|
|
FormGroupId openapi_types.UUID `json:"formGroupId"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
|
|
|
|
|
|
// Introduction Introduction section explaining purpose, background and support details
|
|
|
|
|
|
Introduction *string `json:"introduction,omitempty"`
|
|
|
|
|
|
IsActive bool `json:"isActive"`
|
|
|
|
|
|
LogoUrl *string `json:"logoUrl,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// PdfUrl Optional absolute URL of a prebuilt PDF form linked to this definition
|
|
|
|
|
|
PdfUrl *string `json:"pdfUrl,omitempty"`
|
|
|
|
|
|
Questions []Question `json:"questions"`
|
|
|
|
|
|
RequiresAccessCode bool `json:"requiresAccessCode"`
|
2026-10-25 10:53:17 +00:00
|
|
|
|
Sections *[]Section `json:"sections,omitempty"`
|
2026-10-23 12:24:54 +00:00
|
|
|
|
|
|
|
|
|
|
// SignatureRequired Whether a digital signature is captured at the end of the form
|
|
|
|
|
|
SignatureRequired *bool `json:"signatureRequired,omitempty"`
|
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
|
|
|
|
Version int `json:"version"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// FormSummary defines model for FormSummary.
|
|
|
|
|
|
type FormSummary struct {
|
|
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// ExternalReferenceLabel Label shown for the external reference, for example Invoice number
|
|
|
|
|
|
ExternalReferenceLabel *string `json:"externalReferenceLabel,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// ExternalReferenceRequired Whether a reference identifier is required before the form can be submitted
|
|
|
|
|
|
ExternalReferenceRequired *bool `json:"externalReferenceRequired,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// FormGroupId Groups all versions of the same logical form
|
|
|
|
|
|
FormGroupId openapi_types.UUID `json:"formGroupId"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
IsActive bool `json:"isActive"`
|
|
|
|
|
|
LogoUrl *string `json:"logoUrl,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// PdfUrl Optional absolute URL of a prebuilt PDF form linked to this definition
|
|
|
|
|
|
PdfUrl *string `json:"pdfUrl,omitempty"`
|
|
|
|
|
|
QuestionCount int `json:"questionCount"`
|
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
|
|
|
|
Version int `json:"version"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Health defines model for Health.
|
|
|
|
|
|
type Health struct {
|
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
|
UptimeSeconds *int64 `json:"uptimeSeconds,omitempty"`
|
|
|
|
|
|
Version string `json:"version"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// LoginRequest defines model for LoginRequest.
|
|
|
|
|
|
type LoginRequest struct {
|
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// LoginResponse defines model for LoginResponse.
|
|
|
|
|
|
type LoginResponse struct {
|
|
|
|
|
|
Token string `json:"token"`
|
|
|
|
|
|
User AuthUser `json:"user"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OIDCClientConfig defines model for OIDCClientConfig.
|
|
|
|
|
|
type OIDCClientConfig struct {
|
|
|
|
|
|
AuthorizationEndpoint string `json:"authorizationEndpoint"`
|
|
|
|
|
|
ClientId string `json:"clientId"`
|
|
|
|
|
|
IssuerUrl string `json:"issuerUrl"`
|
|
|
|
|
|
Scopes []string `json:"scopes"`
|
|
|
|
|
|
TokenEndpoint string `json:"tokenEndpoint"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// Question defines model for Question.
|
|
|
|
|
|
type Question struct {
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
|
|
|
|
|
|
// Key Stable machine key for this question within the form
|
|
|
|
|
|
Key string `json:"key"`
|
|
|
|
|
|
|
|
|
|
|
|
// Label The question text (may be multiline, no formatting directives)
|
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
|
|
|
|
|
|
|
// MaxValue Maximum allowed value for `number` questions
|
|
|
|
|
|
MaxValue *float32 `json:"maxValue,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// MinValue Minimum allowed value for `number` questions
|
|
|
|
|
|
MinValue *float32 `json:"minValue,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// Multiline Whether a `text` answer may span multiple lines
|
|
|
|
|
|
Multiline *bool `json:"multiline,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// Options Present for `select` questions
|
|
|
|
|
|
Options *[]QuestionOption `json:"options,omitempty"`
|
|
|
|
|
|
Placeholder *string `json:"placeholder,omitempty"`
|
|
|
|
|
|
Position int `json:"position"`
|
|
|
|
|
|
Required bool `json:"required"`
|
|
|
|
|
|
|
2026-10-25 10:53:17 +00:00
|
|
|
|
// SectionId Identifier of the section this question belongs to
|
|
|
|
|
|
SectionId *openapi_types.UUID `json:"sectionId,omitempty"`
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// Type * `boolean` – true/false
|
|
|
|
|
|
// * `number` – numeric answer
|
|
|
|
|
|
// * `select` – one option from a configured list
|
|
|
|
|
|
// * `text` – free-form text (single or multiline)
|
|
|
|
|
|
// * `date` - calendar date in `YYYY-MM-DD` form
|
|
|
|
|
|
Type QuestionType `json:"type"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// QuestionInput defines model for QuestionInput.
|
|
|
|
|
|
type QuestionInput struct {
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
Key string `json:"key"`
|
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
|
MaxValue *float32 `json:"maxValue,omitempty"`
|
|
|
|
|
|
MinValue *float32 `json:"minValue,omitempty"`
|
|
|
|
|
|
Multiline *bool `json:"multiline,omitempty"`
|
|
|
|
|
|
Options *[]QuestionOption `json:"options,omitempty"`
|
|
|
|
|
|
Placeholder *string `json:"placeholder,omitempty"`
|
|
|
|
|
|
Required bool `json:"required"`
|
|
|
|
|
|
|
2026-10-25 10:53:17 +00:00
|
|
|
|
// SectionId Identifier of the section this question belongs to
|
|
|
|
|
|
SectionId *openapi_types.UUID `json:"sectionId,omitempty"`
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// Type * `boolean` – true/false
|
|
|
|
|
|
// * `number` – numeric answer
|
|
|
|
|
|
// * `select` – one option from a configured list
|
|
|
|
|
|
// * `text` – free-form text (single or multiline)
|
|
|
|
|
|
// * `date` - calendar date in `YYYY-MM-DD` form
|
|
|
|
|
|
Type QuestionType `json:"type"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// QuestionOption defines model for QuestionOption.
|
|
|
|
|
|
type QuestionOption struct {
|
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
|
Value string `json:"value"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// QuestionType * `boolean` – true/false
|
|
|
|
|
|
// * `number` – numeric answer
|
|
|
|
|
|
// * `select` – one option from a configured list
|
|
|
|
|
|
// * `text` – free-form text (single or multiline)
|
|
|
|
|
|
// * `date` - calendar date in `YYYY-MM-DD` form
|
|
|
|
|
|
type QuestionType string
|
|
|
|
|
|
|
2026-10-25 10:53:17 +00:00
|
|
|
|
// Section defines model for Section.
|
|
|
|
|
|
type Section struct {
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
|
|
|
|
|
|
// Identifier Section identifier such as letter or number used to prefix question numbers
|
|
|
|
|
|
Identifier string `json:"identifier"`
|
|
|
|
|
|
Title *string `json:"title,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SectionInput defines model for SectionInput.
|
|
|
|
|
|
type SectionInput struct {
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
Identifier string `json:"identifier"`
|
|
|
|
|
|
Title *string `json:"title,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// Signature defines model for Signature.
|
|
|
|
|
|
type Signature struct {
|
|
|
|
|
|
DataUrl string `json:"dataUrl"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
SignedAt time.Time `json:"signedAt"`
|
|
|
|
|
|
Title *string `json:"title,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// Type * `drawn` - signature drawn in the browser
|
|
|
|
|
|
// * `image` - uploaded image containing a signature
|
|
|
|
|
|
Type SignatureType `json:"type"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SignatureInput defines model for SignatureInput.
|
|
|
|
|
|
type SignatureInput struct {
|
|
|
|
|
|
// DataUrl PNG or JPEG image data URL (maximum decoded size 2 MB)
|
|
|
|
|
|
DataUrl string `json:"dataUrl"`
|
|
|
|
|
|
|
|
|
|
|
|
// Name Name of the person signing
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
|
|
|
|
|
|
// Title Optional title of the person signing
|
|
|
|
|
|
Title *string `json:"title,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// Type * `drawn` - signature drawn in the browser
|
|
|
|
|
|
// * `image` - uploaded image containing a signature
|
|
|
|
|
|
Type SignatureType `json:"type"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SignatureType * `drawn` - signature drawn in the browser
|
|
|
|
|
|
// * `image` - uploaded image containing a signature
|
|
|
|
|
|
type SignatureType string
|
|
|
|
|
|
|
|
|
|
|
|
// Submission defines model for Submission.
|
|
|
|
|
|
type Submission struct {
|
|
|
|
|
|
Answers []AnswerRecord `json:"answers"`
|
|
|
|
|
|
ExternalReference *string `json:"externalReference,omitempty"`
|
|
|
|
|
|
FormId openapi_types.UUID `json:"formId"`
|
|
|
|
|
|
FormVersion int `json:"formVersion"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
|
|
|
|
|
|
// OfflinePdfName Present when the respondent uploaded a completed offline PDF
|
|
|
|
|
|
OfflinePdfName *string `json:"offlinePdfName,omitempty"`
|
|
|
|
|
|
Signature *Signature `json:"signature,omitempty"`
|
|
|
|
|
|
SubmittedAt time.Time `json:"submittedAt"`
|
|
|
|
|
|
Tracking *Tracking `json:"tracking,omitempty"`
|
|
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
|
UserIdType UserIdType `json:"userIdType"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmissionSummary defines model for SubmissionSummary.
|
|
|
|
|
|
type SubmissionSummary struct {
|
|
|
|
|
|
ExternalReference *string `json:"externalReference,omitempty"`
|
|
|
|
|
|
FormId openapi_types.UUID `json:"formId"`
|
|
|
|
|
|
FormVersion int `json:"formVersion"`
|
|
|
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
|
SubmittedAt time.Time `json:"submittedAt"`
|
|
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
|
UserIdType UserIdType `json:"userIdType"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitFormRequest defines model for SubmitFormRequest.
|
|
|
|
|
|
type SubmitFormRequest struct {
|
|
|
|
|
|
// AccessCode Required when the form has `requiresAccessCode = true`
|
|
|
|
|
|
AccessCode *string `json:"accessCode,omitempty"`
|
|
|
|
|
|
Answers []Answer `json:"answers"`
|
|
|
|
|
|
|
|
|
|
|
|
// ExternalReference External reference identifier used to link this response to a record in
|
|
|
|
|
|
// another system, for example an invoice, account or policy number.
|
|
|
|
|
|
ExternalReference *string `json:"externalReference,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// OfflinePdf Base64 data URL of a PDF completed offline (for example
|
|
|
|
|
|
// `data:application/pdf;base64,...`). Maximum decoded size is 10 MB.
|
|
|
|
|
|
OfflinePdf *string `json:"offlinePdf,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// OfflinePdfName Original filename of the uploaded offline PDF
|
|
|
|
|
|
OfflinePdfName *string `json:"offlinePdfName,omitempty"`
|
|
|
|
|
|
Signature *SignatureInput `json:"signature,omitempty"`
|
|
|
|
|
|
|
|
|
|
|
|
// Tracking Client supplied tracking details. IP and user agent are captured server-side.
|
|
|
|
|
|
Tracking *ClientTracking `json:"tracking,omitempty"`
|
|
|
|
|
|
|
2026-10-23 23:57:57 +00:00
|
|
|
|
// UserId Respondent identifier captured at the start (email, username, phone, foreignkey or GUID)
|
2026-10-23 12:24:54 +00:00
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
|
UserIdType UserIdType `json:"userIdType"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Tracking defines model for Tracking.
|
|
|
|
|
|
type Tracking struct {
|
|
|
|
|
|
IpAddress *string `json:"ipAddress,omitempty"`
|
|
|
|
|
|
Locale *string `json:"locale,omitempty"`
|
|
|
|
|
|
Place *string `json:"place,omitempty"`
|
|
|
|
|
|
Referer *string `json:"referer,omitempty"`
|
|
|
|
|
|
Timezone *string `json:"timezone,omitempty"`
|
|
|
|
|
|
UserAgent *string `json:"userAgent,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateFormRequest defines model for UpdateFormRequest.
|
|
|
|
|
|
type UpdateFormRequest struct {
|
|
|
|
|
|
CompanyName *string `json:"companyName,omitempty"`
|
|
|
|
|
|
ContactEmail *string `json:"contactEmail,omitempty"`
|
|
|
|
|
|
ContactPhone *string `json:"contactPhone,omitempty"`
|
|
|
|
|
|
ContactUrl *string `json:"contactUrl,omitempty"`
|
|
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
|
|
ExternalReferenceLabel *string `json:"externalReferenceLabel,omitempty"`
|
|
|
|
|
|
ExternalReferenceRequired *bool `json:"externalReferenceRequired,omitempty"`
|
|
|
|
|
|
Introduction *string `json:"introduction,omitempty"`
|
|
|
|
|
|
LogoUrl *string `json:"logoUrl,omitempty"`
|
|
|
|
|
|
PdfUrl *string `json:"pdfUrl,omitempty"`
|
|
|
|
|
|
Questions []QuestionInput `json:"questions"`
|
|
|
|
|
|
RequiresAccessCode *bool `json:"requiresAccessCode,omitempty"`
|
2026-10-25 10:53:17 +00:00
|
|
|
|
Sections *[]SectionInput `json:"sections,omitempty"`
|
2026-10-23 12:24:54 +00:00
|
|
|
|
SignatureRequired *bool `json:"signatureRequired,omitempty"`
|
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UserIdType defines model for UserIdType.
|
|
|
|
|
|
type UserIdType string
|
|
|
|
|
|
|
|
|
|
|
|
// FormId defines model for FormId.
|
|
|
|
|
|
type FormId = openapi_types.UUID
|
|
|
|
|
|
|
|
|
|
|
|
// ListFormsParams defines parameters for ListForms.
|
|
|
|
|
|
type ListFormsParams struct {
|
|
|
|
|
|
IncludeInactive *bool `form:"includeInactive,omitempty" json:"includeInactive,omitempty"`
|
|
|
|
|
|
ActiveOnly *bool `form:"activeOnly,omitempty" json:"activeOnly,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// LoginJSONRequestBody defines body for Login for application/json ContentType.
|
|
|
|
|
|
type LoginJSONRequestBody = LoginRequest
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// CreateFormJSONRequestBody defines body for CreateForm for application/json ContentType.
|
|
|
|
|
|
type CreateFormJSONRequestBody = CreateFormRequest
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateFormJSONRequestBody defines body for UpdateForm for application/json ContentType.
|
|
|
|
|
|
type UpdateFormJSONRequestBody = UpdateFormRequest
|
|
|
|
|
|
|
|
|
|
|
|
// CreateAccessCodesJSONRequestBody defines body for CreateAccessCodes for application/json ContentType.
|
|
|
|
|
|
type CreateAccessCodesJSONRequestBody = CreateAccessCodesRequest
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitFormJSONRequestBody defines body for SubmitForm for application/json ContentType.
|
|
|
|
|
|
type SubmitFormJSONRequestBody = SubmitFormRequest
|
|
|
|
|
|
|
|
|
|
|
|
// ServerInterface represents all server handlers.
|
|
|
|
|
|
type ServerInterface interface {
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// Get browser authentication configuration
|
|
|
|
|
|
// (GET /auth/config)
|
|
|
|
|
|
GetAuthConfig(c *gin.Context)
|
|
|
|
|
|
// Log in with the local password fallback
|
|
|
|
|
|
// (POST /auth/login)
|
|
|
|
|
|
Login(c *gin.Context)
|
|
|
|
|
|
// Log out
|
|
|
|
|
|
// (POST /auth/logout)
|
|
|
|
|
|
Logout(c *gin.Context)
|
|
|
|
|
|
// Get the current authenticated user
|
|
|
|
|
|
// (GET /auth/me)
|
|
|
|
|
|
GetCurrentUser(c *gin.Context)
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// List forms
|
|
|
|
|
|
// (GET /forms)
|
|
|
|
|
|
ListForms(c *gin.Context, params ListFormsParams)
|
|
|
|
|
|
// Create a form
|
|
|
|
|
|
// (POST /forms)
|
|
|
|
|
|
CreateForm(c *gin.Context)
|
|
|
|
|
|
// Delete a form definition
|
|
|
|
|
|
// (DELETE /forms/{formId})
|
|
|
|
|
|
DeleteForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Get a form by id
|
|
|
|
|
|
// (GET /forms/{formId})
|
|
|
|
|
|
GetForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Update a form definition
|
|
|
|
|
|
// (PUT /forms/{formId})
|
|
|
|
|
|
UpdateForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// List access codes for a form
|
|
|
|
|
|
// (GET /forms/{formId}/access-codes)
|
|
|
|
|
|
ListAccessCodes(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Create one or more access codes for a form
|
|
|
|
|
|
// (POST /forms/{formId}/access-codes)
|
|
|
|
|
|
CreateAccessCodes(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Activate a form
|
|
|
|
|
|
// (POST /forms/{formId}/activate)
|
|
|
|
|
|
ActivateForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Inactivate a form
|
|
|
|
|
|
// (POST /forms/{formId}/inactivate)
|
|
|
|
|
|
InactivateForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Download a PDF rendering of the form definition
|
|
|
|
|
|
// (GET /forms/{formId}/pdf)
|
|
|
|
|
|
GetFormPdf(c *gin.Context, formId FormId)
|
|
|
|
|
|
// List submissions for a form (management)
|
|
|
|
|
|
// (GET /forms/{formId}/submissions)
|
|
|
|
|
|
ListFormSubmissions(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Submit an answer set for a form
|
|
|
|
|
|
// (POST /forms/{formId}/submissions)
|
|
|
|
|
|
SubmitForm(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Create a new version of a form
|
|
|
|
|
|
// (POST /forms/{formId}/versions)
|
|
|
|
|
|
CreateFormVersion(c *gin.Context, formId FormId)
|
|
|
|
|
|
// Service health
|
|
|
|
|
|
// (GET /health)
|
|
|
|
|
|
GetHealth(c *gin.Context)
|
|
|
|
|
|
// Get a submission by id (management)
|
|
|
|
|
|
// (GET /submissions/{submissionId})
|
|
|
|
|
|
GetSubmission(c *gin.Context, submissionId openapi_types.UUID)
|
|
|
|
|
|
// Download the offline PDF uploaded with a submission
|
|
|
|
|
|
// (GET /submissions/{submissionId}/offline-pdf)
|
|
|
|
|
|
GetSubmissionOfflinePdf(c *gin.Context, submissionId openapi_types.UUID)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ServerInterfaceWrapper converts contexts to parameters.
|
|
|
|
|
|
type ServerInterfaceWrapper struct {
|
|
|
|
|
|
Handler ServerInterface
|
|
|
|
|
|
HandlerMiddlewares []MiddlewareFunc
|
|
|
|
|
|
ErrorHandler func(*gin.Context, error, int)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type MiddlewareFunc func(c *gin.Context)
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// GetAuthConfig operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetAuthConfig(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetAuthConfig(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Login operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) Login(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.Login(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Logout operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) Logout(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.Logout(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetCurrentUser operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetCurrentUser(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetCurrentUser(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// ListForms operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) ListForms(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
|
|
|
|
var params ListFormsParams
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Optional query parameter "includeInactive" -------------
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "includeInactive", c.Request.URL.Query(), ¶ms.IncludeInactive)
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter includeInactive: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Optional query parameter "activeOnly" -------------
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "activeOnly", c.Request.URL.Query(), ¶ms.ActiveOnly)
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter activeOnly: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.ListForms(c, params)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) CreateForm(c *gin.Context) {
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.CreateForm(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) DeleteForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.DeleteForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) UpdateForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.UpdateForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ListAccessCodes operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) ListAccessCodes(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.ListAccessCodes(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateAccessCodes operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) CreateAccessCodes(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.CreateAccessCodes(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ActivateForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) ActivateForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.ActivateForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// InactivateForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) InactivateForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.InactivateForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetFormPdf operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetFormPdf(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetFormPdf(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ListFormSubmissions operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) ListFormSubmissions(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.ListFormSubmissions(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitForm operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) SubmitForm(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.SubmitForm(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateFormVersion operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) CreateFormVersion(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "formId" -------------
|
|
|
|
|
|
var formId FormId
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "formId", c.Param("formId"), &formId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter formId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.CreateFormVersion(c, formId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetHealth operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetHealth(c)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSubmission operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetSubmission(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "submissionId" -------------
|
|
|
|
|
|
var submissionId openapi_types.UUID
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "submissionId", c.Param("submissionId"), &submissionId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter submissionId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetSubmission(c, submissionId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSubmissionOfflinePdf operation middleware
|
|
|
|
|
|
func (siw *ServerInterfaceWrapper) GetSubmissionOfflinePdf(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "submissionId" -------------
|
|
|
|
|
|
var submissionId openapi_types.UUID
|
|
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "submissionId", c.Param("submissionId"), &submissionId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter submissionId: %w", err), http.StatusBadRequest)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
c.Set(BearerAuthScopes, []string{})
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
|
|
|
|
middleware(c)
|
|
|
|
|
|
if c.IsAborted() {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
siw.Handler.GetSubmissionOfflinePdf(c, submissionId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GinServerOptions provides options for the Gin server.
|
|
|
|
|
|
type GinServerOptions struct {
|
|
|
|
|
|
BaseURL string
|
|
|
|
|
|
Middlewares []MiddlewareFunc
|
|
|
|
|
|
ErrorHandler func(*gin.Context, error, int)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
|
|
|
|
|
|
func RegisterHandlers(router gin.IRouter, si ServerInterface) {
|
|
|
|
|
|
RegisterHandlersWithOptions(router, si, GinServerOptions{})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RegisterHandlersWithOptions creates http.Handler with additional options
|
|
|
|
|
|
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions) {
|
|
|
|
|
|
errorHandler := options.ErrorHandler
|
|
|
|
|
|
if errorHandler == nil {
|
|
|
|
|
|
errorHandler = func(c *gin.Context, err error, statusCode int) {
|
|
|
|
|
|
c.JSON(statusCode, gin.H{"msg": err.Error()})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wrapper := ServerInterfaceWrapper{
|
|
|
|
|
|
Handler: si,
|
|
|
|
|
|
HandlerMiddlewares: options.Middlewares,
|
|
|
|
|
|
ErrorHandler: errorHandler,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
router.GET(options.BaseURL+"/auth/config", wrapper.GetAuthConfig)
|
|
|
|
|
|
router.POST(options.BaseURL+"/auth/login", wrapper.Login)
|
|
|
|
|
|
router.POST(options.BaseURL+"/auth/logout", wrapper.Logout)
|
|
|
|
|
|
router.GET(options.BaseURL+"/auth/me", wrapper.GetCurrentUser)
|
2026-10-23 12:24:54 +00:00
|
|
|
|
router.GET(options.BaseURL+"/forms", wrapper.ListForms)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms", wrapper.CreateForm)
|
|
|
|
|
|
router.DELETE(options.BaseURL+"/forms/:formId", wrapper.DeleteForm)
|
|
|
|
|
|
router.GET(options.BaseURL+"/forms/:formId", wrapper.GetForm)
|
|
|
|
|
|
router.PUT(options.BaseURL+"/forms/:formId", wrapper.UpdateForm)
|
|
|
|
|
|
router.GET(options.BaseURL+"/forms/:formId/access-codes", wrapper.ListAccessCodes)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms/:formId/access-codes", wrapper.CreateAccessCodes)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms/:formId/activate", wrapper.ActivateForm)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms/:formId/inactivate", wrapper.InactivateForm)
|
|
|
|
|
|
router.GET(options.BaseURL+"/forms/:formId/pdf", wrapper.GetFormPdf)
|
|
|
|
|
|
router.GET(options.BaseURL+"/forms/:formId/submissions", wrapper.ListFormSubmissions)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms/:formId/submissions", wrapper.SubmitForm)
|
|
|
|
|
|
router.POST(options.BaseURL+"/forms/:formId/versions", wrapper.CreateFormVersion)
|
|
|
|
|
|
router.GET(options.BaseURL+"/health", wrapper.GetHealth)
|
|
|
|
|
|
router.GET(options.BaseURL+"/submissions/:submissionId", wrapper.GetSubmission)
|
|
|
|
|
|
router.GET(options.BaseURL+"/submissions/:submissionId/offline-pdf", wrapper.GetSubmissionOfflinePdf)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ErrorJSONResponse Error
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
type GetAuthConfigRequestObject struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetAuthConfigResponseObject interface {
|
|
|
|
|
|
VisitGetAuthConfigResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetAuthConfig200JSONResponse AuthConfig
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetAuthConfig200JSONResponse) VisitGetAuthConfigResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type LoginRequestObject struct {
|
|
|
|
|
|
Body *LoginJSONRequestBody
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type LoginResponseObject interface {
|
|
|
|
|
|
VisitLoginResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Login200JSONResponse LoginResponse
|
|
|
|
|
|
|
|
|
|
|
|
func (response Login200JSONResponse) VisitLoginResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Login400JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response Login400JSONResponse) VisitLoginResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(400)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Login401JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response Login401JSONResponse) VisitLoginResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(401)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type LogoutRequestObject struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type LogoutResponseObject interface {
|
|
|
|
|
|
VisitLogoutResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Logout204Response struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (response Logout204Response) VisitLogoutResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.WriteHeader(204)
|
|
|
|
|
|
return nil
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetCurrentUserRequestObject struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetCurrentUserResponseObject interface {
|
|
|
|
|
|
VisitGetCurrentUserResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetCurrentUser200JSONResponse AuthMeResponse
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetCurrentUser200JSONResponse) VisitGetCurrentUserResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetCurrentUser401JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetCurrentUser401JSONResponse) VisitGetCurrentUserResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(401)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
type ListFormsRequestObject struct {
|
|
|
|
|
|
Params ListFormsParams
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormsResponseObject interface {
|
|
|
|
|
|
VisitListFormsResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListForms200JSONResponse []FormSummary
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListForms200JSONResponse) VisitListFormsResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListForms500JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListForms500JSONResponse) VisitListFormsResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormRequestObject struct {
|
|
|
|
|
|
Body *CreateFormJSONRequestBody
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormResponseObject interface {
|
|
|
|
|
|
VisitCreateFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateForm201JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateForm201JSONResponse) VisitCreateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(201)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateForm400JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateForm400JSONResponse) VisitCreateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(400)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateForm500JSONResponse) VisitCreateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type DeleteFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type DeleteFormResponseObject interface {
|
|
|
|
|
|
VisitDeleteFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type DeleteForm204Response struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (response DeleteForm204Response) VisitDeleteFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.WriteHeader(204)
|
|
|
|
|
|
return nil
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type DeleteForm404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response DeleteForm404JSONResponse) VisitDeleteFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type DeleteForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response DeleteForm500JSONResponse) VisitDeleteFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormResponseObject interface {
|
|
|
|
|
|
VisitGetFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetForm200JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetForm200JSONResponse) VisitGetFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetForm404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetForm404JSONResponse) VisitGetFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetForm500JSONResponse) VisitGetFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
Body *UpdateFormJSONRequestBody
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateFormResponseObject interface {
|
|
|
|
|
|
VisitUpdateFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateForm200JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response UpdateForm200JSONResponse) VisitUpdateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateForm400JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response UpdateForm400JSONResponse) VisitUpdateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(400)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateForm404JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response UpdateForm404JSONResponse) VisitUpdateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response UpdateForm500JSONResponse) VisitUpdateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAccessCodesRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAccessCodesResponseObject interface {
|
|
|
|
|
|
VisitListAccessCodesResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAccessCodes200JSONResponse []AccessCode
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListAccessCodes200JSONResponse) VisitListAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAccessCodes404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListAccessCodes404JSONResponse) VisitListAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAccessCodes500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListAccessCodes500JSONResponse) VisitListAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodesRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
Body *CreateAccessCodesJSONRequestBody
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodesResponseObject interface {
|
|
|
|
|
|
VisitCreateAccessCodesResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodes201JSONResponse []AccessCode
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateAccessCodes201JSONResponse) VisitCreateAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(201)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodes400JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateAccessCodes400JSONResponse) VisitCreateAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(400)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodes404JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateAccessCodes404JSONResponse) VisitCreateAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateAccessCodes500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateAccessCodes500JSONResponse) VisitCreateAccessCodesResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ActivateFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ActivateFormResponseObject interface {
|
|
|
|
|
|
VisitActivateFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ActivateForm200JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response ActivateForm200JSONResponse) VisitActivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ActivateForm404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response ActivateForm404JSONResponse) VisitActivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ActivateForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response ActivateForm500JSONResponse) VisitActivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type InactivateFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type InactivateFormResponseObject interface {
|
|
|
|
|
|
VisitInactivateFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type InactivateForm200JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response InactivateForm200JSONResponse) VisitInactivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type InactivateForm404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response InactivateForm404JSONResponse) VisitInactivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type InactivateForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response InactivateForm500JSONResponse) VisitInactivateFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormPdfRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormPdfResponseObject interface {
|
|
|
|
|
|
VisitGetFormPdfResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormPdf200ApplicationpdfResponse struct {
|
|
|
|
|
|
Body io.Reader
|
|
|
|
|
|
ContentLength int64
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetFormPdf200ApplicationpdfResponse) VisitGetFormPdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/pdf")
|
|
|
|
|
|
if response.ContentLength != 0 {
|
|
|
|
|
|
w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength))
|
|
|
|
|
|
}
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
if closer, ok := response.Body.(io.ReadCloser); ok {
|
|
|
|
|
|
defer closer.Close()
|
|
|
|
|
|
}
|
|
|
|
|
|
_, err := io.Copy(w, response.Body)
|
|
|
|
|
|
return err
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormPdf404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetFormPdf404JSONResponse) VisitGetFormPdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetFormPdf500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetFormPdf500JSONResponse) VisitGetFormPdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormSubmissionsRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormSubmissionsResponseObject interface {
|
|
|
|
|
|
VisitListFormSubmissionsResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormSubmissions200JSONResponse []SubmissionSummary
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListFormSubmissions200JSONResponse) VisitListFormSubmissionsResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormSubmissions404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListFormSubmissions404JSONResponse) VisitListFormSubmissionsResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListFormSubmissions500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response ListFormSubmissions500JSONResponse) VisitListFormSubmissionsResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitFormRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
Body *SubmitFormJSONRequestBody
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitFormResponseObject interface {
|
|
|
|
|
|
VisitSubmitFormResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm201JSONResponse Submission
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm201JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(201)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm400JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm400JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(400)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm404JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm404JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm409JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm409JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(409)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm410JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm410JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(410)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SubmitForm500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response SubmitForm500JSONResponse) VisitSubmitFormResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormVersionRequestObject struct {
|
|
|
|
|
|
FormId FormId `json:"formId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormVersionResponseObject interface {
|
|
|
|
|
|
VisitCreateFormVersionResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormVersion201JSONResponse Form
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateFormVersion201JSONResponse) VisitCreateFormVersionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(201)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormVersion404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateFormVersion404JSONResponse) VisitCreateFormVersionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type CreateFormVersion500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response CreateFormVersion500JSONResponse) VisitCreateFormVersionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetHealthRequestObject struct {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetHealthResponseObject interface {
|
|
|
|
|
|
VisitGetHealthResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetHealth200JSONResponse Health
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetHealth200JSONResponse) VisitGetHealthResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionRequestObject struct {
|
|
|
|
|
|
SubmissionId openapi_types.UUID `json:"submissionId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionResponseObject interface {
|
|
|
|
|
|
VisitGetSubmissionResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmission200JSONResponse Submission
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmission200JSONResponse) VisitGetSubmissionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmission404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmission404JSONResponse) VisitGetSubmissionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmission500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmission500JSONResponse) VisitGetSubmissionResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionOfflinePdfRequestObject struct {
|
|
|
|
|
|
SubmissionId openapi_types.UUID `json:"submissionId"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionOfflinePdfResponseObject interface {
|
|
|
|
|
|
VisitGetSubmissionOfflinePdfResponse(w http.ResponseWriter) error
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionOfflinePdf200ApplicationpdfResponse struct {
|
|
|
|
|
|
Body io.Reader
|
|
|
|
|
|
ContentLength int64
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmissionOfflinePdf200ApplicationpdfResponse) VisitGetSubmissionOfflinePdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/pdf")
|
|
|
|
|
|
if response.ContentLength != 0 {
|
|
|
|
|
|
w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength))
|
|
|
|
|
|
}
|
|
|
|
|
|
w.WriteHeader(200)
|
|
|
|
|
|
|
|
|
|
|
|
if closer, ok := response.Body.(io.ReadCloser); ok {
|
|
|
|
|
|
defer closer.Close()
|
|
|
|
|
|
}
|
|
|
|
|
|
_, err := io.Copy(w, response.Body)
|
|
|
|
|
|
return err
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionOfflinePdf404JSONResponse struct{ ErrorJSONResponse }
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmissionOfflinePdf404JSONResponse) VisitGetSubmissionOfflinePdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(404)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetSubmissionOfflinePdf500JSONResponse Error
|
|
|
|
|
|
|
|
|
|
|
|
func (response GetSubmissionOfflinePdf500JSONResponse) VisitGetSubmissionOfflinePdfResponse(w http.ResponseWriter) error {
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
|
|
w.WriteHeader(500)
|
|
|
|
|
|
|
|
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// StrictServerInterface represents all server handlers.
|
|
|
|
|
|
type StrictServerInterface interface {
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// Get browser authentication configuration
|
|
|
|
|
|
// (GET /auth/config)
|
|
|
|
|
|
GetAuthConfig(ctx context.Context, request GetAuthConfigRequestObject) (GetAuthConfigResponseObject, error)
|
|
|
|
|
|
// Log in with the local password fallback
|
|
|
|
|
|
// (POST /auth/login)
|
|
|
|
|
|
Login(ctx context.Context, request LoginRequestObject) (LoginResponseObject, error)
|
|
|
|
|
|
// Log out
|
|
|
|
|
|
// (POST /auth/logout)
|
|
|
|
|
|
Logout(ctx context.Context, request LogoutRequestObject) (LogoutResponseObject, error)
|
|
|
|
|
|
// Get the current authenticated user
|
|
|
|
|
|
// (GET /auth/me)
|
|
|
|
|
|
GetCurrentUser(ctx context.Context, request GetCurrentUserRequestObject) (GetCurrentUserResponseObject, error)
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// List forms
|
|
|
|
|
|
// (GET /forms)
|
|
|
|
|
|
ListForms(ctx context.Context, request ListFormsRequestObject) (ListFormsResponseObject, error)
|
|
|
|
|
|
// Create a form
|
|
|
|
|
|
// (POST /forms)
|
|
|
|
|
|
CreateForm(ctx context.Context, request CreateFormRequestObject) (CreateFormResponseObject, error)
|
|
|
|
|
|
// Delete a form definition
|
|
|
|
|
|
// (DELETE /forms/{formId})
|
|
|
|
|
|
DeleteForm(ctx context.Context, request DeleteFormRequestObject) (DeleteFormResponseObject, error)
|
|
|
|
|
|
// Get a form by id
|
|
|
|
|
|
// (GET /forms/{formId})
|
|
|
|
|
|
GetForm(ctx context.Context, request GetFormRequestObject) (GetFormResponseObject, error)
|
|
|
|
|
|
// Update a form definition
|
|
|
|
|
|
// (PUT /forms/{formId})
|
|
|
|
|
|
UpdateForm(ctx context.Context, request UpdateFormRequestObject) (UpdateFormResponseObject, error)
|
|
|
|
|
|
// List access codes for a form
|
|
|
|
|
|
// (GET /forms/{formId}/access-codes)
|
|
|
|
|
|
ListAccessCodes(ctx context.Context, request ListAccessCodesRequestObject) (ListAccessCodesResponseObject, error)
|
|
|
|
|
|
// Create one or more access codes for a form
|
|
|
|
|
|
// (POST /forms/{formId}/access-codes)
|
|
|
|
|
|
CreateAccessCodes(ctx context.Context, request CreateAccessCodesRequestObject) (CreateAccessCodesResponseObject, error)
|
|
|
|
|
|
// Activate a form
|
|
|
|
|
|
// (POST /forms/{formId}/activate)
|
|
|
|
|
|
ActivateForm(ctx context.Context, request ActivateFormRequestObject) (ActivateFormResponseObject, error)
|
|
|
|
|
|
// Inactivate a form
|
|
|
|
|
|
// (POST /forms/{formId}/inactivate)
|
|
|
|
|
|
InactivateForm(ctx context.Context, request InactivateFormRequestObject) (InactivateFormResponseObject, error)
|
|
|
|
|
|
// Download a PDF rendering of the form definition
|
|
|
|
|
|
// (GET /forms/{formId}/pdf)
|
|
|
|
|
|
GetFormPdf(ctx context.Context, request GetFormPdfRequestObject) (GetFormPdfResponseObject, error)
|
|
|
|
|
|
// List submissions for a form (management)
|
|
|
|
|
|
// (GET /forms/{formId}/submissions)
|
|
|
|
|
|
ListFormSubmissions(ctx context.Context, request ListFormSubmissionsRequestObject) (ListFormSubmissionsResponseObject, error)
|
|
|
|
|
|
// Submit an answer set for a form
|
|
|
|
|
|
// (POST /forms/{formId}/submissions)
|
|
|
|
|
|
SubmitForm(ctx context.Context, request SubmitFormRequestObject) (SubmitFormResponseObject, error)
|
|
|
|
|
|
// Create a new version of a form
|
|
|
|
|
|
// (POST /forms/{formId}/versions)
|
|
|
|
|
|
CreateFormVersion(ctx context.Context, request CreateFormVersionRequestObject) (CreateFormVersionResponseObject, error)
|
|
|
|
|
|
// Service health
|
|
|
|
|
|
// (GET /health)
|
|
|
|
|
|
GetHealth(ctx context.Context, request GetHealthRequestObject) (GetHealthResponseObject, error)
|
|
|
|
|
|
// Get a submission by id (management)
|
|
|
|
|
|
// (GET /submissions/{submissionId})
|
|
|
|
|
|
GetSubmission(ctx context.Context, request GetSubmissionRequestObject) (GetSubmissionResponseObject, error)
|
|
|
|
|
|
// Download the offline PDF uploaded with a submission
|
|
|
|
|
|
// (GET /submissions/{submissionId}/offline-pdf)
|
|
|
|
|
|
GetSubmissionOfflinePdf(ctx context.Context, request GetSubmissionOfflinePdfRequestObject) (GetSubmissionOfflinePdfResponseObject, error)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type StrictHandlerFunc = strictgin.StrictGinHandlerFunc
|
|
|
|
|
|
type StrictMiddlewareFunc = strictgin.StrictGinMiddlewareFunc
|
|
|
|
|
|
|
|
|
|
|
|
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface {
|
|
|
|
|
|
return &strictHandler{ssi: ssi, middlewares: middlewares}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type strictHandler struct {
|
|
|
|
|
|
ssi StrictServerInterface
|
|
|
|
|
|
middlewares []StrictMiddlewareFunc
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 19:36:02 +00:00
|
|
|
|
// GetAuthConfig operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetAuthConfig(ctx *gin.Context) {
|
|
|
|
|
|
var request GetAuthConfigRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetAuthConfig(ctx, request.(GetAuthConfigRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetAuthConfig")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetAuthConfigResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetAuthConfigResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Login operation middleware
|
|
|
|
|
|
func (sh *strictHandler) Login(ctx *gin.Context) {
|
|
|
|
|
|
var request LoginRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
var body LoginJSONRequestBody
|
|
|
|
|
|
if err := ctx.ShouldBindJSON(&body); err != nil {
|
|
|
|
|
|
ctx.Status(http.StatusBadRequest)
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
request.Body = &body
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.Login(ctx, request.(LoginRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "Login")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(LoginResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitLoginResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Logout operation middleware
|
|
|
|
|
|
func (sh *strictHandler) Logout(ctx *gin.Context) {
|
|
|
|
|
|
var request LogoutRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.Logout(ctx, request.(LogoutRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "Logout")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(LogoutResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitLogoutResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetCurrentUser operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetCurrentUser(ctx *gin.Context) {
|
|
|
|
|
|
var request GetCurrentUserRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetCurrentUser(ctx, request.(GetCurrentUserRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetCurrentUser")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetCurrentUserResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetCurrentUserResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-23 12:24:54 +00:00
|
|
|
|
// ListForms operation middleware
|
|
|
|
|
|
func (sh *strictHandler) ListForms(ctx *gin.Context, params ListFormsParams) {
|
|
|
|
|
|
var request ListFormsRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.Params = params
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.ListForms(ctx, request.(ListFormsRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "ListForms")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(ListFormsResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitListFormsResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) CreateForm(ctx *gin.Context) {
|
|
|
|
|
|
var request CreateFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
var body CreateFormJSONRequestBody
|
|
|
|
|
|
if err := ctx.ShouldBindJSON(&body); err != nil {
|
|
|
|
|
|
ctx.Status(http.StatusBadRequest)
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
request.Body = &body
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.CreateForm(ctx, request.(CreateFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "CreateForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(CreateFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitCreateFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) DeleteForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request DeleteFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.DeleteForm(ctx, request.(DeleteFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "DeleteForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(DeleteFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitDeleteFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request GetFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetForm(ctx, request.(GetFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) UpdateForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request UpdateFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
var body UpdateFormJSONRequestBody
|
|
|
|
|
|
if err := ctx.ShouldBindJSON(&body); err != nil {
|
|
|
|
|
|
ctx.Status(http.StatusBadRequest)
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
request.Body = &body
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.UpdateForm(ctx, request.(UpdateFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "UpdateForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(UpdateFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitUpdateFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ListAccessCodes operation middleware
|
|
|
|
|
|
func (sh *strictHandler) ListAccessCodes(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request ListAccessCodesRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.ListAccessCodes(ctx, request.(ListAccessCodesRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "ListAccessCodes")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(ListAccessCodesResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitListAccessCodesResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateAccessCodes operation middleware
|
|
|
|
|
|
func (sh *strictHandler) CreateAccessCodes(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request CreateAccessCodesRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
var body CreateAccessCodesJSONRequestBody
|
|
|
|
|
|
if err := ctx.ShouldBindJSON(&body); err != nil {
|
|
|
|
|
|
ctx.Status(http.StatusBadRequest)
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
request.Body = &body
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.CreateAccessCodes(ctx, request.(CreateAccessCodesRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "CreateAccessCodes")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(CreateAccessCodesResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitCreateAccessCodesResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ActivateForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) ActivateForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request ActivateFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.ActivateForm(ctx, request.(ActivateFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "ActivateForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(ActivateFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitActivateFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// InactivateForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) InactivateForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request InactivateFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.InactivateForm(ctx, request.(InactivateFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "InactivateForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(InactivateFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitInactivateFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetFormPdf operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetFormPdf(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request GetFormPdfRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetFormPdf(ctx, request.(GetFormPdfRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetFormPdf")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetFormPdfResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetFormPdfResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ListFormSubmissions operation middleware
|
|
|
|
|
|
func (sh *strictHandler) ListFormSubmissions(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request ListFormSubmissionsRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.ListFormSubmissions(ctx, request.(ListFormSubmissionsRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "ListFormSubmissions")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(ListFormSubmissionsResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitListFormSubmissionsResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitForm operation middleware
|
|
|
|
|
|
func (sh *strictHandler) SubmitForm(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request SubmitFormRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
var body SubmitFormJSONRequestBody
|
|
|
|
|
|
if err := ctx.ShouldBindJSON(&body); err != nil {
|
|
|
|
|
|
ctx.Status(http.StatusBadRequest)
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
request.Body = &body
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.SubmitForm(ctx, request.(SubmitFormRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "SubmitForm")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(SubmitFormResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitSubmitFormResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateFormVersion operation middleware
|
|
|
|
|
|
func (sh *strictHandler) CreateFormVersion(ctx *gin.Context, formId FormId) {
|
|
|
|
|
|
var request CreateFormVersionRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.FormId = formId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.CreateFormVersion(ctx, request.(CreateFormVersionRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "CreateFormVersion")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(CreateFormVersionResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitCreateFormVersionResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetHealth operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetHealth(ctx *gin.Context) {
|
|
|
|
|
|
var request GetHealthRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetHealth(ctx, request.(GetHealthRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetHealth")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetHealthResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetHealthResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSubmission operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetSubmission(ctx *gin.Context, submissionId openapi_types.UUID) {
|
|
|
|
|
|
var request GetSubmissionRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.SubmissionId = submissionId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetSubmission(ctx, request.(GetSubmissionRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetSubmission")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetSubmissionResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetSubmissionResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSubmissionOfflinePdf operation middleware
|
|
|
|
|
|
func (sh *strictHandler) GetSubmissionOfflinePdf(ctx *gin.Context, submissionId openapi_types.UUID) {
|
|
|
|
|
|
var request GetSubmissionOfflinePdfRequestObject
|
|
|
|
|
|
|
|
|
|
|
|
request.SubmissionId = submissionId
|
|
|
|
|
|
|
|
|
|
|
|
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
|
|
|
|
|
return sh.ssi.GetSubmissionOfflinePdf(ctx, request.(GetSubmissionOfflinePdfRequestObject))
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, middleware := range sh.middlewares {
|
|
|
|
|
|
handler = middleware(handler, "GetSubmissionOfflinePdf")
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
response, err := handler(ctx, request)
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
ctx.Status(http.StatusInternalServerError)
|
|
|
|
|
|
} else if validResponse, ok := response.(GetSubmissionOfflinePdfResponseObject); ok {
|
|
|
|
|
|
if err := validResponse.VisitGetSubmissionOfflinePdfResponse(ctx.Writer); err != nil {
|
|
|
|
|
|
ctx.Error(err)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if response != nil {
|
|
|
|
|
|
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Base64 encoded, gzipped, json marshaled Swagger object
|
|
|
|
|
|
var swaggerSpec = []string{
|
|
|
|
|
|
|
2026-10-25 10:53:17 +00:00
|
|
|
|
"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",
|
|
|
|
|
|
"AAA=",
|
2026-10-23 12:24:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSwagger returns the content of the embedded swagger specification file
|
|
|
|
|
|
// or error if failed to decode
|
|
|
|
|
|
func decodeSpec() ([]byte, error) {
|
|
|
|
|
|
zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return nil, fmt.Errorf("error base64 decoding spec: %w", err)
|
|
|
|
|
|
}
|
|
|
|
|
|
zr, err := gzip.NewReader(bytes.NewReader(zipped))
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return nil, fmt.Errorf("error decompressing spec: %w", err)
|
|
|
|
|
|
}
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
|
_, err = buf.ReadFrom(zr)
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return nil, fmt.Errorf("error decompressing spec: %w", err)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return buf.Bytes(), nil
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var rawSpec = decodeSpecCached()
|
|
|
|
|
|
|
|
|
|
|
|
// a naive cached of a decoded swagger spec
|
|
|
|
|
|
func decodeSpecCached() func() ([]byte, error) {
|
|
|
|
|
|
data, err := decodeSpec()
|
|
|
|
|
|
return func() ([]byte, error) {
|
|
|
|
|
|
return data, err
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
|
|
|
|
|
|
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
|
|
|
|
|
|
res := make(map[string]func() ([]byte, error))
|
|
|
|
|
|
if len(pathToFile) > 0 {
|
|
|
|
|
|
res[pathToFile] = rawSpec
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return res
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetSwagger returns the Swagger specification corresponding to the generated code
|
|
|
|
|
|
// in this file. The external references of Swagger specification are resolved.
|
|
|
|
|
|
// The logic of resolving external references is tightly connected to "import-mapping" feature.
|
|
|
|
|
|
// Externally referenced files must be embedded in the corresponding golang packages.
|
|
|
|
|
|
// Urls can be supported but this task was out of the scope.
|
|
|
|
|
|
func GetSwagger() (swagger *openapi3.T, err error) {
|
|
|
|
|
|
resolvePath := PathToRawSpec("")
|
|
|
|
|
|
|
|
|
|
|
|
loader := openapi3.NewLoader()
|
|
|
|
|
|
loader.IsExternalRefsAllowed = true
|
|
|
|
|
|
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
|
|
|
|
|
|
pathToFile := url.String()
|
|
|
|
|
|
pathToFile = path.Clean(pathToFile)
|
|
|
|
|
|
getSpec, ok := resolvePath[pathToFile]
|
|
|
|
|
|
if !ok {
|
|
|
|
|
|
err1 := fmt.Errorf("path not found: %s", pathToFile)
|
|
|
|
|
|
return nil, err1
|
|
|
|
|
|
}
|
|
|
|
|
|
return getSpec()
|
|
|
|
|
|
}
|
|
|
|
|
|
var specData []byte
|
|
|
|
|
|
specData, err = rawSpec()
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
swagger, err = loader.LoadFromData(specData)
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|