Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Error
- type FileGetExtractionResultsResponse
- type FileListParams
- type FileListResponse
- type FileListResponseResult
- type FileNewParams
- type FileNewResponse
- type FileNewResponseFile
- type FileService
- func (r *FileService) Delete(ctx context.Context, collectionID string, opts ...option.RequestOption) (err error)
- func (r *FileService) GetExtractionResults(ctx context.Context, collectionID string, opts ...option.RequestOption) (res *FileGetExtractionResultsResponse, err error)
- func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *FileListResponse, err error)
- func (r *FileService) New(ctx context.Context, body FileNewParams, opts ...option.RequestOption) (res *FileNewResponse, err error)
- type HealthCheckResponse
- type HealthService
- type WebhookListResponse
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *[]WebhookListResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
- type Workflow
- type WorkflowListParams
- type WorkflowListResponse
- type WorkflowListRunsParams
- type WorkflowListRunsResponse
- type WorkflowListRunsResponseResult
- type WorkflowResultsParams
- type WorkflowResultsResponse
- type WorkflowRunParams
- type WorkflowRunResponse
- type WorkflowService
- func (r *WorkflowService) Delete(ctx context.Context, workflowID string, opts ...option.RequestOption) (err error)
- func (r *WorkflowService) Get(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *WorkflowListResponse, err error)
- func (r *WorkflowService) ListRuns(ctx context.Context, workflowID string, query WorkflowListRunsParams, ...) (res *WorkflowListRunsResponse, err error)
- func (r *WorkflowService) New(ctx context.Context, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) Results(ctx context.Context, workflowID string, query WorkflowResultsParams, ...) (res *WorkflowResultsResponse, err error)
- func (r *WorkflowService) Run(ctx context.Context, workflowID string, body WorkflowRunParams, ...) (res *WorkflowRunResponse, err error)
- func (r *WorkflowService) Upload(ctx context.Context, workflowID string, body WorkflowUploadParams, ...) (res *WorkflowUploadResponse, err error)
- type WorkflowUploadParams
- type WorkflowUploadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (ANYFORMAT_API_KEY, ANYFORMAT_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Client ¶
type Client struct {
// Health checks.
Health HealthService
// Webhook subscriptions for async notifications.
Webhooks WebhookService
// File collection management.
Files FileService
// Workflow CRUD, execution, runs, and results.
Workflows WorkflowService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the anyformat API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (ANYFORMAT_API_KEY, ANYFORMAT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type FileGetExtractionResultsResponse ¶
type FileGetExtractionResultsResponse = any
type FileListParams ¶
type FileListParams struct {
WorkflowID param.Opt[string] `query:"workflow_id,omitzero" json:"-"`
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParams) URLQuery ¶
func (r FileListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParams's query parameters as `url.Values`.
type FileListResponse ¶
type FileListResponse struct {
Count int64 `json:"count" api:"required"`
Page int64 `json:"page" api:"required"`
PageSize int64 `json:"page_size" api:"required"`
Results []FileListResponseResult `json:"results" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Page respjson.Field
PageSize respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileListResponse) RawJSON ¶
func (r FileListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileListResponse) UnmarshalJSON ¶
func (r *FileListResponse) UnmarshalJSON(data []byte) error
type FileListResponseResult ¶
type FileListResponseResult struct {
ID string `json:"id" api:"required"`
Status string `json:"status" api:"required"`
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
Name string `json:"name" api:"nullable"`
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
CreatedAt respjson.Field
Name respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single file collection entry in list responses.
func (FileListResponseResult) RawJSON ¶
func (r FileListResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileListResponseResult) UnmarshalJSON ¶
func (r *FileListResponseResult) UnmarshalJSON(data []byte) error
type FileNewParams ¶
type FileNewParams struct {
Files []string `json:"files,omitzero" api:"required"`
WorkflowID string `json:"workflow_id" api:"required"`
// contains filtered or unexported fields
}
func (FileNewParams) MarshalMultipart ¶
func (r FileNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type FileNewResponse ¶
type FileNewResponse struct {
ID string `json:"id" api:"required"`
Files []FileNewResponseFile `json:"files" api:"required"`
WorkflowID string `json:"workflow_id" api:"required"`
Name string `json:"name" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Files respjson.Field
WorkflowID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from creating a file collection.
func (FileNewResponse) RawJSON ¶
func (r FileNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileNewResponse) UnmarshalJSON ¶
func (r *FileNewResponse) UnmarshalJSON(data []byte) error
type FileNewResponseFile ¶
type FileNewResponseFile struct {
Filename string `json:"filename" api:"required"`
Status string `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Filename respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single file within a collection.
func (FileNewResponseFile) RawJSON ¶
func (r FileNewResponseFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileNewResponseFile) UnmarshalJSON ¶
func (r *FileNewResponseFile) UnmarshalJSON(data []byte) error
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
File collection management.
FileService contains methods and other services that help with interacting with the anyformat API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.
func NewFileService ¶
func NewFileService(opts ...option.RequestOption) (r FileService)
NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileService) Delete ¶
func (r *FileService) Delete(ctx context.Context, collectionID string, opts ...option.RequestOption) (err error)
Delete a file collection and all its files.
func (*FileService) GetExtractionResults ¶
func (r *FileService) GetExtractionResults(ctx context.Context, collectionID string, opts ...option.RequestOption) (res *FileGetExtractionResultsResponse, err error)
Get extraction results for a file collection.
Returns 412 if the extraction is not yet complete.
func (*FileService) List ¶
func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *FileListResponse, err error)
List file collections for a workflow.
func (*FileService) New ¶
func (r *FileService) New(ctx context.Context, body FileNewParams, opts ...option.RequestOption) (res *FileNewResponse, err error)
Upload files to a workflow, creating a file collection.
type HealthCheckResponse ¶
type HealthCheckResponse = any
type HealthService ¶
type HealthService struct {
// contains filtered or unexported fields
}
Health checks.
HealthService contains methods and other services that help with interacting with the anyformat API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHealthService method instead.
func NewHealthService ¶
func NewHealthService(opts ...option.RequestOption) (r HealthService)
NewHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*HealthService) Check ¶
func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthCheckResponse, err error)
Health check endpoint.
Returns 200 OK if the service is running. No authentication required.
type WebhookListResponse ¶
type WebhookListResponse struct {
ID string `json:"id" api:"required"`
CreatedAt string `json:"created_at" api:"required"`
Events []string `json:"events" api:"required"`
IsActive bool `json:"is_active" api:"required"`
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Events respjson.Field
IsActive respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response schema for listing webhooks (excludes secret)
func (WebhookListResponse) RawJSON ¶
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶
type WebhookNewParams struct {
URL string `json:"url" api:"required" format:"uri"`
Events []string `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponse ¶
type WebhookNewResponse struct {
ID string `json:"id" api:"required"`
CreatedAt string `json:"created_at" api:"required"`
Events []string `json:"events" api:"required"`
IsActive bool `json:"is_active" api:"required"`
Secret string `json:"secret" api:"required"`
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Events respjson.Field
IsActive respjson.Field
Secret respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response schema for webhook subscription (includes secret)
func (WebhookNewResponse) RawJSON ¶
func (r WebhookNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponse) UnmarshalJSON ¶
func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
Webhook subscriptions for async notifications.
WebhookService contains methods and other services that help with interacting with the anyformat API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
Delete a webhook subscription by ID.
Returns 204 on success, 404 if webhook not found, 403 if unauthorized.
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *[]WebhookListResponse, err error)
List all webhook subscriptions for the authenticated organization.
Returns a list of webhooks (secrets are excluded in list view).
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
Create a new webhook subscription.
Validates URL (HTTPS only) and event types, then forwards to backend service. Returns the created webhook with generated secret.
type Workflow ¶
type Workflow struct {
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
Description string `json:"description" api:"nullable"`
Fields []map[string]any `json:"fields" api:"nullable"`
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
CreatedAt respjson.Field
Description respjson.Field
Fields respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Workflow detail — used for get, create, and list items.
func (*Workflow) UnmarshalJSON ¶
type WorkflowListParams ¶
type WorkflowListParams struct {
Order param.Opt[string] `query:"order,omitzero" json:"-"`
SortBy param.Opt[string] `query:"sort_by,omitzero" json:"-"`
Status param.Opt[string] `query:"status,omitzero" json:"-"`
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowListParams) URLQuery ¶
func (r WorkflowListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowListParams's query parameters as `url.Values`.
type WorkflowListResponse ¶
type WorkflowListResponse struct {
Count int64 `json:"count" api:"required"`
Page int64 `json:"page" api:"required"`
PageSize int64 `json:"page_size" api:"required"`
Results []Workflow `json:"results" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Page respjson.Field
PageSize respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
GET /workflows/ — paginated workflow list.
func (WorkflowListResponse) RawJSON ¶
func (r WorkflowListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowListResponse) UnmarshalJSON ¶
func (r *WorkflowListResponse) UnmarshalJSON(data []byte) error
type WorkflowListRunsParams ¶
type WorkflowListRunsParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowListRunsParams) URLQuery ¶
func (r WorkflowListRunsParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowListRunsParams's query parameters as `url.Values`.
type WorkflowListRunsResponse ¶
type WorkflowListRunsResponse struct {
Count int64 `json:"count" api:"required"`
Page int64 `json:"page" api:"required"`
PageSize int64 `json:"page_size" api:"required"`
Results []WorkflowListRunsResponseResult `json:"results" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Page respjson.Field
PageSize respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
GET /workflows/{id}/runs/ — paginated run list.
func (WorkflowListRunsResponse) RawJSON ¶
func (r WorkflowListRunsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowListRunsResponse) UnmarshalJSON ¶
func (r *WorkflowListRunsResponse) UnmarshalJSON(data []byte) error
type WorkflowListRunsResponseResult ¶
type WorkflowListRunsResponseResult struct {
ID string `json:"id" api:"required"`
Status string `json:"status" api:"required"`
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
CreatedAt respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Item in GET /workflows/{id}/runs/ paginated list.
func (WorkflowListRunsResponseResult) RawJSON ¶
func (r WorkflowListRunsResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowListRunsResponseResult) UnmarshalJSON ¶
func (r *WorkflowListRunsResponseResult) UnmarshalJSON(data []byte) error
type WorkflowResultsParams ¶
type WorkflowResultsParams struct {
AsLists param.Opt[string] `query:"as_lists,omitzero" json:"-"`
OutputFormat param.Opt[string] `query:"output_format,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowResultsParams) URLQuery ¶
func (r WorkflowResultsParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowResultsParams's query parameters as `url.Values`.
type WorkflowResultsResponse ¶
type WorkflowResultsResponse = any
type WorkflowRunParams ¶
type WorkflowRunParams struct {
ContentType param.Opt[string] `json:"content_type,omitzero"`
File param.Opt[string] `json:"file,omitzero"`
FileBase64 param.Opt[string] `json:"file_base64,omitzero"`
Filename param.Opt[string] `json:"filename,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowRunParams) MarshalMultipart ¶
func (r WorkflowRunParams) MarshalMultipart() (data []byte, contentType string, err error)
type WorkflowRunResponse ¶
type WorkflowRunResponse struct {
ID string `json:"id" api:"required"`
Status string `json:"status" api:"required"`
WorkflowID string `json:"workflow_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
WorkflowID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for workflow run endpoint (v2) — collection UUID as identifier.
func (WorkflowRunResponse) RawJSON ¶
func (r WorkflowRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRunResponse) UnmarshalJSON ¶
func (r *WorkflowRunResponse) UnmarshalJSON(data []byte) error
type WorkflowService ¶
type WorkflowService struct {
// contains filtered or unexported fields
}
Workflow CRUD, execution, runs, and results.
WorkflowService contains methods and other services that help with interacting with the anyformat API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkflowService method instead.
func NewWorkflowService ¶
func NewWorkflowService(opts ...option.RequestOption) (r WorkflowService)
NewWorkflowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkflowService) Delete ¶
func (r *WorkflowService) Delete(ctx context.Context, workflowID string, opts ...option.RequestOption) (err error)
Delete workflow by ID.
func (*WorkflowService) Get ¶
func (r *WorkflowService) Get(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *Workflow, err error)
Get workflow by ID.
func (*WorkflowService) List ¶
func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *WorkflowListResponse, err error)
List workflows with pagination.
func (*WorkflowService) ListRuns ¶
func (r *WorkflowService) ListRuns(ctx context.Context, workflowID string, query WorkflowListRunsParams, opts ...option.RequestOption) (res *WorkflowListRunsResponse, err error)
List extraction runs for a workflow, identified by collection UUID.
func (*WorkflowService) New ¶
func (r *WorkflowService) New(ctx context.Context, opts ...option.RequestOption) (res *Workflow, err error)
Create a new workflow.
func (*WorkflowService) Results ¶
func (r *WorkflowService) Results(ctx context.Context, workflowID string, query WorkflowResultsParams, opts ...option.RequestOption) (res *WorkflowResultsResponse, err error)
Get workflow results.
func (*WorkflowService) Run ¶
func (r *WorkflowService) Run(ctx context.Context, workflowID string, body WorkflowRunParams, opts ...option.RequestOption) (res *WorkflowRunResponse, err error)
Execute workflow — returns collection UUID.
func (*WorkflowService) Upload ¶
func (r *WorkflowService) Upload(ctx context.Context, workflowID string, body WorkflowUploadParams, opts ...option.RequestOption) (res *WorkflowUploadResponse, err error)
Upload file without executing workflow.
type WorkflowUploadParams ¶
type WorkflowUploadParams struct {
ContentType param.Opt[string] `json:"content_type,omitzero"`
File param.Opt[string] `json:"file,omitzero"`
FileBase64 param.Opt[string] `json:"file_base64,omitzero"`
Filename param.Opt[string] `json:"filename,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowUploadParams) MarshalMultipart ¶
func (r WorkflowUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type WorkflowUploadResponse ¶
type WorkflowUploadResponse struct {
Status string `json:"status" api:"required"`
Filename string `json:"filename" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
POST /workflows/{id}/upload/ — upload confirmation.
func (WorkflowUploadResponse) RawJSON ¶
func (r WorkflowUploadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowUploadResponse) UnmarshalJSON ¶
func (r *WorkflowUploadResponse) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|