2025-03-17 18:14:15 +00:00
|
|
|
// Package queryapi provides primitives to interact with the openapi HTTP API.
|
2025-01-15 19:45:51 +00:00
|
|
|
//
|
|
|
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version 2.4.1 DO NOT EDIT.
|
2025-03-17 18:14:15 +00:00
|
|
|
package queryapi
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"bytes"
|
|
|
|
|
"compress/gzip"
|
|
|
|
|
"encoding/base64"
|
|
|
|
|
"fmt"
|
|
|
|
|
"net/http"
|
|
|
|
|
"net/url"
|
|
|
|
|
"path"
|
|
|
|
|
"strings"
|
2025-03-12 00:59:58 +00:00
|
|
|
"time"
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
|
|
|
"github.com/labstack/echo/v4"
|
2025-08-05 07:03:35 -07:00
|
|
|
"github.com/oapi-codegen/nullable"
|
2025-01-15 19:45:51 +00:00
|
|
|
"github.com/oapi-codegen/runtime"
|
2025-01-24 14:52:56 +00:00
|
|
|
openapi_types "github.com/oapi-codegen/runtime/types"
|
2025-01-15 19:45:51 +00:00
|
|
|
)
|
|
|
|
|
|
2025-03-12 00:59:58 +00:00
|
|
|
const (
|
2025-04-21 15:12:38 -07:00
|
|
|
CognitoAuthScopes = "cognitoAuth.Scopes"
|
|
|
|
|
JwtAuthScopes = "jwtAuth.Scopes"
|
2025-03-12 00:59:58 +00:00
|
|
|
)
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// Defines values for BatchStatus.
|
|
|
|
|
const (
|
|
|
|
|
BatchStatusCancelled BatchStatus = "cancelled"
|
|
|
|
|
BatchStatusCompleted BatchStatus = "completed"
|
|
|
|
|
BatchStatusFailed BatchStatus = "failed"
|
|
|
|
|
BatchStatusProcessing BatchStatus = "processing"
|
|
|
|
|
)
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// Defines values for ClientStatus.
|
|
|
|
|
const (
|
|
|
|
|
INSYNC ClientStatus = "IN_SYNC"
|
|
|
|
|
NOTSYNCED ClientStatus = "NOT_SYNCED"
|
|
|
|
|
NOTSYNCING ClientStatus = "NOT_SYNCING"
|
|
|
|
|
)
|
|
|
|
|
|
2025-01-16 13:49:07 +00:00
|
|
|
// Defines values for ExportStatus.
|
|
|
|
|
const (
|
2025-08-05 07:03:35 -07:00
|
|
|
ExportStatusCompleted ExportStatus = "completed"
|
|
|
|
|
ExportStatusFailed ExportStatus = "failed"
|
|
|
|
|
ExportStatusInProgress ExportStatus = "in_progress"
|
2025-01-16 13:49:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Defines values for FieldFilterCondition.
|
|
|
|
|
const (
|
|
|
|
|
ClosedInterval FieldFilterCondition = "closed_interval"
|
|
|
|
|
Exclude FieldFilterCondition = "exclude"
|
|
|
|
|
GreaterThan FieldFilterCondition = "greater_than"
|
|
|
|
|
Include FieldFilterCondition = "include"
|
|
|
|
|
LeftClosedInterval FieldFilterCondition = "left_closed_interval"
|
|
|
|
|
LessThan FieldFilterCondition = "less_than"
|
|
|
|
|
OpenInterval FieldFilterCondition = "open_interval"
|
|
|
|
|
RightClosedInterval FieldFilterCondition = "right_closed_interval"
|
|
|
|
|
)
|
|
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Defines values for QueryType.
|
|
|
|
|
const (
|
|
|
|
|
CONTEXTFULL QueryType = "CONTEXT_FULL"
|
|
|
|
|
JSONEXTRACTOR QueryType = "JSON_EXTRACTOR"
|
|
|
|
|
)
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// BatchID The batch upload id.
|
|
|
|
|
type BatchID = openapi_types.UUID
|
|
|
|
|
|
|
|
|
|
// BatchStatus The status of a batch upload
|
|
|
|
|
type BatchStatus string
|
|
|
|
|
|
|
|
|
|
// BatchUploadDetails defines model for BatchUploadDetails.
|
|
|
|
|
type BatchUploadDetails struct {
|
|
|
|
|
// BatchId The batch upload id.
|
|
|
|
|
BatchId BatchID `json:"batch_id"`
|
|
|
|
|
|
|
|
|
|
// ClientId The client external id
|
|
|
|
|
ClientId ClientID `json:"client_id"`
|
|
|
|
|
|
|
|
|
|
// CompletedAt When the batch upload completed processing
|
|
|
|
|
CompletedAt nullable.Nullable[time.Time] `json:"completed_at,omitempty"`
|
|
|
|
|
|
|
|
|
|
// CreatedAt When the batch upload was created
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
|
|
|
|
|
// FailedDocuments Number of documents that failed processing
|
|
|
|
|
FailedDocuments int32 `json:"failed_documents"`
|
|
|
|
|
|
|
|
|
|
// FailedFilenames List of filenames that failed processing
|
|
|
|
|
FailedFilenames *[]string `json:"failed_filenames,omitempty"`
|
|
|
|
|
|
|
|
|
|
// InvalidTypeDocuments Number of non-PDF files found in archive
|
|
|
|
|
InvalidTypeDocuments int32 `json:"invalid_type_documents"`
|
|
|
|
|
|
|
|
|
|
// OriginalFilename Original filename of the uploaded ZIP archive
|
|
|
|
|
OriginalFilename string `json:"original_filename"`
|
|
|
|
|
|
|
|
|
|
// ProcessedDocuments Number of documents processed so far
|
|
|
|
|
ProcessedDocuments int32 `json:"processed_documents"`
|
|
|
|
|
|
|
|
|
|
// ProgressPercent Processing progress percentage
|
|
|
|
|
ProgressPercent int32 `json:"progress_percent"`
|
|
|
|
|
|
|
|
|
|
// Status The status of a batch upload
|
|
|
|
|
Status BatchStatus `json:"status"`
|
|
|
|
|
|
|
|
|
|
// TotalDocuments Total number of documents in the batch
|
|
|
|
|
TotalDocuments int32 `json:"total_documents"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BatchUploadList List of batch uploads for a client
|
|
|
|
|
type BatchUploadList struct {
|
|
|
|
|
Batches []BatchUploadSummary `json:"batches"`
|
|
|
|
|
|
|
|
|
|
// TotalCount Total number of batches for this client
|
|
|
|
|
TotalCount int32 `json:"total_count"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BatchUploadResponse Response returned when a batch upload is accepted for processing
|
|
|
|
|
type BatchUploadResponse struct {
|
|
|
|
|
// BatchId The batch upload id.
|
|
|
|
|
BatchId BatchID `json:"batch_id"`
|
|
|
|
|
|
|
|
|
|
// Status The status of a batch upload
|
|
|
|
|
Status BatchStatus `json:"status"`
|
|
|
|
|
|
|
|
|
|
// StatusUrl URL to check batch status
|
|
|
|
|
StatusUrl string `json:"status_url"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BatchUploadSummary Summary information about a batch upload
|
|
|
|
|
type BatchUploadSummary struct {
|
|
|
|
|
// BatchId The batch upload id.
|
|
|
|
|
BatchId BatchID `json:"batch_id"`
|
|
|
|
|
|
|
|
|
|
// ClientId The client external id
|
|
|
|
|
ClientId ClientID `json:"client_id"`
|
|
|
|
|
|
|
|
|
|
// CompletedAt When the batch upload completed processing
|
|
|
|
|
CompletedAt nullable.Nullable[time.Time] `json:"completed_at,omitempty"`
|
|
|
|
|
|
|
|
|
|
// CreatedAt When the batch upload was created
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
|
|
|
|
|
// FailedDocuments Number of documents that failed processing
|
|
|
|
|
FailedDocuments int32 `json:"failed_documents"`
|
|
|
|
|
|
|
|
|
|
// InvalidTypeDocuments Number of non-PDF files found in archive
|
|
|
|
|
InvalidTypeDocuments int32 `json:"invalid_type_documents"`
|
|
|
|
|
|
|
|
|
|
// OriginalFilename Original filename of the uploaded ZIP archive
|
|
|
|
|
OriginalFilename string `json:"original_filename"`
|
|
|
|
|
|
|
|
|
|
// ProcessedDocuments Number of documents processed so far
|
|
|
|
|
ProcessedDocuments int32 `json:"processed_documents"`
|
|
|
|
|
|
|
|
|
|
// ProgressPercent Processing progress percentage
|
|
|
|
|
ProgressPercent int32 `json:"progress_percent"`
|
|
|
|
|
|
|
|
|
|
// Status The status of a batch upload
|
|
|
|
|
Status BatchStatus `json:"status"`
|
|
|
|
|
|
|
|
|
|
// TotalDocuments Total number of documents in the batch
|
|
|
|
|
TotalDocuments int32 `json:"total_documents"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientCanSync If the client is allowing active syncs
|
|
|
|
|
type ClientCanSync = bool
|
|
|
|
|
|
|
|
|
|
// ClientCreate The properties for creation.
|
2025-01-21 18:24:14 +00:00
|
|
|
type ClientCreate struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// Id The client external id
|
|
|
|
|
Id ClientID `json:"id"`
|
|
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// Name The client name
|
2025-03-11 16:31:06 +00:00
|
|
|
Name ClientName `json:"name"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ClientID The client external id
|
|
|
|
|
type ClientID = string
|
|
|
|
|
|
|
|
|
|
// ClientIDBody The client id.
|
|
|
|
|
type ClientIDBody struct {
|
|
|
|
|
// Id The client external id
|
|
|
|
|
Id ClientID `json:"id"`
|
2025-01-21 18:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientName The client name
|
|
|
|
|
type ClientName = string
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// ClientStatus Specifies the status of a client.
|
|
|
|
|
type ClientStatus string
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientStatusBody A client status information object.
|
2025-03-10 11:03:00 +00:00
|
|
|
type ClientStatusBody struct {
|
|
|
|
|
// Status Specifies the status of a client.
|
|
|
|
|
Status ClientStatus `json:"status"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientUpdate The properties that may be updated.
|
2025-01-21 18:24:14 +00:00
|
|
|
type ClientUpdate struct {
|
|
|
|
|
// CanSync If the client is allowing active syncs
|
2025-03-11 16:31:06 +00:00
|
|
|
CanSync *ClientCanSync `json:"can_sync,omitempty"`
|
2025-01-21 18:24:14 +00:00
|
|
|
|
|
|
|
|
// Name The client name
|
2025-03-11 16:31:06 +00:00
|
|
|
Name *ClientName `json:"name,omitempty"`
|
2025-01-21 18:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// CodeVersion The desired code version.
|
2025-03-11 18:15:49 +00:00
|
|
|
type CodeVersion = int64
|
2025-03-11 16:31:06 +00:00
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// Collector Collector model.
|
|
|
|
|
type Collector struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// ActiveVersion The desired version.
|
|
|
|
|
ActiveVersion Version `json:"active_version"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientId The client external id
|
|
|
|
|
ClientId ClientID `json:"client_id"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
|
|
|
|
// Fields The fields in the collector.
|
2025-03-11 16:31:06 +00:00
|
|
|
Fields CollectorFields `json:"fields"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// LatestVersion The desired version.
|
|
|
|
|
LatestVersion Version `json:"latest_version"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// MinimumCleanerVersion The desired code version.
|
|
|
|
|
MinimumCleanerVersion CodeVersion `json:"minimum_cleaner_version"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// MinimumTextVersion The desired code version.
|
|
|
|
|
MinimumTextVersion CodeVersion `json:"minimum_text_version"`
|
2025-03-10 11:03:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CollectorField The field properties for the collector.
|
|
|
|
|
type CollectorField struct {
|
|
|
|
|
// Name The output field name.
|
2025-03-11 16:31:06 +00:00
|
|
|
Name CollectorFieldName `json:"name"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryId The query id.
|
|
|
|
|
QueryId QueryID `json:"query_id"`
|
2025-03-10 11:03:00 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// CollectorFieldName The output field name.
|
|
|
|
|
type CollectorFieldName = string
|
|
|
|
|
|
|
|
|
|
// CollectorFields The fields in the collector.
|
|
|
|
|
type CollectorFields = []CollectorField
|
|
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
// CollectorSet Payload for updating a Collector.
|
|
|
|
|
type CollectorSet struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// ActiveVersion The desired version.
|
|
|
|
|
ActiveVersion *Version `json:"active_version,omitempty"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
|
|
|
|
// Fields The fields in the collector.
|
2025-03-11 16:31:06 +00:00
|
|
|
Fields *CollectorFields `json:"fields,omitempty"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// MinimumCleanerVersion The desired code version.
|
|
|
|
|
MinimumCleanerVersion *CodeVersion `json:"minimum_cleaner_version,omitempty"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// MinimumTextVersion The desired code version.
|
|
|
|
|
MinimumTextVersion *CodeVersion `json:"minimum_text_version,omitempty"`
|
2025-03-10 11:03:00 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// DocClient The properties of a client.
|
2025-03-10 11:03:00 +00:00
|
|
|
type DocClient struct {
|
|
|
|
|
// CanSync If the client is allowing active syncs
|
2025-03-11 16:31:06 +00:00
|
|
|
CanSync ClientCanSync `json:"can_sync"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Id The client external id
|
|
|
|
|
Id ClientID `json:"id"`
|
2025-03-10 11:03:00 +00:00
|
|
|
|
|
|
|
|
// Name The client name
|
2025-03-11 16:31:06 +00:00
|
|
|
Name ClientName `json:"name"`
|
2025-03-10 11:03:00 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Document The document properties.
|
2025-02-21 17:05:37 +00:00
|
|
|
type Document struct {
|
2025-03-17 18:14:15 +00:00
|
|
|
// ClientId The client external id
|
|
|
|
|
ClientId ClientID `json:"client_id"`
|
|
|
|
|
|
|
|
|
|
// Fields The fields and the value for the document
|
|
|
|
|
Fields map[string]interface{} `json:"fields"`
|
|
|
|
|
|
|
|
|
|
// Hash The document hash
|
|
|
|
|
Hash Hash `json:"hash"`
|
2025-02-21 17:05:37 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Id The document id.
|
|
|
|
|
Id DocumentID `json:"id"`
|
2025-02-21 17:05:37 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// DocumentID The document id.
|
|
|
|
|
type DocumentID = openapi_types.UUID
|
|
|
|
|
|
2025-03-18 13:06:42 +00:00
|
|
|
// DocumentSummary The document summary properties.
|
2025-03-17 18:14:15 +00:00
|
|
|
type DocumentSummary struct {
|
|
|
|
|
// Hash The document hash
|
|
|
|
|
Hash Hash `json:"hash"`
|
|
|
|
|
|
|
|
|
|
// Id The document id.
|
|
|
|
|
Id DocumentID `json:"id"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-18 13:06:42 +00:00
|
|
|
// ErrorMessage Description of error
|
|
|
|
|
type ErrorMessage struct {
|
|
|
|
|
// Message Message describing the cause.
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-16 13:49:07 +00:00
|
|
|
// ExportDetails Payload for export trigger response.
|
|
|
|
|
type ExportDetails struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// ClientId The client external id
|
|
|
|
|
ClientId ClientID `json:"client_id"`
|
2025-01-16 13:49:07 +00:00
|
|
|
|
|
|
|
|
// OutputLocation The location in which the export zip file will be found.
|
|
|
|
|
OutputLocation *string `json:"output_location,omitempty"`
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// Status The possible export states.
|
2025-01-16 13:49:07 +00:00
|
|
|
Status ExportStatus `json:"status"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ExportID The export id.
|
|
|
|
|
type ExportID = openapi_types.UUID
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// ExportStatus The possible export states.
|
2025-01-16 13:49:07 +00:00
|
|
|
type ExportStatus string
|
|
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// ExportTrigger Payload for triggering an export.
|
|
|
|
|
type ExportTrigger struct {
|
2025-01-16 13:49:07 +00:00
|
|
|
// FieldFilters Filter the scope based on field output values.
|
|
|
|
|
FieldFilters *[]FieldFilter `json:"field_filters,omitempty"`
|
|
|
|
|
|
|
|
|
|
// IngestionFilters Filter the scope based on ingestion parameters.
|
|
|
|
|
IngestionFilters *struct {
|
|
|
|
|
// EndDate The last date of ingestion.
|
2025-03-12 00:59:58 +00:00
|
|
|
EndDate *time.Time `json:"end_date,omitempty"`
|
2025-01-16 13:49:07 +00:00
|
|
|
|
|
|
|
|
// StartDate This first date of ingestion.
|
2025-03-12 00:59:58 +00:00
|
|
|
StartDate *time.Time `json:"start_date,omitempty"`
|
2025-01-16 13:49:07 +00:00
|
|
|
} `json:"ingestion_filters,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-01-16 13:49:07 +00:00
|
|
|
// FieldFilter Filtering a column
|
|
|
|
|
type FieldFilter struct {
|
|
|
|
|
// Condition The possible field filtering conditions.
|
|
|
|
|
Condition FieldFilterCondition `json:"condition"`
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// FieldName The output field name.
|
|
|
|
|
FieldName CollectorFieldName `json:"field_name"`
|
2025-01-16 13:49:07 +00:00
|
|
|
|
|
|
|
|
// Values The values useful to the filter.
|
|
|
|
|
Values []string `json:"values"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FieldFilterCondition The possible field filtering conditions.
|
|
|
|
|
type FieldFilterCondition string
|
|
|
|
|
|
2025-03-17 18:14:15 +00:00
|
|
|
// Hash The document hash
|
|
|
|
|
type Hash = string
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// IdMessage A single uuid.
|
2025-01-15 19:45:51 +00:00
|
|
|
type IdMessage struct {
|
2025-01-16 13:49:07 +00:00
|
|
|
// Id Unique identifier for entity.
|
2025-01-24 14:52:56 +00:00
|
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// ListDocuments The documents in the client.
|
2025-03-17 18:14:15 +00:00
|
|
|
type ListDocuments = []DocumentSummary
|
2025-02-21 17:05:37 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ListQueries A set of queries.
|
2025-01-15 19:45:51 +00:00
|
|
|
type ListQueries struct {
|
|
|
|
|
// Queries List of queries.
|
|
|
|
|
Queries []Query `json:"queries"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Query A logic unit of execution.
|
2025-01-15 19:45:51 +00:00
|
|
|
type Query struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// ActiveVersion The desired version.
|
|
|
|
|
ActiveVersion Version `json:"active_version"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
// Config Configuration for the query.
|
2025-03-11 16:31:06 +00:00
|
|
|
Config *QueryConfig `json:"config,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Id The query id.
|
|
|
|
|
Id QueryID `json:"id"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// LatestVersion The desired version.
|
|
|
|
|
LatestVersion Version `json:"latest_version"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
// RequiredQueries List of required query IDs.
|
2025-03-11 16:31:06 +00:00
|
|
|
RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
// Type Specifies the type of the query.
|
|
|
|
|
Type QueryType `json:"type"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryConfig Configuration for the query.
|
|
|
|
|
type QueryConfig = string
|
|
|
|
|
|
|
|
|
|
// QueryCreate The parameters required to create a query.
|
2025-01-15 19:45:51 +00:00
|
|
|
type QueryCreate struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// Config Configuration for the query.
|
|
|
|
|
Config *QueryConfig `json:"config,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
// RequiredQueries List of required query IDs.
|
2025-03-11 16:31:06 +00:00
|
|
|
RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
// Type Specifies the type of the query.
|
|
|
|
|
Type QueryType `json:"type"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryID The query id.
|
|
|
|
|
type QueryID = openapi_types.UUID
|
|
|
|
|
|
|
|
|
|
// QueryTestRequest The properties for a query test request.
|
2025-01-15 19:45:51 +00:00
|
|
|
type QueryTestRequest struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// DocumentId The document id.
|
|
|
|
|
DocumentId DocumentID `json:"document_id"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryVersion The desired version.
|
|
|
|
|
QueryVersion Version `json:"query_version"`
|
2025-01-15 19:45:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryTestResponse The response from a query test.
|
2025-01-15 19:45:51 +00:00
|
|
|
type QueryTestResponse struct {
|
|
|
|
|
// Value Result of the query test.
|
|
|
|
|
Value string `json:"value"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// QueryType Specifies the type of the query.
|
|
|
|
|
type QueryType string
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// QueryUpdate The properties that may be updated for a query.
|
2025-01-15 19:45:51 +00:00
|
|
|
type QueryUpdate struct {
|
2025-03-11 16:31:06 +00:00
|
|
|
// ActiveVersion The desired version.
|
|
|
|
|
ActiveVersion *Version `json:"active_version,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// Config Configuration for the query.
|
|
|
|
|
Config *QueryConfig `json:"config,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// RequiredQueries List of required query IDs.
|
|
|
|
|
RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"`
|
2025-01-15 19:45:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// RequiredQueryIDs List of required query IDs.
|
|
|
|
|
type RequiredQueryIDs = []QueryID
|
|
|
|
|
|
|
|
|
|
// Version The desired version.
|
|
|
|
|
type Version = int32
|
|
|
|
|
|
2025-03-18 13:06:42 +00:00
|
|
|
// InternalError Description of error
|
|
|
|
|
type InternalError = ErrorMessage
|
|
|
|
|
|
|
|
|
|
// InvalidRequest Description of error
|
|
|
|
|
type InvalidRequest = ErrorMessage
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// NotFound Description of error
|
|
|
|
|
type NotFound = ErrorMessage
|
|
|
|
|
|
2025-03-18 13:06:42 +00:00
|
|
|
// TooManyRequests Description of error
|
|
|
|
|
type TooManyRequests = ErrorMessage
|
|
|
|
|
|
|
|
|
|
// Unauthorized Description of error
|
|
|
|
|
type Unauthorized = ErrorMessage
|
|
|
|
|
|
2025-05-27 15:28:46 +00:00
|
|
|
// UploadDocumentMultipartBody defines parameters for UploadDocument.
|
|
|
|
|
type UploadDocumentMultipartBody struct {
|
|
|
|
|
// File The file to upload
|
|
|
|
|
File openapi_types.File `json:"file"`
|
|
|
|
|
|
|
|
|
|
// Filename Optional custom filename
|
|
|
|
|
Filename *string `json:"filename,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// ListDocumentBatchesParams defines parameters for ListDocumentBatches.
|
|
|
|
|
type ListDocumentBatchesParams struct {
|
|
|
|
|
// Limit Maximum number of items to return
|
|
|
|
|
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
|
|
|
|
|
|
|
|
|
|
// Offset Number of items to skip
|
|
|
|
|
Offset *int32 `form:"offset,omitempty" json:"offset,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UploadDocumentBatchMultipartBody defines parameters for UploadDocumentBatch.
|
|
|
|
|
type UploadDocumentBatchMultipartBody struct {
|
|
|
|
|
// Archive The file to be uploaded as a ZIP archive
|
|
|
|
|
Archive openapi_types.File `json:"archive"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-07 14:10:39 -07:00
|
|
|
// LoginCallbackParams defines parameters for LoginCallback.
|
|
|
|
|
type LoginCallbackParams struct {
|
|
|
|
|
// Code Authorization code from Cognito
|
|
|
|
|
Code string `form:"code" json:"code"`
|
|
|
|
|
|
|
|
|
|
// State State parameter for CSRF protection
|
|
|
|
|
State string `form:"state" json:"state"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// CreateClientJSONRequestBody defines body for CreateClient for application/json ContentType.
|
|
|
|
|
type CreateClientJSONRequestBody = ClientCreate
|
|
|
|
|
|
|
|
|
|
// UpdateClientJSONRequestBody defines body for UpdateClient for application/json ContentType.
|
|
|
|
|
type UpdateClientJSONRequestBody = ClientUpdate
|
|
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
// SetCollectorByClientIdJSONRequestBody defines body for SetCollectorByClientId for application/json ContentType.
|
|
|
|
|
type SetCollectorByClientIdJSONRequestBody = CollectorSet
|
2025-01-15 19:45:51 +00:00
|
|
|
|
2025-05-27 15:28:46 +00:00
|
|
|
// UploadDocumentMultipartRequestBody defines body for UploadDocument for multipart/form-data ContentType.
|
|
|
|
|
type UploadDocumentMultipartRequestBody UploadDocumentMultipartBody
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// UploadDocumentBatchMultipartRequestBody defines body for UploadDocumentBatch for multipart/form-data ContentType.
|
|
|
|
|
type UploadDocumentBatchMultipartRequestBody UploadDocumentBatchMultipartBody
|
|
|
|
|
|
2025-03-05 19:37:06 +00:00
|
|
|
// TriggerExportJSONRequestBody defines body for TriggerExport for application/json ContentType.
|
|
|
|
|
type TriggerExportJSONRequestBody = ExportTrigger
|
|
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// CreateQueryJSONRequestBody defines body for CreateQuery for application/json ContentType.
|
|
|
|
|
type CreateQueryJSONRequestBody = QueryCreate
|
|
|
|
|
|
|
|
|
|
// UpdateQueryJSONRequestBody defines body for UpdateQuery for application/json ContentType.
|
|
|
|
|
type UpdateQueryJSONRequestBody = QueryUpdate
|
|
|
|
|
|
|
|
|
|
// TestQueryJSONRequestBody defines body for TestQuery for application/json ContentType.
|
|
|
|
|
type TestQueryJSONRequestBody = QueryTestRequest
|
|
|
|
|
|
|
|
|
|
// ServerInterface represents all server handlers.
|
|
|
|
|
type ServerInterface interface {
|
2025-01-21 18:24:14 +00:00
|
|
|
// Create a new client
|
2025-01-24 14:52:56 +00:00
|
|
|
// (POST /client)
|
2025-01-21 18:24:14 +00:00
|
|
|
CreateClient(ctx echo.Context) error
|
|
|
|
|
// Get a client by ID
|
2025-01-24 14:52:56 +00:00
|
|
|
// (GET /client/{id})
|
2025-03-11 16:31:06 +00:00
|
|
|
GetClient(ctx echo.Context, id ClientID) error
|
2025-01-21 18:24:14 +00:00
|
|
|
// Update a client
|
2025-01-24 14:52:56 +00:00
|
|
|
// (PATCH /client/{id})
|
2025-03-11 16:31:06 +00:00
|
|
|
UpdateClient(ctx echo.Context, id ClientID) error
|
2025-03-10 11:03:00 +00:00
|
|
|
// Get a collector by client ID
|
|
|
|
|
// (GET /client/{id}/collector)
|
2025-03-11 16:31:06 +00:00
|
|
|
GetCollectorByClientId(ctx echo.Context, id ClientID) error
|
2025-03-10 13:00:57 +00:00
|
|
|
// Set a collector
|
2025-03-10 11:03:00 +00:00
|
|
|
// (PATCH /client/{id}/collector)
|
2025-03-11 16:31:06 +00:00
|
|
|
SetCollectorByClientId(ctx echo.Context, id ClientID) error
|
2025-03-10 11:03:00 +00:00
|
|
|
// List the documents for a client
|
2025-05-27 15:28:46 +00:00
|
|
|
// (GET /client/{id}/document)
|
2025-03-11 16:31:06 +00:00
|
|
|
ListDocumentsByClientId(ctx echo.Context, id ClientID) error
|
2025-05-27 15:28:46 +00:00
|
|
|
// Upload a file
|
|
|
|
|
// (POST /client/{id}/document)
|
|
|
|
|
UploadDocument(ctx echo.Context, id ClientID) error
|
2025-08-05 07:03:35 -07:00
|
|
|
// List batch uploads for a client
|
|
|
|
|
// (GET /client/{id}/document/batch)
|
|
|
|
|
ListDocumentBatches(ctx echo.Context, id ClientID, params ListDocumentBatchesParams) error
|
|
|
|
|
// Upload multiple PDF documents as ZIP archive
|
|
|
|
|
// (POST /client/{id}/document/batch)
|
|
|
|
|
UploadDocumentBatch(ctx echo.Context, id ClientID) error
|
|
|
|
|
// Cancel a batch upload
|
|
|
|
|
// (DELETE /client/{id}/document/batch/{batch_id})
|
|
|
|
|
CancelDocumentBatch(ctx echo.Context, id ClientID, batchId BatchID) error
|
|
|
|
|
// Get batch upload status
|
|
|
|
|
// (GET /client/{id}/document/batch/{batch_id})
|
|
|
|
|
GetDocumentBatch(ctx echo.Context, id ClientID, batchId BatchID) error
|
2025-03-05 19:37:06 +00:00
|
|
|
// Trigger an export
|
2025-03-10 11:03:00 +00:00
|
|
|
// (POST /client/{id}/export)
|
2025-03-11 16:31:06 +00:00
|
|
|
TriggerExport(ctx echo.Context, id ClientID) error
|
2025-03-10 11:03:00 +00:00
|
|
|
// Get client sync status
|
|
|
|
|
// (GET /client/{id}/status)
|
2025-03-11 16:31:06 +00:00
|
|
|
GetStatusByClientId(ctx echo.Context, id ClientID) error
|
2025-03-17 18:14:15 +00:00
|
|
|
// Get document details by its id
|
|
|
|
|
// (GET /document/{id})
|
|
|
|
|
GetDocument(ctx echo.Context, id DocumentID) error
|
2025-03-11 16:31:06 +00:00
|
|
|
// Check export state.
|
|
|
|
|
// (GET /export/{id})
|
|
|
|
|
ExportState(ctx echo.Context, id ExportID) error
|
2025-04-07 14:10:39 -07:00
|
|
|
// Get the home page menu
|
|
|
|
|
// (GET /home)
|
|
|
|
|
GetHomePage(ctx echo.Context) error
|
|
|
|
|
// Login to the application
|
|
|
|
|
// (GET /login)
|
|
|
|
|
Login(ctx echo.Context) error
|
|
|
|
|
// OAuth2 callback endpoint
|
|
|
|
|
// (GET /login-callback)
|
|
|
|
|
LoginCallback(ctx echo.Context, params LoginCallbackParams) error
|
|
|
|
|
// Logout from the application
|
|
|
|
|
// (GET /logout)
|
|
|
|
|
Logout(ctx echo.Context) error
|
2025-01-15 19:45:51 +00:00
|
|
|
// List queries
|
2025-01-24 14:52:56 +00:00
|
|
|
// (GET /query)
|
2025-01-15 19:45:51 +00:00
|
|
|
ListQueries(ctx echo.Context) error
|
|
|
|
|
// Create a new query
|
2025-01-24 14:52:56 +00:00
|
|
|
// (POST /query)
|
2025-01-15 19:45:51 +00:00
|
|
|
CreateQuery(ctx echo.Context) error
|
|
|
|
|
// Get a query by ID
|
2025-01-24 14:52:56 +00:00
|
|
|
// (GET /query/{id})
|
2025-03-11 16:31:06 +00:00
|
|
|
GetQuery(ctx echo.Context, id QueryID) error
|
2025-01-15 19:45:51 +00:00
|
|
|
// Update a query
|
2025-01-24 14:52:56 +00:00
|
|
|
// (PATCH /query/{id})
|
2025-03-11 16:31:06 +00:00
|
|
|
UpdateQuery(ctx echo.Context, id QueryID) error
|
2025-01-15 19:45:51 +00:00
|
|
|
// Test a query
|
2025-01-24 14:52:56 +00:00
|
|
|
// (POST /query/{id}/test)
|
2025-03-11 16:31:06 +00:00
|
|
|
TestQuery(ctx echo.Context, id QueryID) error
|
2025-01-15 19:45:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ServerInterfaceWrapper converts echo contexts to parameters.
|
|
|
|
|
type ServerInterfaceWrapper struct {
|
|
|
|
|
Handler ServerInterface
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// CreateClient converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) CreateClient(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.CreateClient(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetClient converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetClient(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-01-21 18:24:14 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-17 18:14:15 +00:00
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.GetClient(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateClient converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) UpdateClient(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-01-21 18:24:14 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.UpdateClient(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// GetCollectorByClientId converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetCollectorByClientId(ctx echo.Context) error {
|
2025-01-24 14:52:56 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-01-24 14:52:56 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-24 14:52:56 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-10 11:03:00 +00:00
|
|
|
err = w.Handler.GetCollectorByClientId(ctx, id)
|
2025-01-24 14:52:56 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
// SetCollectorByClientId converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) SetCollectorByClientId(ctx echo.Context) error {
|
2025-01-15 19:45:51 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-10 13:00:57 +00:00
|
|
|
err = w.Handler.SetCollectorByClientId(ctx, id)
|
2025-01-15 19:45:51 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
// ListDocumentsByClientId converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) ListDocumentsByClientId(ctx echo.Context) error {
|
2025-02-21 17:05:37 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-02-21 17:05:37 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-02-21 17:05:37 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-10 11:03:00 +00:00
|
|
|
err = w.Handler.ListDocumentsByClientId(ctx, id)
|
2025-02-21 17:05:37 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-27 15:28:46 +00:00
|
|
|
// UploadDocument converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) UploadDocument(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id ClientID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.UploadDocument(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-05 07:03:35 -07:00
|
|
|
// ListDocumentBatches converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) ListDocumentBatches(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id ClientID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
|
|
|
var params ListDocumentBatchesParams
|
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------- Optional query parameter "offset" -------------
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.ListDocumentBatches(ctx, id, params)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UploadDocumentBatch converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) UploadDocumentBatch(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id ClientID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.UploadDocumentBatch(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CancelDocumentBatch converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) CancelDocumentBatch(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id ClientID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "batch_id" -------------
|
|
|
|
|
var batchId BatchID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "batch_id", ctx.Param("batch_id"), &batchId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter batch_id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.CancelDocumentBatch(ctx, id, batchId)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDocumentBatch converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetDocumentBatch(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id ClientID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------- Path parameter "batch_id" -------------
|
|
|
|
|
var batchId BatchID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "batch_id", ctx.Param("batch_id"), &batchId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter batch_id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.GetDocumentBatch(ctx, id, batchId)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// TriggerExport converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) TriggerExport(ctx echo.Context) error {
|
2025-01-15 19:45:51 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-11 16:31:06 +00:00
|
|
|
err = w.Handler.TriggerExport(ctx, id)
|
2025-01-15 19:45:51 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// GetStatusByClientId converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetStatusByClientId(ctx echo.Context) error {
|
2025-03-05 19:37:06 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ClientID
|
2025-03-05 19:37:06 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-03-05 19:37:06 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-11 16:31:06 +00:00
|
|
|
err = w.Handler.GetStatusByClientId(ctx, id)
|
2025-03-05 19:37:06 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-17 18:14:15 +00:00
|
|
|
// GetDocument converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetDocument(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
|
|
|
var id DocumentID
|
|
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-17 18:14:15 +00:00
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.GetDocument(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
// ExportState converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) ExportState(ctx echo.Context) error {
|
2025-03-04 16:20:54 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id ExportID
|
2025-03-04 16:20:54 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-03-04 16:20:54 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-03-11 16:31:06 +00:00
|
|
|
err = w.Handler.ExportState(ctx, id)
|
2025-03-04 16:20:54 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-07 14:10:39 -07:00
|
|
|
// GetHomePage converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetHomePage(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-04-07 14:10:39 -07:00
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.GetHomePage(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Login converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) Login(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
ctx.Set(CognitoAuthScopes, []string{"openid", "email", "profile"})
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.Login(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LoginCallback converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) LoginCallback(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
|
|
|
var params LoginCallbackParams
|
|
|
|
|
// ------------- Required query parameter "code" -------------
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "code", ctx.QueryParams(), ¶ms.Code)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter code: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------- Required query parameter "state" -------------
|
|
|
|
|
|
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "state", ctx.QueryParams(), ¶ms.State)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter state: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.LoginCallback(ctx, params)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Logout converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) Logout(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-04-07 14:10:39 -07:00
|
|
|
|
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.Logout(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// ListQueries converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) ListQueries(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.ListQueries(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreateQuery converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) CreateQuery(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.CreateQuery(ctx)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
// GetQuery converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) GetQuery(ctx echo.Context) error {
|
2025-01-15 19:45:51 +00:00
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id QueryID
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
2025-01-21 18:24:14 +00:00
|
|
|
err = w.Handler.GetQuery(ctx, id)
|
2025-01-15 19:45:51 +00:00
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateQuery converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) UpdateQuery(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id QueryID
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.UpdateQuery(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TestQuery converts echo context to params.
|
|
|
|
|
func (w *ServerInterfaceWrapper) TestQuery(ctx echo.Context) error {
|
|
|
|
|
var err error
|
|
|
|
|
// ------------- Path parameter "id" -------------
|
2025-03-11 16:31:06 +00:00
|
|
|
var id QueryID
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 15:12:38 -07:00
|
|
|
ctx.Set(JwtAuthScopes, []string{})
|
2025-03-12 00:59:58 +00:00
|
|
|
|
2025-01-15 19:45:51 +00:00
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
|
|
|
err = w.Handler.TestQuery(ctx, id)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This is a simple interface which specifies echo.Route addition functions which
|
|
|
|
|
// are present on both echo.Echo and echo.Group, since we want to allow using
|
|
|
|
|
// either of them for path registration
|
|
|
|
|
type EchoRouter interface {
|
|
|
|
|
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RegisterHandlers adds each server route to the EchoRouter.
|
|
|
|
|
func RegisterHandlers(router EchoRouter, si ServerInterface) {
|
|
|
|
|
RegisterHandlersWithBaseURL(router, si, "")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Registers handlers, and prepends BaseURL to the paths, so that the paths
|
|
|
|
|
// can be served under a prefix.
|
|
|
|
|
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {
|
|
|
|
|
|
|
|
|
|
wrapper := ServerInterfaceWrapper{
|
|
|
|
|
Handler: si,
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-24 14:52:56 +00:00
|
|
|
router.POST(baseURL+"/client", wrapper.CreateClient)
|
|
|
|
|
router.GET(baseURL+"/client/:id", wrapper.GetClient)
|
|
|
|
|
router.PATCH(baseURL+"/client/:id", wrapper.UpdateClient)
|
2025-03-10 11:03:00 +00:00
|
|
|
router.GET(baseURL+"/client/:id/collector", wrapper.GetCollectorByClientId)
|
2025-03-10 13:00:57 +00:00
|
|
|
router.PATCH(baseURL+"/client/:id/collector", wrapper.SetCollectorByClientId)
|
2025-05-27 15:28:46 +00:00
|
|
|
router.GET(baseURL+"/client/:id/document", wrapper.ListDocumentsByClientId)
|
|
|
|
|
router.POST(baseURL+"/client/:id/document", wrapper.UploadDocument)
|
2025-08-05 07:03:35 -07:00
|
|
|
router.GET(baseURL+"/client/:id/document/batch", wrapper.ListDocumentBatches)
|
|
|
|
|
router.POST(baseURL+"/client/:id/document/batch", wrapper.UploadDocumentBatch)
|
|
|
|
|
router.DELETE(baseURL+"/client/:id/document/batch/:batch_id", wrapper.CancelDocumentBatch)
|
|
|
|
|
router.GET(baseURL+"/client/:id/document/batch/:batch_id", wrapper.GetDocumentBatch)
|
2025-03-10 11:03:00 +00:00
|
|
|
router.POST(baseURL+"/client/:id/export", wrapper.TriggerExport)
|
|
|
|
|
router.GET(baseURL+"/client/:id/status", wrapper.GetStatusByClientId)
|
2025-03-17 18:14:15 +00:00
|
|
|
router.GET(baseURL+"/document/:id", wrapper.GetDocument)
|
2025-03-11 16:31:06 +00:00
|
|
|
router.GET(baseURL+"/export/:id", wrapper.ExportState)
|
2025-04-07 14:10:39 -07:00
|
|
|
router.GET(baseURL+"/home", wrapper.GetHomePage)
|
|
|
|
|
router.GET(baseURL+"/login", wrapper.Login)
|
|
|
|
|
router.GET(baseURL+"/login-callback", wrapper.LoginCallback)
|
|
|
|
|
router.GET(baseURL+"/logout", wrapper.Logout)
|
2025-01-24 14:52:56 +00:00
|
|
|
router.GET(baseURL+"/query", wrapper.ListQueries)
|
|
|
|
|
router.POST(baseURL+"/query", wrapper.CreateQuery)
|
|
|
|
|
router.GET(baseURL+"/query/:id", wrapper.GetQuery)
|
|
|
|
|
router.PATCH(baseURL+"/query/:id", wrapper.UpdateQuery)
|
|
|
|
|
router.POST(baseURL+"/query/:id/test", wrapper.TestQuery)
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Base64 encoded, gzipped, json marshaled Swagger object
|
|
|
|
|
var swaggerSpec = []string{
|
|
|
|
|
|
2025-10-06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4Ekio2qv5Wj9IDtA6KE2fJdRnvMxQe4QSHC1n3OJfTpkrUqu9fdHJBEAH0J55DM",
|
|
|
|
|
"EAfYIC/9hAiv2C1XlvINL/PD9bNXvH7Ldmv/M7d1G+HDsPlP2PzaaV58/Ngc+/+fwtLrvHK9sgR+xYCr",
|
|
|
|
|
"25tXkqlCIgqtiiHgwhdlX0Fst9MbbE3s/bbI5CihSTnMrnC0rmyJVBZXq0fbHbL+owqz/j+hTw5Qihsd",
|
|
|
|
|
"kWhJce7d3gsoNKkOPH1NZxoOpCcHaKIP0Jpxuiqsjt/jXCkNiapsqZ4npckLD5KQ77CmcnzlKUg31FHl",
|
|
|
|
|
"1IX4Pu2NLYFHnT1Q+IkWocL5bWziZ1usp3aEmSlV4Fa1U4XkQoYFYhj6w6dtxaMDh0zbaTwnjWFxBcfj",
|
|
|
|
|
"9R4jnz6n8rW6plLAc8fqGgncug7F1vnbvxv34BCvS24Fol2ytz87tP0FXpp0Zv4xcfuZEret9Ct2RQrB",
|
|
|
|
|
"O2Rt672yPmk72xgHAl1TPa5Kz45X8QdIHUwFn8sXLOPtVteYaT2f7XK1HcCukap9cJxen6itU6ttadO0",
|
|
|
|
|
"Ur0pQZRWhNohi0Jr+zF1+xlSt7dC1LYwFei+YzN43ZaXqnqlAmRdsy4h+rG0yoPJl1IuBMkgLg6+NdyS",
|
|
|
|
|
"fBX7o1CDb5s4mc4hiK2OKr7TNPIkPuY87is6RrJ08/ZS47EH/83jO0ajJEyrS6nKWImnLlhIF+2Hrtpe",
|
|
|
|
|
"Zp5y3p3ZINKrjhWqSqdaRTbw7CIwHypRvmKsGMZmFbsjFTON6w7mRt+bsUoP4XXHyk5RZqQc9+uOol86",
|
|
|
|
|
"nVHyT5x1h8mXSnOqkzmXCE/3T/8bAAD//69cLjR1hwAA",
|
2025-01-15 19:45:51 +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
|
|
|
|
|
}
|