Merged in feature/fix_test_timeouts (pull request #194)

text extractions tests

* increase timeout

for slow ci/cd systems

* add tests
This commit is contained in:
Jay Brown
2025-12-04 22:45:15 +00:00
parent 3bdc27f4de
commit a94637ab13
14 changed files with 2071 additions and 270 deletions
+49 -7
View File
@@ -726,6 +726,10 @@ type Folder struct {
// Id Folder ID
Id openapi_types.UUID `json:"id"`
// Metrics Processing metrics for this folder. Only populated when metrics=true
// is specified in the request. Null otherwise.
Metrics nullable.Nullable[FolderMetricsInline] `json:"metrics,omitempty"`
// ParentId Parent folder ID
ParentId nullable.Nullable[openapi_types.UUID] `json:"parentId,omitempty"`
@@ -768,6 +772,15 @@ type FolderMetrics struct {
TotalDocuments int32 `json:"totalDocuments"`
}
// FolderMetricsInline Inline processing metrics for a folder (excludes folderId since it's on parent)
type FolderMetricsInline struct {
// ByLabel Document counts by label
ByLabel map[string]int32 `json:"byLabel"`
// TotalDocuments Total number of documents in folder
TotalDocuments int32 `json:"totalDocuments"`
}
// FolderRename Request to rename an existing folder
type FolderRename struct {
// Path New folder path (must start with /). Use "/" for root folder.
@@ -1038,6 +1051,13 @@ type UploadDocumentBatchMultipartBody struct {
Archive openapi_types.File `json:"archive"`
}
// ListClientFoldersParams defines parameters for ListClientFolders.
type ListClientFoldersParams struct {
// Metrics When true, include processing metrics for each folder (document counts by label).
// Defaults to false for performance reasons.
Metrics *bool `form:"metrics,omitempty" json:"metrics,omitempty"`
}
// GetCurrentFieldExtractionParams defines parameters for GetCurrentFieldExtraction.
type GetCurrentFieldExtractionParams struct {
// DocumentId The document ID
@@ -1265,7 +1285,7 @@ type ClientInterface interface {
TriggerExport(ctx context.Context, id ClientID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListClientFolders request
ListClientFolders(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*http.Response, error)
ListClientFolders(ctx context.Context, id ClientID, params *ListClientFoldersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStatusByClientId request
GetStatusByClientId(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*http.Response, error)
@@ -1666,8 +1686,8 @@ func (c *Client) TriggerExport(ctx context.Context, id ClientID, body TriggerExp
return c.Client.Do(req)
}
func (c *Client) ListClientFolders(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListClientFoldersRequest(c.Server, id)
func (c *Client) ListClientFolders(ctx context.Context, id ClientID, params *ListClientFoldersParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListClientFoldersRequest(c.Server, id, params)
if err != nil {
return nil, err
}
@@ -2964,7 +2984,7 @@ func NewTriggerExportRequestWithBody(server string, id ClientID, contentType str
}
// NewListClientFoldersRequest generates requests for ListClientFolders
func NewListClientFoldersRequest(server string, id ClientID) (*http.Request, error) {
func NewListClientFoldersRequest(server string, id ClientID, params *ListClientFoldersParams) (*http.Request, error) {
var err error
var pathParam0 string
@@ -2989,6 +3009,28 @@ func NewListClientFoldersRequest(server string, id ClientID) (*http.Request, err
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if params.Metrics != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "metrics", runtime.ParamLocationQuery, *params.Metrics); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
@@ -4050,7 +4092,7 @@ type ClientWithResponsesInterface interface {
TriggerExportWithResponse(ctx context.Context, id ClientID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error)
// ListClientFoldersWithResponse request
ListClientFoldersWithResponse(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*ListClientFoldersResponse, error)
ListClientFoldersWithResponse(ctx context.Context, id ClientID, params *ListClientFoldersParams, reqEditors ...RequestEditorFn) (*ListClientFoldersResponse, error)
// GetStatusByClientIdWithResponse request
GetStatusByClientIdWithResponse(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*GetStatusByClientIdResponse, error)
@@ -5565,8 +5607,8 @@ func (c *ClientWithResponses) TriggerExportWithResponse(ctx context.Context, id
}
// ListClientFoldersWithResponse request returning *ListClientFoldersResponse
func (c *ClientWithResponses) ListClientFoldersWithResponse(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*ListClientFoldersResponse, error) {
rsp, err := c.ListClientFolders(ctx, id, reqEditors...)
func (c *ClientWithResponses) ListClientFoldersWithResponse(ctx context.Context, id ClientID, params *ListClientFoldersParams, reqEditors ...RequestEditorFn) (*ListClientFoldersResponse, error) {
rsp, err := c.ListClientFolders(ctx, id, params, reqEditors...)
if err != nil {
return nil, err
}