| 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 UpdateApiKeyRequest extends ag.UpdateApiKeyRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for patching an API Gateway API key |
| 9 | * (`apigateway:PATCH` on `/apikeys/{id}`). Account-scoped — takes no |
| 10 | * resource. |
| 11 | * |
| 12 | * Provide `ApiGateway.UpdateApiKeyHttp` on the Function effect to |
| 13 | * implement the binding. |
| 14 | * |
| 15 | * ### Managing API keys |
| 16 | * **Example:** Disable a key |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const updateApiKey = yield* ApiGateway.UpdateApiKey(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * yield* updateApiKey({ |
| 23 | * apiKey: keyId, |
| 24 | * patchOperations: [{ op: "replace", path: "/enabled", value: "false" }], |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface UpdateApiKey extends Binding.Service< |
| 31 | UpdateApiKey, |
| 32 | "AWS.ApiGateway.UpdateApiKey", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request: UpdateApiKeyRequest, |
| 36 | ) => Effect.Effect<ag.ApiKey, ag.UpdateApiKeyError> |
| 37 | > |
| 38 | > {} |
| 39 | export const UpdateApiKey = Binding.Service<UpdateApiKey>( |
| 40 | "AWS.ApiGateway.UpdateApiKey", |
| 41 | ); |