1import type * as amplify from "@distilled.cloud/aws/amplify";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { App } from "./App.ts";
5
6export interface StopJobRequest extends Omit<amplify.StopJobRequest, "appId"> {}
7
8/**
9 * Runtime binding for `amplify:StopJob`.
10 *
11 * Bind an {@link App} in the function's init phase to get a callable that
12 * cancels an in-progress build job on one of the app's branches. Provide the
13 * implementation with `Effect.provide(AWS.Amplify.StopJobHttp)`.
14 * ### Controlling Jobs
15 * **Example:** Cancel a Running Build
16 * ```typescript
17 * // init — bind the operation to the app
18 * const stopJob = yield* AWS.Amplify.StopJob(app);
19 *
20 * // runtime — cancel the job
21 * const { jobSummary } = yield* stopJob({
22 * branchName: "main",
23 * jobId: "42",
24 * });
25 * ```
26 *
27 * @binding
28 */
29export interface StopJob extends Binding.Service<
30 StopJob,
31 "AWS.Amplify.StopJob",
32 (
33 app: App,
34 ) => Effect.Effect<
35 (
36 request: StopJobRequest,
37 ) => Effect.Effect<amplify.StopJobResult, amplify.StopJobError>
38 >
39> {}
40
41export const StopJob = Binding.Service<StopJob>("AWS.Amplify.StopJob");