| 1 | import type * as ecrpublic from "@distilled.cloud/aws/ecr-public"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { PublicRepository } from "./Repository.ts"; |
| 5 | |
| 6 | /** Request for {@link BatchDeleteImage} — `repositoryName` is injected. */ |
| 7 | export interface BatchDeleteImageRequest extends Omit< |
| 8 | ecrpublic.BatchDeleteImageRequest, |
| 9 | "repositoryName" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `ecr-public:BatchDeleteImage`. |
| 14 | * |
| 15 | * Deletes images (by tag or digest) from the bound |
| 16 | * {@link PublicRepository}. Per-image failures (e.g. `ImageNotFound`) are |
| 17 | * reported in the response's `failures` list, not as errors. Provide the |
| 18 | * implementation with `Effect.provide(AWS.ECRPublic.BatchDeleteImageHttp)`. |
| 19 | * |
| 20 | * ### Deleting Images |
| 21 | * **Example:** Delete An Image By Tag |
| 22 | * ```typescript |
| 23 | * // init |
| 24 | * const batchDeleteImage = yield* AWS.ECRPublic.BatchDeleteImage(repository); |
| 25 | * |
| 26 | * // runtime |
| 27 | * const result = yield* batchDeleteImage({ |
| 28 | * imageIds: [{ imageTag: "stale" }], |
| 29 | * }); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface BatchDeleteImage extends Binding.Service< |
| 35 | BatchDeleteImage, |
| 36 | "AWS.ECRPublic.BatchDeleteImage", |
| 37 | <R extends PublicRepository>( |
| 38 | repository: R, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: BatchDeleteImageRequest, |
| 42 | ) => Effect.Effect< |
| 43 | ecrpublic.BatchDeleteImageResponse, |
| 44 | ecrpublic.BatchDeleteImageError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | |
| 49 | export const BatchDeleteImage = Binding.Service<BatchDeleteImage>( |
| 50 | "AWS.ECRPublic.BatchDeleteImage", |
| 51 | ); |