1import type {
2 GetPriceError,
3 GetPriceRequest,
4 Price as StripePrice,
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 { Price } from "./Price.ts";
10
11export interface RetrievePriceRequest extends Omit<GetPriceRequest, "price"> {}
12
13/**
14 * Retrieve a bound Stripe Price over HTTP.
15 *
16 * ### Reading a Price
17 * **Example:** Bind and retrieve
18 * ```typescript
19 * const retrieve = yield* Stripe.RetrievePrice(price);
20 * const live = yield* retrieve();
21 * ```
22 *
23 * @binding
24 * @product Product
25 */
26export interface RetrievePrice extends Binding.Service<
27 RetrievePrice,
28 "Stripe.RetrievePrice",
29 (
30 price: Price,
31 ) => Effect.Effect<
32 (
33 request?: RetrievePriceRequest,
34 ) => Effect.Effect<StripePrice, GetPriceError, RuntimeContext>
35 >
36> {}
37
38export const RetrievePrice = Binding.Service<RetrievePrice>(
39 "Stripe.RetrievePrice",
40);