import type * as ag from "@distilled.cloud/aws/api-gateway"; import type * as Effect from "effect/Effect"; import * as Binding from "../../Binding.ts"; export interface CreateApiKeyRequest extends ag.CreateApiKeyRequest {} /** * Runtime binding for issuing API Gateway API keys * (`apigateway:POST` on `/apikeys`). Account-scoped — takes no resource. * * The response's `value` is `Redacted` (distilled marks it * sensitive), so the plaintext key never leaks into logs. Provide * `ApiGateway.CreateApiKeyHttp` on the Function effect to implement the * binding. * * ### Issuing API keys * **Example:** Issue a key for a new customer * ```typescript * import * as Redacted from "effect/Redacted"; * * // init — account-level binding takes no resource * const createApiKey = yield* ApiGateway.CreateApiKey(); * * // runtime * const key = yield* createApiKey({ * name: `customer-${customerId}`, * enabled: true, * }); * const plaintext = Redacted.isRedacted(key.value) * ? Redacted.value(key.value) * : key.value; * ``` * * @binding */ export interface CreateApiKey extends Binding.Service< CreateApiKey, "AWS.ApiGateway.CreateApiKey", () => Effect.Effect< ( request?: CreateApiKeyRequest, ) => Effect.Effect > > {} export const CreateApiKey = Binding.Service( "AWS.ApiGateway.CreateApiKey", );