1import type * as glue from "@distilled.cloud/aws/glue";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Crawler } from "./Crawler.ts";
5
6/**
7 * Runtime binding for `glue:StopCrawler`.
8 *
9 * Stops an in-progress crawl of the bound {@link Crawler}. Fails with the
10 * typed `CrawlerNotRunningException` when idle and
11 * `CrawlerStoppingException` when a stop is already underway. The crawler
12 * name is injected from the binding. Provide the implementation with
13 * `Effect.provide(AWS.Glue.StopCrawlerHttp)`.
14 * ### Running Crawlers
15 * **Example:** Stop a Crawl
16 * ```typescript
17 * // init
18 * const stopCrawler = yield* AWS.Glue.StopCrawler(crawler);
19 *
20 * // runtime — tolerate an idle or already-stopping crawler
21 * yield* stopCrawler().pipe(
22 * Effect.catchTag(
23 * ["CrawlerNotRunningException", "CrawlerStoppingException"],
24 * () => Effect.void,
25 * ),
26 * );
27 * ```
28 *
29 * @binding
30 */
31export interface StopCrawler extends Binding.Service<
32 StopCrawler,
33 "AWS.Glue.StopCrawler",
34 (
35 crawler: Crawler,
36 ) => Effect.Effect<
37 () => Effect.Effect<glue.StopCrawlerResponse, glue.StopCrawlerError>
38 >
39> {}
40
41export const StopCrawler = Binding.Service<StopCrawler>("AWS.Glue.StopCrawler");