1import type * as cloudfront from "@distilled.cloud/aws/cloudfront";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Distribution } from "./Distribution.ts";
5
6export interface ListInvalidationsRequest extends Omit<
7 cloudfront.ListInvalidationsRequest,
8 "DistributionId"
9> {}
10
11/**
12 * Runtime binding for `cloudfront:ListInvalidations`.
13 *
14 * Lists the cache invalidations of the bound distribution (paginated via
15 * `Marker`/`MaxItems`). Provide the implementation with
16 * `Effect.provide(AWS.CloudFront.ListInvalidationsHttp)`.
17 * ### Inspecting Invalidations
18 * **Example:** List Recent Invalidations
19 * ```typescript
20 * // init — bind the operation to the distribution
21 * const listInvalidations = yield* CloudFront.ListInvalidations(distribution);
22 *
23 * // runtime
24 * const res = yield* listInvalidations({ MaxItems: 10 });
25 * console.log(res.InvalidationList?.Items?.map((i) => i.Id));
26 * ```
27 *
28 * @binding
29 */
30export interface ListInvalidations extends Binding.Service<
31 ListInvalidations,
32 "AWS.CloudFront.ListInvalidations",
33 (
34 distribution: Distribution,
35 ) => Effect.Effect<
36 (
37 request: ListInvalidationsRequest,
38 ) => Effect.Effect<
39 cloudfront.ListInvalidationsResult,
40 cloudfront.ListInvalidationsError
41 >
42 >
43> {}
44
45export const ListInvalidations = Binding.Service<ListInvalidations>(
46 "AWS.CloudFront.ListInvalidations",
47);