1import type {
2 BillingAlert as StripeBillingAlert,
3 GetBillingAlertError,
4 GetBillingAlertRequest,
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 { Alert } from "./Alert.ts";
10
11export interface RetrieveAlertRequest extends Omit<
12 GetBillingAlertRequest,
13 "id"
14> {}
15
16/**
17 * Retrieve a bound Stripe Billing Alert over HTTP.
18 *
19 * ### Reading an Alert
20 * **Example:** Bind and retrieve
21 * ```typescript
22 * const retrieve = yield* Stripe.RetrieveAlert(highUsage);
23 * const live = yield* retrieve();
24 * ```
25 *
26 * @binding
27 * @product Billing
28 */
29export interface RetrieveAlert extends Binding.Service<
30 RetrieveAlert,
31 "Stripe.RetrieveAlert",
32 (
33 alert: Alert,
34 ) => Effect.Effect<
35 (
36 request?: RetrieveAlertRequest,
37 ) => Effect.Effect<StripeBillingAlert, GetBillingAlertError, RuntimeContext>
38 >
39> {}
40
41export const RetrieveAlert = Binding.Service<RetrieveAlert>(
42 "Stripe.RetrieveAlert",
43);