| 1 | import type { |
| 2 | GetProductFeatureError, |
| 3 | GetProductFeatureRequest, |
| 4 | ProductFeature as StripeProductFeature, |
| 5 | } from "@distilled.cloud/stripe/stripe"; |
| 6 | import type * as Effect from "effect/Effect"; |
| 7 | import * as Binding from "../Binding.ts"; |
| 8 | import type { RuntimeContext } from "../RuntimeContext.ts"; |
| 9 | import type { ProductFeature } from "./ProductFeature.ts"; |
| 10 | |
| 11 | export interface RetrieveProductFeatureRequest extends Omit< |
| 12 | GetProductFeatureRequest, |
| 13 | "id" | "product" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Retrieve a bound Stripe Product Feature attachment over HTTP. |
| 18 | * |
| 19 | * ### Reading a Product Feature |
| 20 | * **Example:** Bind and retrieve |
| 21 | * ```typescript |
| 22 | * const retrieve = yield* Stripe.RetrieveProductFeature(seatsOnPro); |
| 23 | * const live = yield* retrieve(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | * @product Product |
| 28 | */ |
| 29 | export interface RetrieveProductFeature extends Binding.Service< |
| 30 | RetrieveProductFeature, |
| 31 | "Stripe.RetrieveProductFeature", |
| 32 | ( |
| 33 | productFeature: ProductFeature, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: RetrieveProductFeatureRequest, |
| 37 | ) => Effect.Effect< |
| 38 | StripeProductFeature, |
| 39 | GetProductFeatureError, |
| 40 | RuntimeContext |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const RetrieveProductFeature = Binding.Service<RetrieveProductFeature>( |
| 46 | "Stripe.RetrieveProductFeature", |
| 47 | ); |