// Package queryapi provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version 2.4.1 DO NOT EDIT. package queryapi import ( "bytes" "compress/gzip" "encoding/base64" "fmt" "net/http" "net/url" "path" "strings" "time" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" "github.com/oapi-codegen/nullable" "github.com/oapi-codegen/runtime" openapi_types "github.com/oapi-codegen/runtime/types" ) const ( CognitoAuthScopes = "cognitoAuth.Scopes" JwtAuthScopes = "jwtAuth.Scopes" ) // Defines values for AdminUserActionResponseAction. const ( Disable AdminUserActionResponseAction = "disable" Enable AdminUserActionResponseAction = "enable" ) // Defines values for BatchStatus. const ( BatchStatusCancelled BatchStatus = "cancelled" BatchStatusCompleted BatchStatus = "completed" BatchStatusFailed BatchStatus = "failed" BatchStatusProcessing BatchStatus = "processing" ) // Defines values for ClientStatus. const ( INSYNC ClientStatus = "IN_SYNC" NOTSYNCED ClientStatus = "NOT_SYNCED" NOTSYNCING ClientStatus = "NOT_SYNCING" ) // Defines values for ExportStatus. const ( ExportStatusCompleted ExportStatus = "completed" ExportStatusFailed ExportStatus = "failed" ExportStatusInProgress ExportStatus = "in_progress" ) // 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" ) // Defines values for QueryType. const ( CONTEXTFULL QueryType = "CONTEXT_FULL" JSONEXTRACTOR QueryType = "JSON_EXTRACTOR" ) // Defines values for ListAdminUsersParamsStatus. const ( All ListAdminUsersParamsStatus = "all" Disabled ListAdminUsersParamsStatus = "disabled" Enabled ListAdminUsersParamsStatus = "enabled" ) // Defines values for ListAdminUsersParamsSortBy. const ( CreatedAt ListAdminUsersParamsSortBy = "created_at" Email ListAdminUsersParamsSortBy = "email" LastName ListAdminUsersParamsSortBy = "last_name" ) // Defines values for ListAdminUsersParamsSortOrder. const ( Asc ListAdminUsersParamsSortOrder = "asc" Desc ListAdminUsersParamsSortOrder = "desc" ) // AdminUserActionResponse Response for user enable/disable actions with success status and timestamp type AdminUserActionResponse struct { // Action Action performed Action AdminUserActionResponseAction `json:"action"` // CognitoSubjectId Cognito subject identifier for the action response CognitoSubjectId *string `json:"cognito_subject_id,omitempty"` // Email Email of the user acted upon Email openapi_types.Email `json:"email"` // Success Whether the action succeeded Success bool `json:"success"` // Timestamp Timestamp of the action Timestamp *time.Time `json:"timestamp,omitempty"` } // AdminUserActionResponseAction Action performed type AdminUserActionResponseAction string // AdminUserCreate Request body for creating a new user with email, name, and role assignments type AdminUserCreate struct { // Email User email address (used as Cognito username) Email openapi_types.Email `json:"email"` // FirstName User's given name for account creation FirstName string `json:"first_name"` // LastName User's family name for account creation LastName string `json:"last_name"` // Roles List of roles to assign in Permit.io Roles []string `json:"roles"` } // AdminUserCreateResponse Response after creating a user, including Cognito subject ID and sync status type AdminUserCreateResponse struct { // CognitoSubjectId Created user's Cognito unique subject identifier CognitoSubjectId string `json:"cognito_subject_id"` // CreatedAt Timestamp when the user was created in the system CreatedAt *time.Time `json:"created_at,omitempty"` // Email User email address Email openapi_types.Email `json:"email"` // Enabled Whether the created user is enabled in Cognito Enabled *bool `json:"enabled,omitempty"` // FirstName Created user's given name FirstName *string `json:"first_name,omitempty"` // LastName Created user's family name LastName *string `json:"last_name,omitempty"` // PermitSynced Whether user was successfully created in Permit.io PermitSynced bool `json:"permit_synced"` // RolesAssigned Roles successfully assigned in Permit.io RolesAssigned *[]string `json:"roles_assigned,omitempty"` // Status Cognito user status Status string `json:"status"` } // AdminUserDeleteResponse Response for user deletion with status from each system (Cognito and Permit.io) type AdminUserDeleteResponse struct { // CognitoSubjectId Cognito subject identifier of the deleted user CognitoSubjectId *string `json:"cognito_subject_id,omitempty"` // DeletedFrom Deletion status from each system DeletedFrom struct { // Cognito Whether user was deleted from Cognito Cognito bool `json:"cognito"` // Permit Whether user was deleted from Permit.io Permit bool `json:"permit"` } `json:"deleted_from"` // Email Email of the deleted user Email openapi_types.Email `json:"email"` // Success Whether the deletion succeeded Success bool `json:"success"` // Timestamp Timestamp of the deletion Timestamp *time.Time `json:"timestamp,omitempty"` } // AdminUserDetails Complete user information from Cognito and Permit.io including roles and timestamps type AdminUserDetails struct { // CognitoSubjectId User's Cognito unique subject identifier from authentication system CognitoSubjectId string `json:"cognito_subject_id"` // CreatedAt Timestamp when the user account was created CreatedAt *time.Time `json:"created_at,omitempty"` // Email Email address of the user account Email openapi_types.Email `json:"email"` // Enabled Current enabled status of the user in Cognito Enabled bool `json:"enabled"` // FirstName User's given name retrieved from Cognito FirstName *string `json:"first_name,omitempty"` // LastName User's family name retrieved from Cognito LastName *string `json:"last_name,omitempty"` // Roles Roles assigned in Permit.io Roles *[]string `json:"roles,omitempty"` // Status Current Cognito user account status Status string `json:"status"` // UpdatedAt Timestamp of last update UpdatedAt *time.Time `json:"updated_at,omitempty"` } // AdminUserList Paginated list of users with total count and pagination metadata type AdminUserList struct { // HasMore Whether more pages are available HasMore *bool `json:"has_more,omitempty"` // Page Current page number Page int32 `json:"page"` // PageSize Number of users per page PageSize int32 `json:"page_size"` // Total Total number of users matching filter Total int32 `json:"total"` // Users List of users for current page Users []AdminUserDetails `json:"users"` } // AdminUserUpdate Request body for updating user attributes (first name, last name, and roles) type AdminUserUpdate struct { // FirstName Updated given name for the user FirstName *string `json:"first_name,omitempty"` // LastName Updated family name for the user LastName *string `json:"last_name,omitempty"` // Roles Complete list of roles to assign (replaces existing roles) Roles *[]string `json:"roles,omitempty"` } // 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"` } // ClientCanSync If the client is allowing active syncs type ClientCanSync = bool // ClientCreate The properties for creation. type ClientCreate struct { // Id The client external id Id ClientID `json:"id"` // Name The client name 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"` } // ClientName The client name type ClientName = string // ClientStatus Specifies the status of a client. type ClientStatus string // ClientStatusBody A client status information object. type ClientStatusBody struct { // Status Specifies the status of a client. Status ClientStatus `json:"status"` } // ClientUpdate The properties that may be updated. type ClientUpdate struct { // CanSync If the client is allowing active syncs CanSync *ClientCanSync `json:"can_sync,omitempty"` // Name The client name Name *ClientName `json:"name,omitempty"` } // CodeVersion The desired code version. type CodeVersion = int64 // Collector Collector model. type Collector struct { // ActiveVersion The desired version. ActiveVersion Version `json:"active_version"` // ClientId The client external id ClientId ClientID `json:"client_id"` // Fields The fields in the collector. Fields CollectorFields `json:"fields"` // LatestVersion The desired version. LatestVersion Version `json:"latest_version"` // MinimumCleanerVersion The desired code version. MinimumCleanerVersion CodeVersion `json:"minimum_cleaner_version"` // MinimumTextVersion The desired code version. MinimumTextVersion CodeVersion `json:"minimum_text_version"` } // CollectorField The field properties for the collector. type CollectorField struct { // Name The output field name. Name CollectorFieldName `json:"name"` // QueryId The query id. QueryId QueryID `json:"query_id"` } // CollectorFieldName The output field name. type CollectorFieldName = string // CollectorFields The fields in the collector. type CollectorFields = []CollectorField // CollectorSet Payload for updating a Collector. type CollectorSet struct { // ActiveVersion The desired version. ActiveVersion *Version `json:"active_version,omitempty"` // Fields The fields in the collector. Fields *CollectorFields `json:"fields,omitempty"` // MinimumCleanerVersion The desired code version. MinimumCleanerVersion *CodeVersion `json:"minimum_cleaner_version,omitempty"` // MinimumTextVersion The desired code version. MinimumTextVersion *CodeVersion `json:"minimum_text_version,omitempty"` } // DocClient The properties of a client. type DocClient struct { // CanSync If the client is allowing active syncs CanSync ClientCanSync `json:"can_sync"` // Id The client external id Id ClientID `json:"id"` // Name The client name Name ClientName `json:"name"` } // Document The document properties. type Document struct { // 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"` // Id The document id. Id DocumentID `json:"id"` } // DocumentID The document id. type DocumentID = openapi_types.UUID // DocumentSummary The document summary properties. type DocumentSummary struct { // Hash The document hash Hash Hash `json:"hash"` // Id The document id. Id DocumentID `json:"id"` } // ErrorMessage Description of error type ErrorMessage struct { // Message Message describing the cause. Message string `json:"message"` } // ExportDetails Payload for export trigger response. type ExportDetails struct { // ClientId The client external id ClientId ClientID `json:"client_id"` // OutputLocation The location in which the export zip file will be found. OutputLocation *string `json:"output_location,omitempty"` // Status The possible export states. Status ExportStatus `json:"status"` } // ExportID The export id. type ExportID = openapi_types.UUID // ExportStatus The possible export states. type ExportStatus string // ExportTrigger Payload for triggering an export. type ExportTrigger struct { // 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. EndDate *time.Time `json:"end_date,omitempty"` // StartDate This first date of ingestion. StartDate *time.Time `json:"start_date,omitempty"` } `json:"ingestion_filters,omitempty"` } // FieldFilter Filtering a column type FieldFilter struct { // Condition The possible field filtering conditions. Condition FieldFilterCondition `json:"condition"` // FieldName The output field name. FieldName CollectorFieldName `json:"field_name"` // Values The values useful to the filter. Values []string `json:"values"` } // FieldFilterCondition The possible field filtering conditions. type FieldFilterCondition string // Hash The document hash type Hash = string // IdMessage A single uuid. type IdMessage struct { // Id Unique identifier for entity. Id openapi_types.UUID `json:"id"` } // ListDocuments The documents in the client. type ListDocuments = []DocumentSummary // ListQueries A set of queries. type ListQueries struct { // Queries List of queries. Queries []Query `json:"queries"` } // Query A logic unit of execution. type Query struct { // ActiveVersion The desired version. ActiveVersion Version `json:"active_version"` // Config Configuration for the query. Config *QueryConfig `json:"config,omitempty"` // Id The query id. Id QueryID `json:"id"` // LatestVersion The desired version. LatestVersion Version `json:"latest_version"` // RequiredQueries List of required query IDs. RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"` // Type Specifies the type of the query. Type QueryType `json:"type"` } // QueryConfig Configuration for the query. type QueryConfig = string // QueryCreate The parameters required to create a query. type QueryCreate struct { // Config Configuration for the query. Config *QueryConfig `json:"config,omitempty"` // RequiredQueries List of required query IDs. RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"` // Type Specifies the type of the query. Type QueryType `json:"type"` } // QueryID The query id. type QueryID = openapi_types.UUID // QueryTestRequest The properties for a query test request. type QueryTestRequest struct { // DocumentId The document id. DocumentId DocumentID `json:"document_id"` // QueryVersion The desired version. QueryVersion Version `json:"query_version"` } // QueryTestResponse The response from a query test. type QueryTestResponse struct { // Value Result of the query test. Value string `json:"value"` } // QueryType Specifies the type of the query. type QueryType string // QueryUpdate The properties that may be updated for a query. type QueryUpdate struct { // ActiveVersion The desired version. ActiveVersion *Version `json:"active_version,omitempty"` // Config Configuration for the query. Config *QueryConfig `json:"config,omitempty"` // RequiredQueries List of required query IDs. RequiredQueries *RequiredQueryIDs `json:"required_queries,omitempty"` } // RequiredQueryIDs List of required query IDs. type RequiredQueryIDs = []QueryID // Version The desired version. type Version = int32 // UserEmail defines model for UserEmail. type UserEmail = openapi_types.Email // BadGateway Description of error type BadGateway = ErrorMessage // Conflict Description of error type Conflict = ErrorMessage // Forbidden Description of error type Forbidden = ErrorMessage // InternalError Description of error type InternalError = ErrorMessage // InvalidRequest Description of error type InvalidRequest = ErrorMessage // NotFound Description of error type NotFound = ErrorMessage // TooManyRequests Description of error type TooManyRequests = ErrorMessage // Unauthorized Description of error type Unauthorized = ErrorMessage // ListAdminUsersParams defines parameters for ListAdminUsers. type ListAdminUsersParams struct { // Page Page number for pagination Page *int32 `form:"page,omitempty" json:"page,omitempty"` // PageSize Number of results per page PageSize *int32 `form:"page_size,omitempty" json:"page_size,omitempty"` // Search Search term for email/name filtering Search *string `form:"search,omitempty" json:"search,omitempty"` // Status Filter by user status Status *ListAdminUsersParamsStatus `form:"status,omitempty" json:"status,omitempty"` // SortBy Field to sort by SortBy *ListAdminUsersParamsSortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"` // SortOrder Sort direction SortOrder *ListAdminUsersParamsSortOrder `form:"sort_order,omitempty" json:"sort_order,omitempty"` } // ListAdminUsersParamsStatus defines parameters for ListAdminUsers. type ListAdminUsersParamsStatus string // ListAdminUsersParamsSortBy defines parameters for ListAdminUsers. type ListAdminUsersParamsSortBy string // ListAdminUsersParamsSortOrder defines parameters for ListAdminUsers. type ListAdminUsersParamsSortOrder string // DeleteAdminUserParams defines parameters for DeleteAdminUser. type DeleteAdminUserParams struct { // Confirm Must be set to true to confirm deletion Confirm bool `form:"confirm" json:"confirm"` } // 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"` } // 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"` } // 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"` } // CreateAdminUserJSONRequestBody defines body for CreateAdminUser for application/json ContentType. type CreateAdminUserJSONRequestBody = AdminUserCreate // UpdateAdminUserJSONRequestBody defines body for UpdateAdminUser for application/json ContentType. type UpdateAdminUserJSONRequestBody = AdminUserUpdate // CreateClientJSONRequestBody defines body for CreateClient for application/json ContentType. type CreateClientJSONRequestBody = ClientCreate // UpdateClientJSONRequestBody defines body for UpdateClient for application/json ContentType. type UpdateClientJSONRequestBody = ClientUpdate // SetCollectorByClientIdJSONRequestBody defines body for SetCollectorByClientId for application/json ContentType. type SetCollectorByClientIdJSONRequestBody = CollectorSet // UploadDocumentMultipartRequestBody defines body for UploadDocument for multipart/form-data ContentType. type UploadDocumentMultipartRequestBody UploadDocumentMultipartBody // UploadDocumentBatchMultipartRequestBody defines body for UploadDocumentBatch for multipart/form-data ContentType. type UploadDocumentBatchMultipartRequestBody UploadDocumentBatchMultipartBody // TriggerExportJSONRequestBody defines body for TriggerExport for application/json ContentType. type TriggerExportJSONRequestBody = ExportTrigger // 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 { // List users // (GET /admin/users) ListAdminUsers(ctx echo.Context, params ListAdminUsersParams) error // Create a new user // (POST /admin/users) CreateAdminUser(ctx echo.Context) error // Delete user permanently // (DELETE /admin/users/{email}) DeleteAdminUser(ctx echo.Context, email UserEmail, params DeleteAdminUserParams) error // Get user by email // (GET /admin/users/{email}) GetAdminUser(ctx echo.Context, email UserEmail) error // Check if user exists // (HEAD /admin/users/{email}) CheckAdminUserExists(ctx echo.Context, email UserEmail) error // Update user attributes // (PATCH /admin/users/{email}) UpdateAdminUser(ctx echo.Context, email UserEmail) error // Disable user // (POST /admin/users/{email}/disable) DisableAdminUser(ctx echo.Context, email UserEmail) error // Enable user // (POST /admin/users/{email}/enable) EnableAdminUser(ctx echo.Context, email UserEmail) error // Create a new client // (POST /client) CreateClient(ctx echo.Context) error // Get a client by ID // (GET /client/{id}) GetClient(ctx echo.Context, id ClientID) error // Update a client // (PATCH /client/{id}) UpdateClient(ctx echo.Context, id ClientID) error // Get a collector by client ID // (GET /client/{id}/collector) GetCollectorByClientId(ctx echo.Context, id ClientID) error // Set a collector // (PATCH /client/{id}/collector) SetCollectorByClientId(ctx echo.Context, id ClientID) error // List the documents for a client // (GET /client/{id}/document) ListDocumentsByClientId(ctx echo.Context, id ClientID) error // Upload a file // (POST /client/{id}/document) UploadDocument(ctx echo.Context, id ClientID) error // 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 // Trigger an export // (POST /client/{id}/export) TriggerExport(ctx echo.Context, id ClientID) error // Get client sync status // (GET /client/{id}/status) GetStatusByClientId(ctx echo.Context, id ClientID) error // Get document details by its id // (GET /document/{id}) GetDocument(ctx echo.Context, id DocumentID) error // Check export state. // (GET /export/{id}) ExportState(ctx echo.Context, id ExportID) error // 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 // List queries // (GET /query) ListQueries(ctx echo.Context) error // Create a new query // (POST /query) CreateQuery(ctx echo.Context) error // Get a query by ID // (GET /query/{id}) GetQuery(ctx echo.Context, id QueryID) error // Update a query // (PATCH /query/{id}) UpdateQuery(ctx echo.Context, id QueryID) error // Test a query // (POST /query/{id}/test) TestQuery(ctx echo.Context, id QueryID) error } // ServerInterfaceWrapper converts echo contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface } // ListAdminUsers converts echo context to params. func (w *ServerInterfaceWrapper) ListAdminUsers(ctx echo.Context) error { var err error ctx.Set(JwtAuthScopes, []string{}) // Parameter object where we will unmarshal all parameters from the context var params ListAdminUsersParams // ------------- Optional query parameter "page" ------------- err = runtime.BindQueryParameter("form", true, false, "page", ctx.QueryParams(), ¶ms.Page) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page: %s", err)) } // ------------- Optional query parameter "page_size" ------------- err = runtime.BindQueryParameter("form", true, false, "page_size", ctx.QueryParams(), ¶ms.PageSize) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page_size: %s", err)) } // ------------- Optional query parameter "search" ------------- err = runtime.BindQueryParameter("form", true, false, "search", ctx.QueryParams(), ¶ms.Search) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter search: %s", err)) } // ------------- Optional query parameter "status" ------------- err = runtime.BindQueryParameter("form", true, false, "status", ctx.QueryParams(), ¶ms.Status) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter status: %s", err)) } // ------------- Optional query parameter "sort_by" ------------- err = runtime.BindQueryParameter("form", true, false, "sort_by", ctx.QueryParams(), ¶ms.SortBy) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter sort_by: %s", err)) } // ------------- Optional query parameter "sort_order" ------------- err = runtime.BindQueryParameter("form", true, false, "sort_order", ctx.QueryParams(), ¶ms.SortOrder) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter sort_order: %s", err)) } // Invoke the callback with all the unmarshaled arguments err = w.Handler.ListAdminUsers(ctx, params) return err } // CreateAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) CreateAdminUser(ctx echo.Context) error { var err error ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.CreateAdminUser(ctx) return err } // DeleteAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) DeleteAdminUser(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Parameter object where we will unmarshal all parameters from the context var params DeleteAdminUserParams // ------------- Required query parameter "confirm" ------------- err = runtime.BindQueryParameter("form", true, true, "confirm", ctx.QueryParams(), ¶ms.Confirm) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter confirm: %s", err)) } // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAdminUser(ctx, email, params) return err } // GetAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) GetAdminUser(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetAdminUser(ctx, email) return err } // CheckAdminUserExists converts echo context to params. func (w *ServerInterfaceWrapper) CheckAdminUserExists(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.CheckAdminUserExists(ctx, email) return err } // UpdateAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) UpdateAdminUser(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.UpdateAdminUser(ctx, email) return err } // DisableAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) DisableAdminUser(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DisableAdminUser(ctx, email) return err } // EnableAdminUser converts echo context to params. func (w *ServerInterfaceWrapper) EnableAdminUser(ctx echo.Context) error { var err error // ------------- Path parameter "email" ------------- var email UserEmail err = runtime.BindStyledParameterWithOptions("simple", "email", ctx.Param("email"), &email, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter email: %s", err)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.EnableAdminUser(ctx, email) return err } // CreateClient converts echo context to params. func (w *ServerInterfaceWrapper) CreateClient(ctx echo.Context) error { var err error ctx.Set(JwtAuthScopes, []string{}) // 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" ------------- 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.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" ------------- 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.UpdateClient(ctx, id) return err } // GetCollectorByClientId converts echo context to params. func (w *ServerInterfaceWrapper) GetCollectorByClientId(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.GetCollectorByClientId(ctx, id) return err } // SetCollectorByClientId converts echo context to params. func (w *ServerInterfaceWrapper) SetCollectorByClientId(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.SetCollectorByClientId(ctx, id) return err } // ListDocumentsByClientId converts echo context to params. func (w *ServerInterfaceWrapper) ListDocumentsByClientId(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.ListDocumentsByClientId(ctx, id) return err } // 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 } // 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 } // TriggerExport converts echo context to params. func (w *ServerInterfaceWrapper) TriggerExport(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.TriggerExport(ctx, id) return err } // GetStatusByClientId converts echo context to params. func (w *ServerInterfaceWrapper) GetStatusByClientId(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.GetStatusByClientId(ctx, id) return err } // 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)) } ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetDocument(ctx, id) return err } // ExportState converts echo context to params. func (w *ServerInterfaceWrapper) ExportState(ctx echo.Context) error { var err error // ------------- Path parameter "id" ------------- var id ExportID 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.ExportState(ctx, id) return err } // GetHomePage converts echo context to params. func (w *ServerInterfaceWrapper) GetHomePage(ctx echo.Context) error { var err error ctx.Set(JwtAuthScopes, []string{}) // 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 ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.Logout(ctx) return err } // ListQueries converts echo context to params. func (w *ServerInterfaceWrapper) ListQueries(ctx echo.Context) error { var err error ctx.Set(JwtAuthScopes, []string{}) // 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 ctx.Set(JwtAuthScopes, []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.CreateQuery(ctx) return err } // GetQuery converts echo context to params. func (w *ServerInterfaceWrapper) GetQuery(ctx echo.Context) error { var err error // ------------- Path parameter "id" ------------- var id QueryID 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.GetQuery(ctx, id) return err } // UpdateQuery converts echo context to params. func (w *ServerInterfaceWrapper) UpdateQuery(ctx echo.Context) error { var err error // ------------- Path parameter "id" ------------- var id QueryID 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.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" ------------- var id QueryID 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.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, } router.GET(baseURL+"/admin/users", wrapper.ListAdminUsers) router.POST(baseURL+"/admin/users", wrapper.CreateAdminUser) router.DELETE(baseURL+"/admin/users/:email", wrapper.DeleteAdminUser) router.GET(baseURL+"/admin/users/:email", wrapper.GetAdminUser) router.HEAD(baseURL+"/admin/users/:email", wrapper.CheckAdminUserExists) router.PATCH(baseURL+"/admin/users/:email", wrapper.UpdateAdminUser) router.POST(baseURL+"/admin/users/:email/disable", wrapper.DisableAdminUser) router.POST(baseURL+"/admin/users/:email/enable", wrapper.EnableAdminUser) router.POST(baseURL+"/client", wrapper.CreateClient) router.GET(baseURL+"/client/:id", wrapper.GetClient) router.PATCH(baseURL+"/client/:id", wrapper.UpdateClient) router.GET(baseURL+"/client/:id/collector", wrapper.GetCollectorByClientId) router.PATCH(baseURL+"/client/:id/collector", wrapper.SetCollectorByClientId) router.GET(baseURL+"/client/:id/document", wrapper.ListDocumentsByClientId) router.POST(baseURL+"/client/:id/document", wrapper.UploadDocument) 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) router.POST(baseURL+"/client/:id/export", wrapper.TriggerExport) router.GET(baseURL+"/client/:id/status", wrapper.GetStatusByClientId) router.GET(baseURL+"/document/:id", wrapper.GetDocument) router.GET(baseURL+"/export/:id", wrapper.ExportState) 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) 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) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ "H4sIAAAAAAAC/+x9C3PbNtboX8Hw7p1tt3rLr/jOzl3VTlr3pnHWdm73a+JPA5GQhJYiFAK0o2T837/B", "AUCCJEhRiuSkrWc601jE4+DgvIFz8Mnz2WLJIhIJ7p1+8uYEBySGf15hQV7SBRXyj4BwP6ZLQVnkncIn", "FMpviEZTFi+w/IBohNQf6J0HX//PPY0Cdv9PQRekrf79zvNaHvmAF8uQeKdev9czjfo9r+Vxf04WWM7o", "bHMk2yzwh5ckmom5dzoctLwlFoLEEqz/fttrP7v9zjRWf/3Na3litZQDcRHTaOY9PDzIXjFeEKHX+j0W", "/vzivLzSmzlBE/kRJcuQ4QBdnHe8lkfltyUWc6/lRXghB4dWYxp4LS8m7xMak8A7FXFC7EX9LSZT79T7", "X90M6131lXcNDBK6s5CSSFQB5MPXalA+A4h0YgnFOfOTRQ0cgf6+F0isySUszz8sWVwJCYGve4EjnVhC", "8e+ExKsqIC7OEZsiMSfovWy2e1DM7BKSN5zEzxeYhmVY3ly9bJPIZwEJUMJJjIhsh3AQxITzCrCgTS1k", "irWtpjk+7Dm5LCZ8ySJONJMFP2BB7vFK/uWzSJAIhAteLkPqgwzp/sblGj413Zw4ZvHPhHM8I2rGPCqe", "f5CiAYeIk/iO+gQR2UGioErQuWbTbbtZQ5jqjEXTkPri0VZzRThLYp8gHMYEBytEPlAuOGIx4kKKZF9D", "tKMFvmDxhAYBiR5thRcRT6ZT6oN8W5J4QTmnLOJIMPmnJEEk5pQj7MseO1rnRaSoBKB7xLVatCm5dIek", "eRHd4ZAGV+R9Qrh4xCXBtChW86IJC1Y7WtErJl6wJAoen9kiJtBUTr2jldww9jOOVnpv+GMuCGQxSpYs", "QoIxtMDRyuwV38HqWt4VEfGqPZoKEpf10qtkMSGx1JGc+CwKOJqQKYsJEvGKRjOEZ5gCS6emX1+qFYcG", "opEYDpQGootk4Z2eHB30ei1vQSP1d6aNaCTIj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Tv/cB7rPxFwLQE/tApVlt+a0sKt", "tMKkKRtcPG2DrdP7aenm9TTe9nEYTrD/eyWx/4ijINSkfilHGSDTBwVJbN5j09SjAx/oiviEGvM5V6FZ", "vUEMVWJs5sBRgMgHlRPPEdWSl/1OIl7BLWcG8jUn86P62SsLUQWktgpVHSO8HbV/xe2Pvfazd+/a49tm", "5VLB9MoKcQECzq6vXkikivq6oMJ1y74C2H5vcLAxsLebSiaLCHUN6SyEo2hlQ0ll5Gr1aNuLrP9bJbP+", "StInJ1CKjG5KU6wTKCypvnj6ks2UOIDkXJYoB1ohTj3zq+7vcQ5EEwVVulTNU1Mu46UC5DO0qRwfLAVp", "hlqknJoQn0e9oQHwiWb3dP1EbSHI+U104nvz+lLjG2b67Qn7mUKoeu3HVJCYYvf1afOE1Z6vTJtpHJ7G", "qLiCJ/d6hzef3qf7a2gNavpvWlVZ1ebcOH/739o82Mfpkv2k1DbZ2+8t2L6Ckyb11MJT4vYjJW6b3a/g", "ilQEb5G1rXilPmk7Y4w9CV39HGAVnT2F4veQOphufC5fsCxvNwpjpg80bZarbQnsBqnae5fTawq5qfRf", "/VatiXSaN6XSJ762yKJQ1P6Uuv0IqdsbSdSu0E8KfgYzOM2W5/AcKQhk9QhhEqnD0ioLJv82duGSDOFi", "76xhv7FYwR+FRxU3uSfT2wew1beKbxSMPAmfch53dTtGonQ9e8F48V3Fc1YxCxI/fS4MijsljofefLbo", "3vWBvfQ85bw7zSDSqg5BqkqjGm428CwQmL8qUQ4xVgxjsortkYqZxk0Hs2/f67FKB+FNx8q8KD1SDvtN", "R1EnndYo+SPOpsPki8ZZz81ZQYSmY0EEbIEjPAORAsEuqKFHzXtv1vh2FbCH24f/CQAA///wF/j8lMkA", "AA==", } // 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 }