/**
 * Cloudflare WORKFLOWS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service workflows
 */
import * as Schema from "effect/Schema";
import type * as HttpClient from "effect/unstable/http/HttpClient";
import * as API from "../client/api.ts";
import type { Credentials } from "../credentials.ts";
import { type DefaultErrors } from "../errors.ts";
declare const InstanceAlreadyExists_base: Schema.Class<InstanceAlreadyExists, Schema.TaggedStruct<"InstanceAlreadyExists", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class InstanceAlreadyExists extends InstanceAlreadyExists_base {
}
declare const InstanceCannotTerminate_base: Schema.Class<InstanceCannotTerminate, Schema.TaggedStruct<"InstanceCannotTerminate", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class InstanceCannotTerminate extends InstanceCannotTerminate_base {
}
declare const InstanceNotFound_base: Schema.Class<InstanceNotFound, Schema.TaggedStruct<"InstanceNotFound", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class InstanceNotFound extends InstanceNotFound_base {
}
declare const InvalidBody_base: Schema.Class<InvalidBody, Schema.TaggedStruct<"InvalidBody", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class InvalidBody extends InvalidBody_base {
}
declare const InvalidRoute_base: Schema.Class<InvalidRoute, Schema.TaggedStruct<"InvalidRoute", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class InvalidRoute extends InvalidRoute_base {
}
declare const VersionNotFound_base: Schema.Class<VersionNotFound, Schema.TaggedStruct<"VersionNotFound", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class VersionNotFound extends VersionNotFound_base {
}
declare const WorkflowInternalError_base: Schema.Class<WorkflowInternalError, Schema.TaggedStruct<"WorkflowInternalError", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class WorkflowInternalError extends WorkflowInternalError_base {
}
declare const WorkflowNotFound_base: Schema.Class<WorkflowNotFound, Schema.TaggedStruct<"WorkflowNotFound", {
    readonly code: Schema.Number;
    readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
export declare class WorkflowNotFound extends WorkflowNotFound_base {
}
export interface GetInstanceRequest {
    workflowName: string;
    instanceId: string;
    accountId: string;
}
export declare const GetInstanceRequest: Schema.Schema<GetInstanceRequest>;
export interface GetInstanceResponse {
    end: string | null;
    error: {
        message: string;
        name: string;
    } | null;
    output: string | number | null;
    params: unknown;
    queued: string;
    start: string | null;
    status: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
    steps: ({
        attempts: {
            end: string | null;
            error: {
                message: string;
                name: string;
            } | null;
            start: string;
            success: boolean | null;
        }[];
        config: {
            retries: {
                delay: number;
                limit: number;
                backoff?: "constant" | "linear" | "exponential" | null;
            };
            timeout: unknown;
        };
        end: string | null;
        name: string;
        output: unknown;
        start: string;
        success: boolean | null;
        type: "step";
    } | {
        end: string;
        error: {
            message: string;
            name: string;
        } | null;
        finished: boolean;
        name: string;
        start: string;
        type: "sleep";
    } | {
        trigger: {
            source: string;
        };
        type: "termination";
    } | {
        end: string;
        error: {
            message: string;
            name: string;
        } | null;
        finished: boolean;
        name: string;
        output: string | number | boolean;
        start: string;
        type: "waitForEvent";
    })[];
    success: boolean | null;
    trigger: {
        source: "unknown" | "api" | "binding" | "event" | "cron";
    };
    versionId: string;
}
export declare const GetInstanceResponse: Schema.Schema<GetInstanceResponse>;
export type GetInstanceError = DefaultErrors | WorkflowNotFound | InvalidRoute | InstanceNotFound;
export declare const getInstance: API.OperationMethod<GetInstanceRequest, GetInstanceResponse, GetInstanceError, Credentials | HttpClient.HttpClient>;
export interface ListInstancesRequest {
    workflowName: string;
    /** Path param: */
    accountId: string;
    page?: number;
    perPage?: number;
    /** Query param: `page` and `cursor` are mutually exclusive, use one or the other. */
    cursor?: string;
    /** Query param: Accepts ISO 8601 with no timezone offsets and in UTC. */
    dateEnd?: string;
    /** Query param: Accepts ISO 8601 with no timezone offsets and in UTC. */
    dateStart?: string;
    /** Query param: should only be used when `cursor` is used, defines a new direction for the cursor */
    direction?: "asc" | "desc";
    /** Query param: */
    status?: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
}
export declare const ListInstancesRequest: Schema.Schema<ListInstancesRequest>;
export interface ListInstancesResponse {
    result: {
        id: string;
        createdOn: string;
        endedOn: string | null;
        modifiedOn: string;
        startedOn: string | null;
        status: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
        versionId: string;
        workflowId: string;
    }[];
    resultInfo?: {
        count?: number | null;
        page?: number | null;
        perPage?: number | null;
        totalCount?: number | null;
    } | null;
}
export declare const ListInstancesResponse: Schema.Schema<ListInstancesResponse>;
export type ListInstancesError = DefaultErrors | WorkflowNotFound | WorkflowInternalError | InvalidRoute | InvalidBody;
export declare const listInstances: API.PaginatedOperationMethod<ListInstancesRequest, ListInstancesResponse, ListInstancesError, Credentials | HttpClient.HttpClient>;
export interface CreateInstanceRequest {
    workflowName: string;
    /** Path param: */
    accountId: string;
    /** Body param: */
    instanceId?: string;
    /** Body param: */
    instanceRetention?: {
        errorRetention?: number | string;
        successRetention?: number | string;
    };
    /** Body param: */
    params?: unknown;
}
export declare const CreateInstanceRequest: Schema.Schema<CreateInstanceRequest>;
export interface CreateInstanceResponse {
    id: string;
    status: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
    versionId: string;
    workflowId: string;
}
export declare const CreateInstanceResponse: Schema.Schema<CreateInstanceResponse>;
export type CreateInstanceError = DefaultErrors | WorkflowNotFound | InstanceAlreadyExists | InvalidRoute | InvalidBody;
export declare const createInstance: API.OperationMethod<CreateInstanceRequest, CreateInstanceResponse, CreateInstanceError, Credentials | HttpClient.HttpClient>;
export interface BulkInstanceRequest {
    workflowName: string;
    /** Path param: */
    accountId: string;
    /** Body param: */
    body?: {
        instanceId?: string;
        instanceRetention?: {
            errorRetention?: number | string;
            successRetention?: number | string;
        };
        params?: unknown;
    }[];
}
export declare const BulkInstanceRequest: Schema.Schema<BulkInstanceRequest>;
export interface BulkInstanceResponse {
    result: {
        id: string;
        status: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
        versionId: string;
        workflowId: string;
    }[];
}
export declare const BulkInstanceResponse: Schema.Schema<BulkInstanceResponse>;
export type BulkInstanceError = DefaultErrors | WorkflowNotFound | InstanceAlreadyExists | InvalidRoute | InvalidBody;
export declare const bulkInstance: API.PaginatedOperationMethod<BulkInstanceRequest, BulkInstanceResponse, BulkInstanceError, Credentials | HttpClient.HttpClient>;
export interface CreateInstanceEventRequest {
    workflowName: string;
    instanceId: string;
    eventType: string;
    /** Path param: */
    accountId: string;
    /** Body param: */
    body?: unknown;
}
export declare const CreateInstanceEventRequest: Schema.Schema<CreateInstanceEventRequest>;
export type CreateInstanceEventResponse = unknown;
export declare const CreateInstanceEventResponse: Schema.Schema<CreateInstanceEventResponse>;
export type CreateInstanceEventError = DefaultErrors | WorkflowNotFound | InvalidRoute | InstanceNotFound | InvalidBody;
export declare const createInstanceEvent: API.OperationMethod<CreateInstanceEventRequest, CreateInstanceEventResponse, CreateInstanceEventError, Credentials | HttpClient.HttpClient>;
export interface PatchInstanceStatusRequest {
    workflowName: string;
    instanceId: string;
    /** Path param: */
    accountId: string;
    /** Body param: Apply action to instance. */
    status: "resume" | "pause" | "terminate" | "restart";
}
export declare const PatchInstanceStatusRequest: Schema.Schema<PatchInstanceStatusRequest>;
export interface PatchInstanceStatusResponse {
    status: "queued" | "running" | "paused" | "errored" | "terminated" | "complete" | "waitingForPause" | "waiting";
    /** Accepts ISO 8601 with no timezone offsets and in UTC. */
    timestamp: string;
}
export declare const PatchInstanceStatusResponse: Schema.Schema<PatchInstanceStatusResponse>;
export type PatchInstanceStatusError = DefaultErrors | WorkflowNotFound | InvalidRoute | InstanceNotFound | InstanceCannotTerminate;
export declare const patchInstanceStatus: API.OperationMethod<PatchInstanceStatusRequest, PatchInstanceStatusResponse, PatchInstanceStatusError, Credentials | HttpClient.HttpClient>;
export interface GetVersionRequest {
    workflowName: string;
    versionId: string;
    accountId: string;
}
export declare const GetVersionRequest: Schema.Schema<GetVersionRequest>;
export interface GetVersionResponse {
    id: string;
    className: string;
    createdOn: string;
    modifiedOn: string;
    workflowId: string;
}
export declare const GetVersionResponse: Schema.Schema<GetVersionResponse>;
export type GetVersionError = DefaultErrors | WorkflowNotFound | InvalidRoute | VersionNotFound;
export declare const getVersion: API.OperationMethod<GetVersionRequest, GetVersionResponse, GetVersionError, Credentials | HttpClient.HttpClient>;
export interface ListVersionsRequest {
    workflowName: string;
    /** Path param: */
    accountId: string;
    page?: number;
    perPage?: number;
}
export declare const ListVersionsRequest: Schema.Schema<ListVersionsRequest>;
export interface ListVersionsResponse {
    result: {
        id: string;
        className: string;
        createdOn: string;
        modifiedOn: string;
        workflowId: string;
    }[];
    resultInfo?: {
        count?: number | null;
        page?: number | null;
        perPage?: number | null;
        totalCount?: number | null;
    } | null;
}
export declare const ListVersionsResponse: Schema.Schema<ListVersionsResponse>;
export type ListVersionsError = DefaultErrors | WorkflowNotFound | InvalidRoute;
export declare const listVersions: API.PaginatedOperationMethod<ListVersionsRequest, ListVersionsResponse, ListVersionsError, Credentials | HttpClient.HttpClient>;
export interface GetWorkflowRequest {
    workflowName: string;
    accountId: string;
}
export declare const GetWorkflowRequest: Schema.Schema<GetWorkflowRequest>;
export interface GetWorkflowResponse {
    id: string;
    className: string;
    createdOn: string;
    instances: {
        complete?: number | null;
        errored?: number | null;
        paused?: number | null;
        queued?: number | null;
        running?: number | null;
        terminated?: number | null;
        waiting?: number | null;
        waitingForPause?: number | null;
    };
    modifiedOn: string;
    name: string;
    scriptName: string;
    triggeredOn: string | null;
}
export declare const GetWorkflowResponse: Schema.Schema<GetWorkflowResponse>;
export type GetWorkflowError = DefaultErrors | WorkflowNotFound | InvalidRoute;
export declare const getWorkflow: API.OperationMethod<GetWorkflowRequest, GetWorkflowResponse, GetWorkflowError, Credentials | HttpClient.HttpClient>;
export interface ListWorkflowsRequest {
    /** Path param: */
    accountId: string;
    page?: number;
    perPage?: number;
    /** Query param: Allows filtering workflows` name. */
    search?: string;
}
export declare const ListWorkflowsRequest: Schema.Schema<ListWorkflowsRequest>;
export interface ListWorkflowsResponse {
    result: {
        id: string;
        className: string;
        createdOn: string;
        instances: {
            complete?: number | null;
            errored?: number | null;
            paused?: number | null;
            queued?: number | null;
            running?: number | null;
            terminated?: number | null;
            waiting?: number | null;
            waitingForPause?: number | null;
        };
        modifiedOn: string;
        name: string;
        scriptName: string;
        triggeredOn: string | null;
    }[];
    resultInfo?: {
        count?: number | null;
        page?: number | null;
        perPage?: number | null;
        totalCount?: number | null;
    } | null;
}
export declare const ListWorkflowsResponse: Schema.Schema<ListWorkflowsResponse>;
export type ListWorkflowsError = DefaultErrors | InvalidRoute;
export declare const listWorkflows: API.PaginatedOperationMethod<ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsError, Credentials | HttpClient.HttpClient>;
export interface PutWorkflowRequest {
    workflowName: string;
    /** Path param: */
    accountId: string;
    /** Body param: */
    className: string;
    /** Body param: */
    scriptName: string;
}
export declare const PutWorkflowRequest: Schema.Schema<PutWorkflowRequest>;
export interface PutWorkflowResponse {
    id: string;
    className: string;
    createdOn: string;
    isDeleted?: number | null;
    modifiedOn: string;
    name: string;
    scriptName: string;
    terminatorRunning?: number | null;
    triggeredOn?: string | null;
    versionId: string;
}
export declare const PutWorkflowResponse: Schema.Schema<PutWorkflowResponse>;
export type PutWorkflowError = DefaultErrors | WorkflowInternalError | InvalidRoute;
export declare const putWorkflow: API.OperationMethod<PutWorkflowRequest, PutWorkflowResponse, PutWorkflowError, Credentials | HttpClient.HttpClient>;
export interface DeleteWorkflowRequest {
    workflowName: string;
    accountId: string;
}
export declare const DeleteWorkflowRequest: Schema.Schema<DeleteWorkflowRequest>;
export interface DeleteWorkflowResponse {
    status: "ok";
    success?: boolean | null;
}
export declare const DeleteWorkflowResponse: Schema.Schema<DeleteWorkflowResponse>;
export type DeleteWorkflowError = DefaultErrors | WorkflowNotFound | InvalidRoute;
export declare const deleteWorkflow: API.OperationMethod<DeleteWorkflowRequest, DeleteWorkflowResponse, DeleteWorkflowError, Credentials | HttpClient.HttpClient>;
export {};
//# sourceMappingURL=workflows.d.ts.map