1import type {
2 AppsSecret as StripeAppsSecret,
3 GetAppsSecretsFindError,
4 GetAppsSecretsFindRequest,
5} from "@distilled.cloud/stripe/stripe";
6import type * as Effect from "effect/Effect";
7import * as Binding from "../Binding.ts";
8import type { RuntimeContext } from "../RuntimeContext.ts";
9import type { AppsSecret } from "./AppsSecret.ts";
10
11export interface RetrieveAppsSecretRequest extends Omit<
12 GetAppsSecretsFindRequest,
13 "name" | "scope"
14> {}
15
16/**
17 * Retrieve a bound Stripe Apps Secret over HTTP. Find is keyed by
18 * `name` and `scope`, both taken from the bound resource.
19 *
20 * ### Reading an Apps Secret
21 * **Example:** Bind and retrieve
22 * ```typescript
23 * const retrieve = yield* Stripe.RetrieveAppsSecret(apiKey);
24 * const live = yield* retrieve({ expand: ["payload"] });
25 * ```
26 *
27 * @binding
28 * @product Secrets
29 */
30export interface RetrieveAppsSecret extends Binding.Service<
31 RetrieveAppsSecret,
32 "Stripe.RetrieveAppsSecret",
33 (
34 secret: AppsSecret,
35 ) => Effect.Effect<
36 (
37 request?: RetrieveAppsSecretRequest,
38 ) => Effect.Effect<
39 StripeAppsSecret,
40 GetAppsSecretsFindError,
41 RuntimeContext
42 >
43 >
44> {}
45
46export const RetrieveAppsSecret = Binding.Service<RetrieveAppsSecret>(
47 "Stripe.RetrieveAppsSecret",
48);