/**
 * 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 * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// Errors
// =============================================================================
export class InstanceAlreadyExists extends Schema.TaggedErrorClass()("InstanceAlreadyExists", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InstanceAlreadyExists, [{ code: 10405 }]);
export class InstanceCannotTerminate extends Schema.TaggedErrorClass()("InstanceCannotTerminate", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InstanceCannotTerminate, [{ code: 10401 }]);
export class InstanceNotFound extends Schema.TaggedErrorClass()("InstanceNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InstanceNotFound, [{ code: 10201 }, { code: 10400 }]);
export class InvalidBody extends Schema.TaggedErrorClass()("InvalidBody", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidBody, [{ code: 10002 }]);
export class InvalidRoute extends Schema.TaggedErrorClass()("InvalidRoute", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
export class VersionNotFound extends Schema.TaggedErrorClass()("VersionNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(VersionNotFound, [{ code: 10300 }]);
export class WorkflowInternalError extends Schema.TaggedErrorClass()("WorkflowInternalError", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(WorkflowInternalError, [{ code: 10001 }]);
export class WorkflowNotFound extends Schema.TaggedErrorClass()("WorkflowNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(WorkflowNotFound, [{ code: 10200 }]);
export const GetInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    instanceId: Schema.String.pipe(T.HttpPath("instanceId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances/{instanceId}",
}));
export const GetInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    end: Schema.Union([Schema.String, Schema.Null]),
    error: Schema.Union([
        Schema.Struct({
            message: Schema.String,
            name: Schema.String,
        }),
        Schema.Null,
    ]),
    output: Schema.Union([Schema.String, Schema.Number, Schema.Null]),
    params: Schema.Unknown,
    queued: Schema.String,
    start: Schema.Union([Schema.String, Schema.Null]),
    status: Schema.Literals([
        "queued",
        "running",
        "paused",
        "errored",
        "terminated",
        "complete",
        "waitingForPause",
        "waiting",
    ]),
    steps: Schema.Array(Schema.Union([
        Schema.Struct({
            attempts: Schema.Array(Schema.Struct({
                end: Schema.Union([Schema.String, Schema.Null]),
                error: Schema.Union([
                    Schema.Struct({
                        message: Schema.String,
                        name: Schema.String,
                    }),
                    Schema.Null,
                ]),
                start: Schema.String,
                success: Schema.Union([Schema.Boolean, Schema.Null]),
            })),
            config: Schema.Struct({
                retries: Schema.Struct({
                    delay: Schema.Number,
                    limit: Schema.Number,
                    backoff: Schema.optional(Schema.Union([
                        Schema.Literals(["constant", "linear", "exponential"]),
                        Schema.Null,
                    ])),
                }),
                timeout: Schema.Unknown,
            }),
            end: Schema.Union([Schema.String, Schema.Null]),
            name: Schema.String,
            output: Schema.Unknown,
            start: Schema.String,
            success: Schema.Union([Schema.Boolean, Schema.Null]),
            type: Schema.Literal("step"),
        }),
        Schema.Struct({
            end: Schema.String,
            error: Schema.Union([
                Schema.Struct({
                    message: Schema.String,
                    name: Schema.String,
                }),
                Schema.Null,
            ]),
            finished: Schema.Boolean,
            name: Schema.String,
            output: Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
            start: Schema.String,
            type: Schema.Literal("waitForEvent"),
        }),
        Schema.Struct({
            end: Schema.String,
            error: Schema.Union([
                Schema.Struct({
                    message: Schema.String,
                    name: Schema.String,
                }),
                Schema.Null,
            ]),
            finished: Schema.Boolean,
            name: Schema.String,
            start: Schema.String,
            type: Schema.Literal("sleep"),
        }),
        Schema.Struct({
            trigger: Schema.Struct({
                source: Schema.String,
            }),
            type: Schema.Literal("termination"),
        }),
    ])),
    success: Schema.Union([Schema.Boolean, Schema.Null]),
    trigger: Schema.Struct({
        source: Schema.Literals(["unknown", "api", "binding", "event", "cron"]),
    }),
    versionId: Schema.String,
}).pipe(T.ResponsePath("result"));
export const getInstance = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInstanceRequest,
    output: GetInstanceResponse,
    errors: [WorkflowNotFound, InvalidRoute, InstanceNotFound],
}));
export const ListInstancesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
    dateEnd: Schema.optional(Schema.String).pipe(T.HttpQuery("date_end")),
    dateStart: Schema.optional(Schema.String).pipe(T.HttpQuery("date_start")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    status: Schema.optional(Schema.Literals([
        "queued",
        "running",
        "paused",
        "errored",
        "terminated",
        "complete",
        "waitingForPause",
        "waiting",
    ])).pipe(T.HttpQuery("status")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances",
}));
export const ListInstancesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        endedOn: Schema.Union([Schema.String, Schema.Null]),
        modifiedOn: Schema.String,
        startedOn: Schema.Union([Schema.String, Schema.Null]),
        status: Schema.Literals([
            "queued",
            "running",
            "paused",
            "errored",
            "terminated",
            "complete",
            "waitingForPause",
            "waiting",
        ]),
        versionId: Schema.String,
        workflowId: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        endedOn: "ended_on",
        modifiedOn: "modified_on",
        startedOn: "started_on",
        status: "status",
        versionId: "version_id",
        workflowId: "workflow_id",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listInstances = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInstancesRequest,
    output: ListInstancesResponse,
    errors: [WorkflowNotFound, WorkflowInternalError, InvalidRoute, InvalidBody],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    instanceId: Schema.optional(Schema.String),
    instanceRetention: Schema.optional(Schema.Struct({
        errorRetention: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
        successRetention: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
    }).pipe(Schema.encodeKeys({
        errorRetention: "error_retention",
        successRetention: "success_retention",
    }))),
    params: Schema.optional(Schema.Unknown),
}).pipe(Schema.encodeKeys({
    instanceId: "instance_id",
    instanceRetention: "instance_retention",
    params: "params",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances",
}));
export const CreateInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    status: Schema.Literals([
        "queued",
        "running",
        "paused",
        "errored",
        "terminated",
        "complete",
        "waitingForPause",
        "waiting",
    ]),
    versionId: Schema.String,
    workflowId: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    status: "status",
    versionId: "version_id",
    workflowId: "workflow_id",
}))
    .pipe(T.ResponsePath("result"));
export const createInstance = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateInstanceRequest,
    output: CreateInstanceResponse,
    errors: [WorkflowNotFound, InstanceAlreadyExists, InvalidRoute, InvalidBody],
}));
export const BulkInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    body: Schema.optional(Schema.Array(Schema.Struct({
        instanceId: Schema.optional(Schema.String),
        instanceRetention: Schema.optional(Schema.Struct({
            errorRetention: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
            successRetention: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
        }).pipe(Schema.encodeKeys({
            errorRetention: "error_retention",
            successRetention: "success_retention",
        }))),
        params: Schema.optional(Schema.Unknown),
    }).pipe(Schema.encodeKeys({
        instanceId: "instance_id",
        instanceRetention: "instance_retention",
        params: "params",
    })))).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances/batch",
}));
export const BulkInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        status: Schema.Literals([
            "queued",
            "running",
            "paused",
            "errored",
            "terminated",
            "complete",
            "waitingForPause",
            "waiting",
        ]),
        versionId: Schema.String,
        workflowId: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        status: "status",
        versionId: "version_id",
        workflowId: "workflow_id",
    }))),
});
export const bulkInstance = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkInstanceRequest,
    output: BulkInstanceResponse,
    errors: [WorkflowNotFound, InstanceAlreadyExists, InvalidRoute, InvalidBody],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateInstanceEventRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    instanceId: Schema.String.pipe(T.HttpPath("instanceId")),
    eventType: Schema.String.pipe(T.HttpPath("eventType")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    body: Schema.optional(Schema.Unknown).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances/{instanceId}/events/{eventType}",
}));
export const CreateInstanceEventResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const createInstanceEvent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateInstanceEventRequest,
    output: CreateInstanceEventResponse,
    errors: [WorkflowNotFound, InvalidRoute, InstanceNotFound, InvalidBody],
}));
export const PatchInstanceStatusRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    instanceId: Schema.String.pipe(T.HttpPath("instanceId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    status: Schema.Literals(["resume", "pause", "terminate", "restart"]),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/workflows/{workflowName}/instances/{instanceId}/status",
}));
export const PatchInstanceStatusResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    status: Schema.Literals([
        "queued",
        "running",
        "paused",
        "errored",
        "terminated",
        "complete",
        "waitingForPause",
        "waiting",
    ]),
    timestamp: Schema.String,
}).pipe(T.ResponsePath("result"));
export const patchInstanceStatus = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchInstanceStatusRequest,
    output: PatchInstanceStatusResponse,
    errors: [
        WorkflowNotFound,
        InvalidRoute,
        InstanceNotFound,
        InstanceCannotTerminate,
    ],
}));
export const GetVersionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    versionId: Schema.String.pipe(T.HttpPath("versionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/workflows/{workflowName}/versions/{versionId}",
}));
export const GetVersionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    className: Schema.String,
    createdOn: Schema.String,
    modifiedOn: Schema.String,
    workflowId: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    className: "class_name",
    createdOn: "created_on",
    modifiedOn: "modified_on",
    workflowId: "workflow_id",
}))
    .pipe(T.ResponsePath("result"));
export const getVersion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetVersionRequest,
    output: GetVersionResponse,
    errors: [WorkflowNotFound, InvalidRoute, VersionNotFound],
}));
export const ListVersionsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/workflows/{workflowName}/versions",
}));
export const ListVersionsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        className: Schema.String,
        createdOn: Schema.String,
        modifiedOn: Schema.String,
        workflowId: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        className: "class_name",
        createdOn: "created_on",
        modifiedOn: "modified_on",
        workflowId: "workflow_id",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listVersions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListVersionsRequest,
    output: ListVersionsResponse,
    errors: [WorkflowNotFound, InvalidRoute],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetWorkflowRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/workflows/{workflowName}",
}));
export const GetWorkflowResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    className: Schema.String,
    createdOn: Schema.String,
    instances: Schema.Struct({
        complete: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        errored: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        paused: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        queued: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        running: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        terminated: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        waiting: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        waitingForPause: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    }),
    modifiedOn: Schema.String,
    name: Schema.String,
    scriptName: Schema.String,
    triggeredOn: Schema.Union([Schema.String, Schema.Null]),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    className: "class_name",
    createdOn: "created_on",
    instances: "instances",
    modifiedOn: "modified_on",
    name: "name",
    scriptName: "script_name",
    triggeredOn: "triggered_on",
}))
    .pipe(T.ResponsePath("result"));
export const getWorkflow = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetWorkflowRequest,
    output: GetWorkflowResponse,
    errors: [WorkflowNotFound, InvalidRoute],
}));
export const ListWorkflowsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/workflows" }));
export const ListWorkflowsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        className: Schema.String,
        createdOn: Schema.String,
        instances: Schema.Struct({
            complete: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            errored: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            paused: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            queued: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            running: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            terminated: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            waiting: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            waitingForPause: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        modifiedOn: Schema.String,
        name: Schema.String,
        scriptName: Schema.String,
        triggeredOn: Schema.Union([Schema.String, Schema.Null]),
    }).pipe(Schema.encodeKeys({
        id: "id",
        className: "class_name",
        createdOn: "created_on",
        instances: "instances",
        modifiedOn: "modified_on",
        name: "name",
        scriptName: "script_name",
        triggeredOn: "triggered_on",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listWorkflows = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListWorkflowsRequest,
    output: ListWorkflowsResponse,
    errors: [InvalidRoute],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PutWorkflowRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    className: Schema.String,
    scriptName: Schema.String,
}).pipe(Schema.encodeKeys({ className: "class_name", scriptName: "script_name" }), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/workflows/{workflowName}",
}));
export const PutWorkflowResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    className: Schema.String,
    createdOn: Schema.String,
    isDeleted: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.String,
    name: Schema.String,
    scriptName: Schema.String,
    terminatorRunning: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    triggeredOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    versionId: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    className: "class_name",
    createdOn: "created_on",
    isDeleted: "is_deleted",
    modifiedOn: "modified_on",
    name: "name",
    scriptName: "script_name",
    terminatorRunning: "terminator_running",
    triggeredOn: "triggered_on",
    versionId: "version_id",
}))
    .pipe(T.ResponsePath("result"));
export const putWorkflow = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutWorkflowRequest,
    output: PutWorkflowResponse,
    errors: [WorkflowInternalError, InvalidRoute],
}));
export const DeleteWorkflowRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    workflowName: Schema.String.pipe(T.HttpPath("workflowName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/workflows/{workflowName}",
}));
export const DeleteWorkflowResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    status: Schema.Literal("ok"),
    success: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteWorkflow = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteWorkflowRequest,
    output: DeleteWorkflowResponse,
    errors: [WorkflowNotFound, InvalidRoute],
}));
//# sourceMappingURL=workflows.js.map