1import type * as paymentcryptographydata from "@distilled.cloud/aws/payment-cryptography-data";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Key } from "./Key.ts";
5
6export interface DecryptDataRequest extends Omit<
7 paymentcryptographydata.DecryptDataInput,
8 "KeyIdentifier"
9> {}
10
11/**
12 * Runtime binding for `payment-cryptography:DecryptData` — decrypts
13 * ciphertext under a {@link Key}. Provide `DecryptDataHttp` on the Function
14 * to satisfy this service.
15 * ### Decrypting Data
16 * **Example:** Decrypt ciphertext
17 * ```typescript
18 * // init
19 * const decrypt = yield* PaymentCryptography.DecryptData(key);
20 *
21 * // runtime
22 * const result = yield* decrypt({
23 * CipherText: cipherText,
24 * DecryptionAttributes: {
25 * Symmetric: { Mode: "CBC", InitializationVector: "00000000000000000000000000000000" },
26 * },
27 * });
28 * ```
29 *
30 * @binding
31 */
32export interface DecryptData extends Binding.Service<
33 DecryptData,
34 "AWS.PaymentCryptography.DecryptData",
35 <K extends Key>(
36 key: K,
37 ) => Effect.Effect<
38 (
39 request: DecryptDataRequest,
40 ) => Effect.Effect<
41 paymentcryptographydata.DecryptDataOutput,
42 paymentcryptographydata.DecryptDataError
43 >
44 >
45> {}
46
47export const DecryptData = Binding.Service<DecryptData>(
48 "AWS.PaymentCryptography.DecryptData",
49);