sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Bedrock/ StopIngestionJob.ts

import type * as bedrock from "@distilled.cloud/aws/bedrock-agent";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { DataSource } from "./DataSource.ts";

/**
 * The `StopIngestionJob` request with the binding-injected
 * `knowledgeBaseId` and `dataSourceId` removed — they are supplied
 * automatically from the bound {@link DataSource}.
 */
export interface StopIngestionJobRequest extends Omit<
  bedrock.StopIngestionJobRequest,
  "knowledgeBaseId" | "dataSourceId"
> {}

/**
 * Runtime binding for `bedrock-agent:StopIngestionJob` — stop an in-flight
 * ingestion job on the bound {@link DataSource}.
 *
 * The binding grants the function `bedrock:StopIngestionJob` scoped to the
 * data source's parent knowledge base.
 *
 * ### Syncing a Data Source
 * **Example:** Stop a Running Ingestion Job
 * ```typescript
 * // init
 * const stopIngestionJob = yield* Bedrock.StopIngestionJob(dataSource);
 *
 * // runtime
 * const { ingestionJob } = yield* stopIngestionJob({
 *   ingestionJobId: jobId,
 * });
 * ```
 *
 * @binding
 */
export interface StopIngestionJob extends Binding.Service<
  StopIngestionJob,
  "AWS.Bedrock.StopIngestionJob",
  <D extends DataSource>(
    dataSource: D,
  ) => Effect.Effect<
    (
      request: StopIngestionJobRequest,
    ) => Effect.Effect<bedrock.StopIngestionJobResponse, bedrock.StopIngestionJobError>
  >
> {}
export const StopIngestionJob = Binding.Service<StopIngestionJob>("AWS.Bedrock.StopIngestionJob");