1import type * as ag from "@distilled.cloud/aws/api-gateway";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { UsagePlan } from "./UsagePlan.ts";
5
6export interface GetUsagePlanKeysRequest extends Omit<
7 ag.GetUsagePlanKeysRequest,
8 "usagePlanId"
9> {}
10
11/**
12 * Runtime binding for listing the API keys enrolled in a
13 * {@link UsagePlan} (`apigateway:GET` on `/usageplans/{id}/keys`).
14 *
15 * Provide `ApiGateway.GetUsagePlanKeysHttp` on the Function effect to
16 * implement the binding.
17 *
18 * ### Managing plan keys
19 * **Example:** List enrolled keys
20 * ```typescript
21 * // init
22 * const getUsagePlanKeys = yield* ApiGateway.GetUsagePlanKeys(plan);
23 *
24 * // runtime
25 * const page = yield* getUsagePlanKeys({ limit: 100 });
26 * ```
27 *
28 * @binding
29 */
30export interface GetUsagePlanKeys extends Binding.Service<
31 GetUsagePlanKeys,
32 "AWS.ApiGateway.GetUsagePlanKeys",
33 <P extends UsagePlan>(
34 usagePlan: P,
35 ) => Effect.Effect<
36 (
37 request?: GetUsagePlanKeysRequest,
38 ) => Effect.Effect<ag.UsagePlanKeys, ag.GetUsagePlanKeysError>
39 >
40> {}
41export const GetUsagePlanKeys = Binding.Service<GetUsagePlanKeys>(
42 "AWS.ApiGateway.GetUsagePlanKeys",
43);