1import type {
2 BillingCreditGrant as StripeCreditGrant,
3 GetBillingCreditGrantError,
4 GetBillingCreditGrantRequest,
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 { CreditGrant } from "./CreditGrant.ts";
10
11export interface RetrieveCreditGrantRequest extends Omit<
12 GetBillingCreditGrantRequest,
13 "id"
14> {}
15
16/**
17 * Retrieve a bound Stripe Credit Grant over HTTP.
18 *
19 * ### Reading a Credit Grant
20 * **Example:** Bind and retrieve
21 * ```typescript
22 * const retrieve = yield* Stripe.RetrieveCreditGrant(grant);
23 * const live = yield* retrieve();
24 * ```
25 *
26 * @binding
27 * @product Billing
28 */
29export interface RetrieveCreditGrant extends Binding.Service<
30 RetrieveCreditGrant,
31 "Stripe.RetrieveCreditGrant",
32 (
33 grant: CreditGrant,
34 ) => Effect.Effect<
35 (
36 request?: RetrieveCreditGrantRequest,
37 ) => Effect.Effect<
38 StripeCreditGrant,
39 GetBillingCreditGrantError,
40 RuntimeContext
41 >
42 >
43> {}
44
45export const RetrieveCreditGrant = Binding.Service<RetrieveCreditGrant>(
46 "Stripe.RetrieveCreditGrant",
47);