| 1 | import type * as ag from "@distilled.cloud/aws/api-gateway"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface GetApiKeyRequest extends ag.GetApiKeyRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for reading a single API Gateway API key |
| 9 | * (`apigateway:GET` on `/apikeys/{id}`). Account-scoped — takes no |
| 10 | * resource. |
| 11 | * |
| 12 | * With `includeValue: true` the response's `value` is `Redacted<string>`. |
| 13 | * Provide `ApiGateway.GetApiKeyHttp` on the Function effect to implement |
| 14 | * the binding. |
| 15 | * |
| 16 | * ### Managing API keys |
| 17 | * **Example:** Look up a key |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const getApiKey = yield* ApiGateway.GetApiKey(); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const key = yield* getApiKey({ apiKey: keyId }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetApiKey extends Binding.Service< |
| 29 | GetApiKey, |
| 30 | "AWS.ApiGateway.GetApiKey", |
| 31 | () => Effect.Effect< |
| 32 | (request: GetApiKeyRequest) => Effect.Effect<ag.ApiKey, ag.GetApiKeyError> |
| 33 | > |
| 34 | > {} |
| 35 | export const GetApiKey = Binding.Service<GetApiKey>("AWS.ApiGateway.GetApiKey"); |